Keep the dependency specs consistent with the conda recipe - #747
Merged
Conversation
We were missing constraints on numpy and scikit-image that are in dev-spec.txt and recipe.yaml
The run requirements in recipe/recipe.yaml are the source of truth but several of them had drifted in the other dependency specs: * pyproject.toml was missing h5py, which is imported by mpas_tools.viz.mpas_to_xdmf.io and is available on PyPI * pyproject.toml, dev-spec.txt and pixi.toml were all missing the >=0.10.0 constraint on (python-)igraph * dev-spec.txt still had geometric_features >=1.0.1 rather than >=1.6.3 Also add pyyaml as a development dependency, needed to parse the conda recipe in the test added in the following commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Treat the run requirements in recipe/recipe.yaml as the source of truth and check that each of them shows up with the same version constraints in pyproject.toml (for those available on PyPI), dev-spec.txt and pixi.toml. The latter two are still allowed to list extra packages for development, testing and building the documentation, but pyproject.toml is also checked in the reverse direction so that it cannot drift ahead of the recipe. Version constraints are compared as unordered sets of clauses so that ordering and spacing do not matter, and a small table maps the few conda-forge names that differ from their PyPI equivalents. The tests skip when the spec files are absent, as is the case when the test suite runs during a conda build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dev-spec.txt and pixi.toml still asked for python >=3.10 while "requires-python" in pyproject.toml is >=3.11. Also check python in the dependency consistency tests. Since the conda recipe deliberately leaves python unconstrained, letting conda pin it to the version being built, "requires-python" from pyproject.toml is used as the source of truth for python rather than recipe/recipe.yaml. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This matches "requires-python" in pyproject.toml and the skip line in the conda-forge feedstock. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mpas_toolsdescribes its dependencies in four places —recipe/recipe.yaml,pyproject.toml,dev-spec.txtandpixi.toml— and they had quietly drifted apart. This PR fixes the discrepancies and adds a test so they cannot drift again.Fixes
recipe/recipe.yamlis treated as the source of truth for the run requirements:pyproject.tomlwas missing the>=2.0,<3.0constraint onnumpyand the!=0.20.0constraint onscikit-imagepyproject.tomlwas missingh5pyentirely, even though it is imported bympas_tools.viz.mpas_to_xdmf.ioand is available on PyPIpyproject.toml,dev-spec.txtandpixi.tomlwere all missing the>=0.10.0constraint on(python-)igraphdev-spec.txtstill asked forgeometric_features >=1.0.1rather than>=1.6.3dev-spec.txtandpixi.tomlstill asked for python>=3.10whilerequires-pythoninpyproject.tomlis>=3.11recipe/recipe.yamlnow skips building for python<3.11, matchingrequires-pythonand the conda-forge feedstockNew test
conda_package/tests/test_dependencies.pychecks that every run requirement of the conda recipe appears with the same version constraints in the other three files.dev-spec.txtandpixi.tomlmay still list extra packages for development, testing and building the documentation, butpyproject.tomlis also checked in the reverse direction so that it cannot list a package the recipe is missing.A few details worth noting:
matplotlib-base→matplotlib,python-igraph→igraph).geometric_featuresandncoare not on PyPI, so they are skipped forpyproject.tomlonly.requires-pythonfrompyproject.tomlrather than the recipe, since the recipe deliberately leavespythonunconstrained and lets conda pin it to the version being built. A constraint in the recipe is still checked if one is ever added.The test imports
yaml, sopyyamlwas added as a development dependency rather than relying on it arriving transitively viapre-commit.