Skip to content
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

Avoid duplicate keys in recipe YAML #235

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

jdblischak
Copy link
Member

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

This update is purely to make it easier to perform our nightly feedstock builds in conda-forge-nightly-controller. In the script update-recipe.py, we edit the recipe, but this only keeps the first instance of a key, discarding any duplicates. Thus avoiding duplicate keys will ensure our nightly feedstock builds are accurately testing the actual recipe. Discovered in TileDB-Inc/conda-forge-nightly-controller#123

Removing both instances of skip is an easy decision. Support for win32 was dropped from conda-forge in 2018 (conda-forge/staged-recipes#5640), and support for Python 2 was dropped in 2020 (conda-forge/conda-forge-pinning-feedstock#491).

While using the script key directly in the recipe YAML is convenient (recently introduced in #232), these duplicate keys with jinja2 preprocessing selectors are difficult to programmatically edit (TileDB-Inc/conda-forge-nightly-controller#114, TileDB-Inc/conda-forge-nightly-controller#122). Since using separate build scripts is functionally equivalent, I reverted to this strategy.

This change does not affect the binary itself, so I didn't bump the build number.

@conda-forge-webservices
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

Copy link

@dudoslav dudoslav left a 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, but we could unite both script calls under one like this:

{{ PYTHON }} -m pip install --no-build-isolation --no-deps --ignore-installed -v -C skbuild.cmake.define.TILEDB_PATH={{ PREFIX }} .

if {{ PREFIX }} can be used. But looks good to me anyway.

@jdblischak
Copy link
Member Author

we could unite both script calls

@dudoslav I like this idea in theory. From a maintenance and readability perspective, it is very clean.

if {{ PREFIX }} can be used

PREFIX is one of the available environment variables, so it could definitely be used like this.

The main problem is that on Windows, the software is not installed directly in PREFIX but in LIBRARY_PREFIX, which is %PREFIX%\Library. I can't think of a way around this that wouldn't involve some sort of jinja2 preprocessing selector or some other jinja2 magic.

For example, we could set a variable based on the operating system:

{% set lib = '\Library' if win else '' %}

And then use it in script:

{{ PYTHON }} -m pip install --no-build-isolation --no-deps --ignore-installed -v -C skbuild.cmake.define.TILEDB_PATH={{ PREFIX }}{{ lib }} .

But that extra complexity would reduce the readability. And trying to deal with jinja2 variables when parsing the recipe YAML is also a pain (currently the nightly discards all of them and just hard-codes the new version).

@jdblischak jdblischak merged commit 17406dd into conda-forge:main Aug 13, 2024
27 checks passed
@jdblischak jdblischak deleted the remove-duplicate-fields branch August 13, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants