-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change python packaging system from setuptools to Poetry #384
Conversation
[ Edited to consolidate comments] This looks promising. I think there are still hangovers of the previous packaging setup that need to be migrated before this is ready for merging. Project metadata As I understand, python poetry is a replacement for setuptools. To avoid being in a messy state with duplication, I think if we switch to Poetry we should also remove the previous setup and use poetry to build the project. This would mean moving the package metadata from Versioning I think we need a clear plan for versioning. Python Poetry manages the version using pyproject.toml, which is inconsistent with the current setup using setuptools-scm. If we use Poetry, we need to ensure it correctly picks up the version number from version control. This could be one Poetry-compatible way of ensuring we still have PEP-440 compliant version strings that are single-sourced from version control: https://pypi.org/project/poetry-dynamic-versioning/ Deployment If we switch to using Poetry, we need to ensure that the deploy scripts used internally in bp to our scientific computing environments work correctly. At present, there are setuptools-specific build steps that this will break. Outstanding concerns
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per comments above, I think there are still setuptools remnants and the migration to poetry is not complete.
.github/workflows/ci-publish.yml
Outdated
pip install poetry | ||
pip install poetry-dynamic-versioning | ||
poetry build | ||
# pip install resqpy[tests] --find-links=dist/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this "test" step should be unchanged - as the previous step builds a python wheel, we should be able to install that wheel in the usual way with pip in this step.
.github/workflows/ci-publish.yml
Outdated
- name: Install from build | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install resqpy[tests] --find-links=dist/ | ||
pip install poetry-dynamic-versioning | ||
poetry install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use the existing pip install resqpy --find-links=dist/
here, to ensure we are running the tests against the built python wheel?
This step was originally intended to ensure that the python wheel functions correctly and can be pip-installed by end users.
FYI, I've made a PR on the "Install Poetry" GitHub Action to allow it to install plugins as well. However, would recommend waiting until Poetry 1.2 is officially released before using this. |
# Conflicts: # resqpy/grid/grid.py
…_environments_setup
…into fix_environments_setup
…into fix_environments_setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for addressing all of my comments. @andy-beer , FYI this changes the release pipeline significantly so would be good to ensure the release process still works after this is merged.
Closes #379