This library is able to render recipes for all variants (subdir, python... combination). When given a directory of feedstocks (aggregate), it can produce a rough build order. It can be used as a command line tool but is mostly intended to be used as a library.
Why not using conda build to render? conda build resolves dependencies to qualify versions and process run_exports and other keys. This library renders without querying a channel, and is more suited for development phase.
Percy is used by:
- https://github.com/anaconda/anaconda-linter as a recipe processor.
- https://github.com/anaconda/perseverance-python-buildout as a build order generator.
- https://github.com/anaconda/pr-inspector as a recipe processor.
NOTE: The parser/ module has moved and will be eventually deprecated from this project.
The module now resides in conda-incubator.
conda install https://pkgs.as.anacondaconnect.com/api/repo/anaconda-distro::percy -yor
conda install -c https://pkgs.as.anacondaconnect.com/api/repo/anaconda-distro percy -ymake installmake environment
conda activate percymake dev
conda activate percyThe dev recipe will configure a conda environment named percy with
development tools installed.
pre-commit is automatically installed and configured for you to run a number
of automated checks on each commit.
NOTE: As of writing, only a handful of files are checked by the linter and
pre-commit. ANY NEW FILES should be added to these checks.
The provided Makefile also provides a handful of convenience recipes for
running all or part of the pre-commit automations:
make test: Runs all the unit testsmake test-cov: Reports the current test coverage percentage and indicates which lines are currently untested.make lint: Runs ourpylintconfiguration, based on Google's Python standards.make format: Automatically formats codemake analyze: Runs the static analyzer,mypy.make pre-commit: Runs all thepre-commitchecks
From within a feedstock:
percy recipe --help
-
Render the recipe
percy recipe render --help percy recipe render -s linux-64 -p 3.10 -k blas_impl openblas -
Update the recipe - prefer recipe-bumper-cli instead:
percy recipe sync -
Identify if the feedstock is pinned to the latest, compared to defautls:
percy recipe outdated --help percy recipe outdated
From within aggregate:
Queries can be performed on feedstock names (-f), package names (-pkg) and group names (-g). A group name corresponds to the github/gitlab... organization name, extracted from dev_url.
percy aggregate --help
-
When updating a package pinned in cbc, show rebuild order:
percy aggregate downstream --help percy aggregate downstream -f libxml2-feedstock -
When working on a group of packages, show build order:
percy aggregate order --help percy aggregate order -f dask-feedstock -f dask-core-feedstock -f distributed-feedstock percy aggregate order -g dask -
When building from scratch, show what to build based on leaf packages:
percy aggregate upstream --help percy aggregate upstream -f pytorch-feedstock -
Identify which feedstocks are not pinned to the latest, compared to defautls:
percy aggregate outdated --help percy aggregate outdated
Here is a rough outline of how to conduct a release of this project:
- Update
CHANGELOG.md - Update the version number in
pyproject.tomlandconda-recipe/meta.yaml - Ensure
environment.yamlis up to date with the latest dependencies
When you are ready to release, create a tag named cli-<version> where <version> correspond
to the version you want to release. For example, git tag -a cli-0.1.0 -m cli-0.1.0. Then push
the tag.
Pushing the tag will automatically trigger a build and a release to https://pkgs.as.anacondaconnect.com/api/repo/anaconda-distro.
Watch the process at https://github.com/anaconda/percy/actions/workflows/publish.yaml?query=event%3Apush+branch%3Amain.
See percy/examples/patch
See percy/examples/blts
pytest -n auto --junit-xml="test_install.xml" --html="test_install.html" --self-contained-html ./percy/examples/preinstall/test_install.py --feedstock=./gensim-feedstock
python ./percy/examples/aggregate_deps_issue_finder/aggregate_deps_issue_finder.py