anaconda / percy

A tool to work on recipes from aggregate.
BSD 3-Clause "New" or "Revised" License
9 stars 0 forks source link

Percy

Table of Contents

Overview

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.

NOTE: The parser/ module has moved and will be eventually deprecated from this project. The module now resides in this repo as we propose to move this work to conda-incubator.

Getting Started

General Installation

Install into your current environment

make install

Install into a custom percy environment

make environment
conda activate percy

Developer Notes

make dev
conda activate percy

The 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.

Running pre-commit checks

The provided Makefile also provides a handful of convenience recipes for running all or part of the pre-commit automations:

  1. make test: Runs all the unit tests
  2. make test-cov: Reports the current test coverage percentage and indicates which lines are currently untested.
  3. make lint: Runs our pylint configuration, based on Google's Python standards.
  4. make format: Automatically formats code
  5. make analyze: Runs the static analyzer, mypy.
  6. make pre-commit: Runs all the pre-commit checks

Command line examples

From within a feedstock:

percy recipe --help

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

Release process

Here is a rough outline of how to conduct a release of this project:

  1. Update CHANGELOG.md
  2. Update the version number in pyproject.toml
  3. Ensure environment.yaml is up to date with the latest dependencies
  4. Create a new release on GitHub with a version tag.
  5. The Anaconda packaging team will need to update the feedstock and aggregate and publish to distro-tooling

Other examples

Recipe patching

See percy/examples/patch

Python 3.11 buildout

See percy/examples/py311 here

Build order examples

See percy/examples/blts

Test install examples

pytest -n auto --junit-xml="test_install.xml" --html="test_install.html" --self-contained-html ./percy/examples/preinstall/test_install.py --feedstock=./gensim-feedstock

Find pinning issues in aggregate

python ./percy/examples/aggregate_deps_issue_finder/aggregate_deps_issue_finder.py