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

0.2.0 #130

Merged
merged 9 commits into from
Nov 20, 2024
Merged

0.2.0 #130

merged 9 commits into from
Nov 20, 2024

Conversation

cbouss
Copy link
Collaborator

@cbouss cbouss commented Nov 19, 2024

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

@@ -2,6 +2,7 @@
File: convert.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should just delete this file, in favor of the one in CRM.

@skupr-anaconda
Copy link
Contributor

skupr-anaconda commented Nov 20, 2024

If I run percy recipe sync from aggregate/click-feedstock/recipe or aggregate/click-feedstock I get this error:

grayskull pypi --extras-require-all -o /var/folders/34/jpnxzfyj7v98l36m55zzjklr0000gq/T/tmpl3bgswnh click
Traceback (most recent call last):
  File "/Users/skupr/miniconda3/envs/percy/bin/percy", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/click/decorators.py", line 45, in new_func
    return f(get_current_context().obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/percy/commands/recipe.py", line 285, in sync
    grayskull_sync.sync(recipe_path, pypi_spec, run_constrained, bump, run_linter)
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/percy/updater/grayskull_sync.py", line 111, in sync
    gs_raw_recipe, gs_rendered_recipe, sections = gen_grayskull_recipe(gs_file_path, package_spec, with_run_constrained)
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/site-packages/percy/updater/grayskull_sync.py", line 38, in gen_grayskull_recipe
    subprocess.run(
  File "/Users/skupr/miniconda3/envs/percy/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'grayskull pypi --extras-require-all -o /var/folders/34/jpnxzfyj7v98l36m55zzjklr0000gq/T/tmpl3bgswnh click' returned non-zero exit status 127.

yaml_jinja.indent(mapping=2, sequence=4, offset=2)
yaml_jinja.preserve_quotes = True
yaml_jinja.allow_duplicate_keys = True
yaml_jinja.width = 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
yaml_jinja.width = 1000
yaml_jinja.width = 2048

I would recommend 2048 because I had issues with some recipes where source urls where too long.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check if these attributes are also useful?

    yaml.sort_keys = True
    yaml.explicit_start = False

When I experimented with updating recipes, I found that they are required for some cases, but, honestly, I forgot the reason

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed the width. I do not want to sort the keys. explicit_start true adds the whole content as a list item

@@ -174,20 +184,19 @@ def read_conda_build_config(
recipe_dir = recipe_path.parent
variants = []

if subdir is None:
if subdir is None or len(subdir) == 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't be better if not subdir?

@skupr-anaconda
Copy link
Contributor

FYI, if conda env create doesn't have the flag --force since conda 24.3.x, see https://docs.conda.io/projects/conda/en/latest/commands/env/create.html. That means the command make environment fails for percy's newcomers.

@schuylermartin45
Copy link
Collaborator

FYI, if conda env create doesn't have the flag --force since conda 24.3.x, see https://docs.conda.io/projects/conda/en/latest/commands/env/create.html. That means the command make environment fails for percy's newcomers.

Changing the flag to --yes is the fix. I've had to do this in a bunch of repos.

@@ -0,0 +1,174 @@
"""
Provides a sync method which can be used to sync an existing recipe with content form grayskull.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to mention perseverance-scripts diff-deps here so both tools are known?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a disclaimer in the source.

Copy link
Collaborator

@schuylermartin45 schuylermartin45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like CRM is properly integrated. There are likely other opportunities for further integration, but that's not relevant at this time.

I can't speak so much for other parts of this project, so take my approval with that nuance.

@cbouss cbouss merged commit 36d7447 into main Nov 20, 2024
3 checks passed
@cbouss cbouss deleted the 0.2.0 branch November 20, 2024 15:21
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.

4 participants