Skip to content

Commit

Permalink
Merge pull request #130 from anaconda/0.2.0
Browse files Browse the repository at this point in the history
0.2.0
  • Loading branch information
cbouss authored Nov 20, 2024
2 parents ce9399d + 00d877f commit 36d7447
Show file tree
Hide file tree
Showing 35 changed files with 439 additions and 4,850 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog
Note: version releases in the 0.x.y range may introduce breaking changes.

## 0.2.0
- Add command percy recipe sync
- Download cbc when none is found.
- Remove previous parser tree code and depend on conda-recipe-manager instead - use renderer CRM.
- Remove `get_read_only_parser()` function.
- Remove convert command.
- Add proper support for CDT packages.

## 0.1.7
- Revert exclusion of `clang-compiler-activation-feedstock` from locally loaded feedstocks since it's actually active and needed.

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ install: clean ## install the package to the active Python's site-packages
pip install .

environment: ## handles environment creation
conda env create -f environment.yaml --name $(CONDA_ENV_NAME) --force
conda env create -f environment.yaml --name $(CONDA_ENV_NAME) --yes
conda run --name $(CONDA_ENV_NAME) pip install .

dev: clean ## install the package's development version to a fresh environment
conda env create -f environment.yaml --name $(CONDA_ENV_NAME) --force
conda env create -f environment.yaml --name $(CONDA_ENV_NAME) --yes
conda run --name $(CONDA_ENV_NAME) pip install -e .
$(CONDA_ACTIVATE) $(CONDA_ENV_NAME) && pre-commit install

Expand All @@ -100,7 +100,7 @@ test-debug: ## runs test cases with debugging info enabled
$(PYTHON3) -m pytest -n auto -vv --capture=no percy/tests/

test-cov: ## checks test coverage requirements
$(PYTHON3) -m pytest -n auto --cov-config=.coveragerc --cov=percy percy/tests/ --cov-fail-under=45 --cov-report term-missing
$(PYTHON3) -m pytest -n auto --cov-config=.coveragerc --cov=percy percy/tests/ --cov-fail-under=20 --cov-report term-missing

lint: ## runs the linter against the project
pylint --rcfile=.pylintrc percy
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ From within a feedstock:
percy recipe render --help
percy recipe render -s linux-64 -p 3.10 -k blas_impl openblas

- Update the recipe

percy recipe sync

- Identify if the feedstock is pinned to the latest, compared to defautls:

percy recipe outdated --help
Expand Down
2 changes: 2 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ dependencies:
- requests
- types-requests
- ruamel.yaml
- ruamel.yaml.jinja2
- conda-build
- jsonschema
- types-jsonschema
- pre-commit
- conda-recipe-manager
3 changes: 2 additions & 1 deletion percy/commands/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
File: aggregate.py
Description: CLI tool for performing operations against all of aggregate.
"""

from __future__ import annotations

import functools
Expand Down Expand Up @@ -111,7 +112,7 @@ def base_options(f: Callable):
"-p",
type=str,
multiple=False,
default="3.10",
default="3.12",
help="Python version. E.g. -p 3.10",
)
@click.option(
Expand Down
106 changes: 0 additions & 106 deletions percy/commands/convert.py

This file was deleted.

3 changes: 1 addition & 2 deletions percy/commands/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
File: main.py
Description: Primary execution point of the `click` command line interface
"""

from __future__ import annotations

import os

import click

from percy.commands.aggregate import aggregate
from percy.commands.convert import convert
from percy.commands.recipe import recipe


Expand All @@ -22,7 +22,6 @@ def cli() -> None:
# add subcommands
cli.add_command(recipe)
cli.add_command(aggregate)
cli.add_command(convert)


@cli.command()
Expand Down
61 changes: 50 additions & 11 deletions percy/commands/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
File: recipe.py
Description: CLI for interacting with recipe files.
"""

from __future__ import annotations

import functools
Expand All @@ -16,6 +17,7 @@
import percy.render.dumper
import percy.render.recipe
from percy.render._renderer import RendererType
from percy.updater import grayskull_sync

# pylint: disable=line-too-long

Expand Down Expand Up @@ -63,30 +65,23 @@ def base_options(f: Callable):
"-s",
type=str,
multiple=True,
default=[
"linux-64",
"linux-aarch64",
"linux-ppc64le",
"linux-s390x",
"osx-arm64",
"osx-64",
"win-64",
],
default=None,
help="Architecture. E.g. -s linux-64 -s win-64",
)
@click.option(
"--python",
"-p",
type=str,
multiple=True,
default=None,
help="Python version. E.g. -p 3.9 -p 3.10",
)
@click.option(
"--others",
"-k",
type=(str, str),
multiple=True,
default={},
default=None,
help="Additional key values (e.g. -k blas_impl openblas)",
)
@functools.wraps(f)
Expand Down Expand Up @@ -222,7 +217,7 @@ def patch(
recipe: percy.render.recipe.Recipe # pylint: disable=redefined-outer-name
# Enables parse-tree mode
if parse_tree:
backend = RendererType.PERCY
backend = RendererType.CRM
op_mode = percy.render.recipe.OpMode.PARSE_TREE
recipe = percy.render.recipe.Recipe.from_file(
recipe_path,
Expand All @@ -244,3 +239,47 @@ def patch(
with open(patch_file, encoding="utf-8") as p:
recipe.patch(json.load(p), increment_build_number, op_mode=op_mode)
print("Done")


@recipe.command(short_help="Sync a recipe from pypi data")
@click.pass_obj
@click.option(
"--run_constrained",
type=bool,
is_flag=True,
show_default=True,
default=True,
multiple=False,
help="add run_constrained",
)
@click.option(
"--bump",
type=bool,
is_flag=True,
show_default=True,
default=True,
multiple=False,
help="bump build number if version is unchanged",
)
@click.option(
"--run_linter",
type=bool,
is_flag=True,
show_default=True,
default=True,
multiple=False,
help="run conda lint --fix after updating",
)
@click.option(
"--pypi_spec",
type=str,
multiple=False,
help="pypi_package spec",
)
def sync(obj, pypi_spec, run_constrained, bump, run_linter):
"""
Sync a recipe from pypi data
"""

recipe_path = obj["recipe_path"]
grayskull_sync.sync(recipe_path, pypi_spec, run_constrained, bump, run_linter)
2 changes: 1 addition & 1 deletion percy/examples/preinstall/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_DEFAULT_AGGREGATE = "~/work/recipes/aggregate/"
_DEFAULT_PYTHON = ["3.8", "3.9", "3.10", "3.11"]
_DEFAULT_PYTHON = ["3.9", "3.10", "3.11", "3.12", "3.13"]
_DEFAULT_SUBDIRS = [
"linux-64",
"linux-ppc64le",
Expand Down
1 change: 0 additions & 1 deletion percy/parser/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# This package contains supporting files for the `RecipeParser` class
Loading

0 comments on commit 36d7447

Please sign in to comment.