Skip to content

Migrate build to Poetry and prep for PyPI release#8

Open
faizollah wants to merge 1 commit into
mainfrom
poetry-release
Open

Migrate build to Poetry and prep for PyPI release#8
faizollah wants to merge 1 commit into
mainfrom
poetry-release

Conversation

@faizollah

Copy link
Copy Markdown
Collaborator

Release-prep for #4 (publish to PyPI). This is the code half; #4 closes once the package is actually live on PyPI.

What changed

  • Build backend hatchling → poetry-core. Kept the PEP 621 [project] layout, so dependency constraints are preserved exactly (no caret upper-caps introduced). Added poetry.lock for reproducible dev/CI.
  • Added [project.urls] — Homepage / Repository / Issues → this repo.
  • Fixed requires-python. >=3.9 was never actually valid: flwr requires >=3.10, and flwr 1.31+ requires >=3.11. Set to >=3.11,<4.0 — matches flwr and our dev environments, and is what lets Poetry resolve a lockfile. Hatchling never checked this; Poetry's resolver surfaced it.
  • Dropped Python 3.10 from the CI matrix to match the new floor.
  • README: install now leads with pip install flwrcrate; states Python ≥ 3.11; source URL points at eScienceLab.

⚠️ Reviewer note (support policy)

This raises the minimum Python from an (invalid) 3.9 to 3.11, dropping 3.10. Rationale: flwr 1.31+ already requires 3.11, so keeping 3.10 would pin those users to flwr ≤ 1.30. Happy to instead keep 3.10 with split flwr constraints if we want to preserve it — flagging since it's a public support change.

Verification

  • poetry build → valid sdist + wheel; wheel contains only flwrcrate/ (no tests), correct metadata (Requires-Python: >=3.11,<4.0, MIT, all URLs).
  • Wheel installs with its full dependency tree into a clean venv and imports (from flwrcrate import FLCrateTracker OK).
  • 51 tests pass at 92% coverage.

Part of #4

Switch the build backend from hatchling to poetry-core, keeping the PEP 621
[project] layout so exact dependency constraints are preserved (no caret
upper-caps introduced). Add poetry.lock for reproducible dev/CI.

- Add [project.urls] (Homepage/Repository/Issues -> eScienceLab/flwrCrate)
- Fix requires-python: ">=3.9" was never valid because flwr requires >=3.10
  (and flwr 1.31+ requires >=3.11). Set ">=3.11,<4.0" to match flwr and the
  supported dev environments; this is what lets Poetry resolve a lockfile.
- Drop Python 3.10 from the CI matrix to match the new floor
- README: lead install with `pip install flwrcrate`, state Python >=3.11,
  and point the source URL at eScienceLab

Verified: poetry build produces a valid sdist+wheel; the wheel installs with
its full dependency tree into a clean venv and imports; 51 tests pass at 92%
coverage.

Part of #4

@elichad elichad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

looks good - a few minor recommendations

fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the latest Python version is 3.14 - are we able to test and support up to that?

Comment thread pyproject.toml
"flwr>=1.29.0",
"rocrate>=0.13",
"tomli>=2.0; python_version < '3.11'",
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I recommend adding authors and maintainers to this metadata (see https://packaging.python.org/en/latest/specifications/pyproject-toml/#authors-maintainers) - so you get credit for this work! the maintainers get listed automatically on the PyPI page for the package I think

Comment thread pyproject.toml
dependencies = [
"flwr>=1.29.0",
"rocrate>=0.13",
"tomli>=2.0; python_version < '3.11'",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this tomli line still needed if we do not support versions below 3.11?

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.

2 participants