-
Notifications
You must be signed in to change notification settings - Fork 120
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
Migrate to poetry for inspection #827
Migrate to poetry for inspection #827
Conversation
Some notes about
|
At the moment, I did not migrate the legacy-pytest workflow to poetry since I'm not sure what the best way is to install these specific versions. We could define them for the oldest supported python version and then run the legacy-pytest workflow on precisely that python version as suggested here. |
When installing ixmp4 into my pyam-dev-environmemt, I was able to simply do |
Also, the nightly tests should not use the poetry-lock packages but should install the latest available versions of all packages. This test is helpful as a warning when e.g pandas releases a new version that is incompatible with the existing codebase. So this tests replicates the behavior when a user installs pyam from pypi with the latest available dependencies. |
The nightly tests now update the dependencies before installing them, this should be the desired behaviour, if I understand correctly. Also, I similarly think you can run |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #827 +/- ##
=======================================
+ Coverage 95.0% 95.1% +0.1%
=======================================
Files 64 63 -1
Lines 6134 6130 -4
=======================================
+ Hits 5828 5831 +3
+ Misses 306 299 -7 ☔ View full report in Codecov by Sentry. |
db5b0e9
to
5c7db7b
Compare
@danielhuppmann @phackstock All tests are passing now, so please review if you like this setup. Please also consider the following notes: Caching on Windows runnersFor the Activating poetry's venv in a CI workflowTo avoid having to specify different paths to activation scripts on different runners in the CI, the Default version constraints for poetryOne of poetry's main downsides is that it doesn't support PEP 621 yet, which (among other things) appears in the default form that dependency requirements take: (pyam-iamc-py3.12) fridolin@fridolin-Latitude-5520 ~/pyam (migrate/to-poetry)> (.venv) poetry add black --group dev
Using version ^24.2.0 for black By default, poetry will try to use the latest version and add a caret specification to it, which allows limited updates. In particular, caret requirements will prevent poetry from picking up new major version releases. If you decide to merge this PR, we should of course still adapt the install instruction docs as well as the release notes. |
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.
Looks good to me overall. One thing to make sure before merging is that pyam.__version__
still works correctly.
A few minor comments in line below.
Okay, let me write up what I've learned about caching for GitHub Actions now :) This got me thinking: before 65a82af, we restored the cache in the pytest-legacy workflow from the |
This comment was marked as outdated.
This comment was marked as outdated.
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 installed this (using pip install -e .
) in a clean conda environment and it worked as expected (including dynamically changing the version when checking out a different commit).
A few minor issues inline.
Were you able to install the optional groups as well? |
You are right, this is ignored. Given that we only have a handful of packages per group, I think the extras-approach would still be clear enough, right? |
I'll convert the optional groups to extras, then. |
Thank you! |
No problem!
|
Just noticing myself: |
The tests for python 3.12 will fail again for this reason: pandas-datareader is still using |
Looks good, Th pandas-datareader is used to access the World Bank data sources, but it could probably be replaced by https://pypi.org/project/wbdata/. Simply remove the test and the installation in the GitHub Actions and start an issue so that I don't forget to migrate to the new package (or a good alternative). |
A small correction first: |
8c2cbfd
to
c7821de
Compare
Please note: my mypy is not happy with the recent changes to Line 38 in ddbb88e
It claims that logging has no attribute configure_logging .
|
Just remove the worldbank-feature entirely from the tests for now, and start an issue as a reminder to re-insert later. |
But |
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.
Thank you, looks great!
Closes #823 and #831.
Please confirm that this PR has done the following:
Description of PR
This PR migrates the contents of
ruff.toml
,setup.cfg
andsetup.py
topyproject.toml
to use poetry for package management. Please check that no information was lost and everything still works as usual.