Skip to content

DEVOPS-690: poetry2#124

Merged
sebhmg merged 19 commits intodevelopfrom
DEVOPS-690-poetry2
Aug 15, 2025
Merged

DEVOPS-690: poetry2#124
sebhmg merged 19 commits intodevelopfrom
DEVOPS-690-poetry2

Conversation

@andrewg-mira
Copy link
Copy Markdown
Contributor

@andrewg-mira andrewg-mira commented Apr 24, 2025

DEVOPS-690 - use Poetry 2 and have pyproject.toml checked by pre-commit

@github-actions github-actions Bot changed the title DEVOPS-690 poetry2 DEVOPS-690: poetry2 Apr 24, 2025
@andrewg-mira andrewg-mira force-pushed the DEVOPS-690-poetry2 branch 2 times, most recently from 72efcff to 66df72f Compare April 24, 2025 18:40
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.74%. Comparing base (9233752) to head (ba8ea26).
⚠️ Report is 20 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #124   +/-   ##
========================================
  Coverage    84.74%   84.74%           
========================================
  Files           18       18           
  Lines          983      983           
  Branches       129      129           
========================================
  Hits           833      833           
  Misses         112      112           
  Partials        38       38           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@sebhmg sebhmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

five small changes please:

  • move [build-system] section at the very top of pyproject.toml
  • move requires-poetry = ">=2.0" at the top of the [tool.poetry] section
  • declare dependencies as dynamic
  • revert .pre-commit-config.yaml
  • add poetry check to pre-commit config. See example in geoh5py: https://github.com/MiraGeoscience/geoh5py/blob/develop/.pre-commit-config.yaml#L14
    -   repo: https://github.com/python-poetry/poetry
        rev: 2.1.1
        hooks:
        -   id: poetry-check
            args: [--lock]

Comment thread .pre-commit-config.yaml
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml
@sebhmg
Copy link
Copy Markdown
Contributor

sebhmg commented Apr 25, 2025

@andrewg-mira, also try relocking with deps-lock to see if it still understands pyproject.toml

Make sure to use latest version from https://github.com/MiraGeoscience/py-deps-lock
I also recommend you force a download of the newer micromamba version by removing beforehand %localappdata%\ensure-conda\ensure-conda

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 77544b0 and detected 0 issues on this pull request.

View more on Code Climate.

sebhmg
sebhmg previously requested changes May 30, 2025
Copy link
Copy Markdown
Contributor

@sebhmg sebhmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please:

  1. move the [build-system] section at the top
  2. try adding the poetry-check hook as the first hook in pre-commit
-   repo: https://github.com/python-poetry/poetry
    rev: 2.1.3
    hooks:
    -   id: poetry-check

it used not to like some constructions for conda-lock, but maybe it will accept them now

Comment thread pyproject.toml
@sebhmg sebhmg marked this pull request as draft August 14, 2025 14:20
@sebhmg sebhmg dismissed their stale review August 15, 2025 02:23

I have applied the last changes

@sebhmg sebhmg marked this pull request as ready for review August 15, 2025 02:23
@sebhmg sebhmg requested review from Copilot and saicheranb August 15, 2025 02:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the project to use Poetry 2 instead of Poetry 1 and adds pyproject.toml validation through pre-commit hooks. The migration involves reorganizing the pyproject.toml file to use the modern standard project metadata format while maintaining backward compatibility with Poetry's dependency management.

  • Updates Poetry configuration to use version 2.x format with PEP 621 standard project metadata
  • Migrates version format from 0.6.0-alpha.1 to 0.6.0a1 to comply with PEP 440
  • Adds Poetry validation to pre-commit hooks and updates development environment dependencies

Reviewed Changes

Copilot reviewed 17 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Restructures configuration for Poetry 2 with PEP 621 project metadata and modern build system
tests/version_test.py Updates version parsing logic and replaces semver validation with PEP 440 validation
geoapps_utils/init.py Updates package version to use PEP 440 compliant format
environments/*.conda.lock.yml Updates conda lock files with newer package versions and dependency hashes
.pre-commit-config.yaml Adds Poetry validation hook to ensure pyproject.toml correctness
.github/workflows/python_analysis.yml Temporarily points to development branch for CI tools

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread .github/workflows/python_analysis.yml Outdated
Comment thread .github/workflows/python_analysis.yml Outdated
@sebhmg sebhmg merged commit 183ed8f into develop Aug 15, 2025
14 checks passed
@sebhmg sebhmg deleted the DEVOPS-690-poetry2 branch August 15, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants