-
-
Notifications
You must be signed in to change notification settings - Fork 279
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 noarch: python
to CFEP-25's new syntax
#2351
Comments
Using minimum python_requires defined at https://github.com/Lightning-AI/litdata/blob/v0.2.30/setup.py#L70. See details of CFEP-25 at conda-forge/conda-forge.github.io#2351 and https://conda-forge.org/docs/maintainer/knowledge_base/#noarch-python
* updated v0.2.30 * MNT: Re-rendered with conda-build 24.9.0, conda-smithy 3.44.0, and conda-forge-pinning 2024.11.05.21.36.17 * Rename pypi.io to pypi.org * Set python_min following CFEP-25 Using minimum python_requires defined at https://github.com/Lightning-AI/litdata/blob/v0.2.30/setup.py#L70. See details of CFEP-25 at conda-forge/conda-forge.github.io#2351 and https://conda-forge.org/docs/maintainer/knowledge_base/#noarch-python --------- Co-authored-by: Wei Ji <[email protected]>
I understand the rationale about testing against the minimum supported python version but I'm afraid to miss issues with new python version. I have an example recently where the build of taurus-feedstock failed with python 3.13. Issue was linked to a dependency, pint, not supporting 3.13. I had to patch the repodata. Best would be to test against oldest and newest python version, but I don't think that's possible right now. Is the testing on minimum supported versions a recommendation? Will it be up to the maintainer? |
The cfep allows overrides of any of these things. So yes, feel free. There are new defaults, not rules that have to be followed. |
Worth nothing that for v1 recipes, you'll be able to test both the lowest and the highest supported python version, because the |
The linter fails to substitute host:
- python {{ python_min }}
run:
- python >={{ python_min }}
test:
requires:
- python {{ python_min }} For example the linting complains the following in PR with
Full log here: |
This is a conda-build error, not a linter error. It appears you need to rerender the feedstock. |
Thanks so much @beckermr for all your work on this, it's a huge improvement!!! I'm running up against a few hard edges though, and I thought it may be useful to share:
|
I made a few PRs to help with this. Comments welcome! |
Sorry I'm a bit late to this discussion. I have a concern about:
I think it's a really nice feature of the feedstocks that routine updates for new releases can all be accomplished purely within My concern is that in order to automate these updates, e.g. using Grayskull, now What would you think of endorsing a strategy of setting |
For grayskull updates, I think it simply injects the minimum by hand anyways, so this is a non-issue? |
Also note that the hint literally says "or change the build configuration as needed to match the constraints of their specific package." |
What I take away as the biggest innovations from CFEP-25 are:
Grayskull does inject information from My point is simply that there's potential for confusion if the knowledge base says to update |
Ah I see what you mean. Does the jinja2 override actually work? We have python_min in the global pinnings too and I am unsure which item takes precedence when jinja2 evaluates the templates. |
My general feeling is that carrying important state in jinja2 is not a best practice, but I do see the advantage of not having conda_build_config,yaml files around for |
Ya. I'm not so experienced with Jinja2, and I'm no big fan of it either, but this example (same that I linked above) demonstrates a successful Jinja2 override, where without the
Yes, agreed. I haven't looked into it, but I wonder if rattler offers a better way? Even if so, we probably need to stick to such basic methods for now. EDIT: To answer my own question about rattler, the answer is affirmative; they introduce a "context variables" mechanism (source):
|
ok I am happy to change the docs and linter to suggest context and/or jinja2. We need to ensure that rattler and conda-build have the same precedence order with respect to variants versus context items. |
I tested rattler-build overrides and they work fine. I did however find an odd feature where rattler build treats recipe pins like requirements:
run:
- python 3.10 as exact equality (eg renders to a spec that is I opened an issue here: prefix-dev/rattler-build#1174 |
Indeed. I think that having Thank you @beckermr for also adding PR #2365 as I agree with @maresb that it is very nice if all the metadata for the feedstock can exist just in The linter also only mentions the use of
but it also allows for supporting patch releases of packages where the last minor release still supported a Python version that has been dropped from the supported global pinning. I can understand maybe not wanting to super advertise that old Pythons can still be used for builds in an effort to get people moving towards supporting more modern Pythons overall, but I personally find that to be pretty useful information. |
Ah darn. I know what the bug is. Will fix it. |
Per CFEP-25,
noarch: python
packages should have the syntaxThis issue has TODO items for the migration:
noarch: python
minimum version syntax to equivalent but more compatible cfep#58, fix: use syntax fornoarch: python
min version that does not break conda-build conda-smithy#2122, fix: updatenoarch: python
syntax to use more compatible form #2360)python_min
variable to pinnings (feat: addpython_min
variable per CFEP-25 conda-forge-pinning-feedstock#6646)adjust admin command to use new syntax(The admin command only adds the parts in build, so I think we should leave it as is. The linter will warn folks and they will have to adjust it by hand.)noarch: python
hint, add override note, and fix a bug for v1 conda-smithy#2126, doc: add more notes for noarch: python #2363, feat: suggest using jinja2/context vars instead of variants for python_min overrides #2365)python_min
(fix: ensure we use CBC to parse recipe names for conda-forge conda-smithy#2135, fix: need pinnings for register ci too conda-smithy#2144)CondaBuildUserError
w/SystemExit
conda/conda-build#5538)The text was updated successfully, but these errors were encountered: