Proposal: updated dependency handling#117
Conversation
romanc
left a comment
There was a problem hiding this comment.
some inline comments
| @@ -1,3 +1,3 @@ | |||
| [tool.black] | |||
| line-length = 88 | |||
| target_version = ['py36', 'py37', 'py38'] | |||
There was a problem hiding this comment.
versions below 3.8 aren't supported anymore. I tried adding newer versions of python and this failed, which is probably due to the outdated version configured in .pre-commit-config.yaml.
I propose to update black in a subsequent PR and revisit this since updating black sometimes brings changes in default formatting, which would convolute this PR.
| author="Allen Institute for AI", | ||
| author_email="oliver.elbert@noaa.gov", | ||
| python_requires=">=3.8", | ||
| python_requires=">=3.8,<3.12", |
There was a problem hiding this comment.
It's not usually common to have an upper limit. Nevertheless, we know from NDSL that python 3.12 will break things, so let's be cautious.
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", |
There was a problem hiding this comment.
just added missing supported versions.
|
Removed the editable installs of Let's be sure to merge this as "squash merge" because the individual commits aren't meaningful. |
fmalatino
left a comment
There was a problem hiding this comment.
Aside from the local references to packages in the constraints files this is good to go. Thanks again so much for taking this on.
constraints-test.txt
Outdated
| # via matplotlib | ||
| cytoolz==1.0.1 | ||
| # via gt4py | ||
| dace @ file:///home/romanc/code/pace/NDSL/external/dace |
There was a problem hiding this comment.
These types of constraints need to be removed after every update to the constraint files.
|
Can we do away with the |
I am good with this, would this then require that a PR be made in pace to update the version of an incoming package alongside one in a submodule that changes it? |
fmalatino
left a comment
There was a problem hiding this comment.
Approved pending the change to moving away from constraints files, and keeping versions of dependencies within setup.py. Thanks again for all of this.
I will remove the constraints files again and push another version. |
|
Alright, I pushed "one last" (haha) update to the Also, there are probably some commands in the Lastly, I can also not give any guarantees for the |
Let me try to answer this. Are you asking what happens if a dependency, say PyFV3, updates one of its dependencies that is in pace's list of dependencies? In the above case, pip will try to find a version that fots both requirements. Pace's requirements are now pretty loose (except for important things like numpy < 2 and zarr < 3). So chances of resolution are high. And in case of resolution, no action is needed on the pace side. In case there's a conflict, pip will fail, which makes the workflow fail, which lets downstream repos know (in case they have the hook installed). And we will also know when attempting to update one of pace's submodule, because - again - pipeline failures. We could setup a daily/weekly CI to run with the latest available dependencies to catch things like zarr moving to version 3 in an automated manner. |
|
I was more referencing the fact that if you don't freeze all packages pull (dependencies of dependencies of dependencies...) then when you release a software their is no way to make sure you grab exactly those second hand dependencies later when you re-install |
Description
Recent CI failures exposed a couple of inconsistencies in how pace is handling dependencies. This PR proposes a bit of a cleanup that is a compromise between keeping the current developer workflow while "moving in the right direction" of more modern dependency handling. Eventually, we'll need to move away from
setup.pytowards the emergingpyproject.tomlstandard.The idea of this PR is to keep the dev setup a simple default with local
NDSL,pyFV3, andpySHiELDinstalls. While the dev setup installs an editable version ofpace(but none of the submodules anymore), the CI andbuild_scripts/don't have any editable installs anymore. We refrain from automatically updatingpip(and setuptools/wheels) to having to deal withpip> 25, which enforces PEP600.Bigger changes include:
test(installs "mpi4py", "nbmake", and "pytest") anddev(installs local but non-editable versions ofNDSL,pyFV3,pySHiELDwith a local version ofpaceand linting tools)constraints.txtto current versions.requirements_lint.txtandrequirements_dev.txt(they are now an extra insetup.py)Minor changes include:
README.mdaccordinglygenerate_eta_files.pyThe docs requirements are still a bit out there and imo don't really make senses. I was unsure what to do with them. I think they should be separate from tests and the development environment. They should probably end up in their own extra such that a docs workflow could
pip install .[prod,docs]. Since there is no docs workflow, I didn't bother too much.Note that this also doesn't run tests with multiple python version. It would be relatively straight forward to run for example unit tests in all supported (3.8 - 3.11) versions.
How Has This Been Tested?
Local testing with two virtual environments; one for the developer workflow and one for the test workflow.
Checklist: