-
Notifications
You must be signed in to change notification settings - Fork 96
packaging: check pip/conda compatibility #7013
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
Conversation
That did the trick, the conda builds failed with this error:
Reflecting the incompatibility between the Conda and pip metadata. This will help in detecting cases where pip deps have been updated, but conda deps haven't, but won't catch all cases. |
Note, the test will fail until the dependency is fixed! Could also fix the dep on this PR, but would like reviewers to see the failure first. |
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.
Nice, makes sense to me to fix the dependency in this PR
Co-authored-by: Ronnie Dutta <[email protected]>
- name: check cylc installation | ||
shell: bash -el {0} | ||
run: | | ||
# make sure Cylc is functioning |
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.
One thing I noticed when testing locally is that conda seems pretty keen on installing Python 3.12 even when the current is 3.14. Can we check that 3.14 is not being overridden?
# make sure Cylc is functioning | |
conda run -n test python --version | |
# make sure Cylc is functioning |
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.
That would just be testing the conda-incubator/setup-miniconda@v3
action?
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'm concerned the python-version
we specify is not working (e.g. for 3
it looks like we might be getting 3.12
: https://github.com/cylc/cylc-flow/actions/runs/18500486273/job/52715670153?pr=7013#step:4:1438
Possibly this issue: conda-incubator/setup-miniconda#114
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.
Right.
We could hard pin the python version at the Conda level (i.e add python = <version>
into the conda environment file) which should be as safe as the Conda environment itself (if that dependency brokering is broken, all bets are off).
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.
Implemented the above suggestion in c91c402
Unfold the last section in the "build Conda env" step to reveal the version installed.
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 we want to force our actions (including this one) to run with the latest Python, we'll have to explicitly state it.
But that's a right maintenance pain as we'll have to keep updating it :(
- Using an action to extract the version is possible, but ugly, but at least automated.
- Configuring it in a file is still a maintenance pain, but at least a centralised one.
- Setting it as a repository secret/variable is a maintenance pain and non-obvious, but at least centralised.
Orthogonal to this new check either way, but probs something we should look into soon to help spot leading edge issues sooner as current tests ain't gonna do that.
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.
Ah right, I was thinking of actions/setup-python
which does this effortlessly. I guess updating the latest one once a year isn't too bad... But at present there is no point having a separate 3.12
and 3
in the matrix
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.
With setup-python, 3.x
always picks the latest Python version for the operating system, not necessarily the latest Python.
With Conda, 3
always picks the latest Python compatible with the preferable solve of the environment, not necessarily the latest Python.
Neither is perfect, but setup-python is more likely to give the preferred answer more of the time.
Specifying 3
isn't "pointless", once the dependency issue that this PR is identifying has been resolved, it will pick up 3.14 as intended.
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.
Ohhh it was choosing 3.12 because of the old protobuf pin, got it.
Still, it is useful to have a conda run -n test python --version
or better yet conda list -n test
step for debugging purposes
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.
Yep. It isn't ideal that this can happen, am mulling possible workarounds for future...
You've seen the test fail as intended, so I've pushed the dependency fix in bfda2ee (cancelling the other checks) |
Et voila, tests pass and the Python is 3.14 |
An attempt to ensure that the
conda-environment.yml
file is kept in sync with the pip config file(s).For context, see conda-forge/cylc-flow-feedstock#116 (comment)
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).?.?.x
branch.