-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Implement Virtual Packages Plugins #11854
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
Conversation
Initial plugin framework implementation. Adds registration decorator `@conda.plugins.register` and hook `conda_subcommands` this allows simple subcommand registration: ``` import conda.plugins @conda.plugins.register def conda_subcommands(): yield conda.plugins.CondaSubcommand( name="my-subcommand", summary="...", action=<function>, ) ``` Co-authored-by: Filipe Lains <lains@riseup.net> Co-authored-by: Katherine Kinnaman <kkinnaman@anaconda.com> Co-authored-by: Jannis Leidel <jannis@leidel.info> Co-authored-by: Travis Hathaway <travis.j.hathaway@gmail.com> Co-authored-by: Ken Odegard <kodegard@anaconda.com>
9185037
to
e59cebd
Compare
739cf4e
to
b42772f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, this implements the hook, but the hook isn't used anywhere? Further, what's the intention of the hook? Will simply installing the plugin set the virtual package as always "on" with a fixed version? E.g., if I'm on macOS I'll always have a corresponding OS package like conda-plugin-osx-10.6
installed?
* Add `win-arm64` as a recognized platform (conda#11778) * Rename `conda.recipe` to `recipe` (conda#11774) * Rename conda.recipe to recipe * Add news * Update canary-release action version (conda#11799) * Updated conda CLI help to be better for users. (conda#11708) Co-authored-by: Jannis Leidel <jannis@leidel.info> Co-authored-by: Bianca Henderson <bhenderson@anaconda.com> * 🔄 Synced file(s) with conda/infra (conda#11827) Co-authored-by: Conda Bot <conda-bot@users.noreply.github.com> * Fix pypy win (conda#11734) * [pre-commit.ci] pre-commit autoupdate (conda#11833) updates: - [github.com/akaihola/darker: 1.5.0 → 1.5.1](akaihola/darker@1.5.0...1.5.1) - [github.com/PyCQA/pylint: v2.15.0 → v2.15.2](pylint-dev/pylint@v2.15.0...v2.15.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Fixes an issue that we are having with carnary builds (conda#11803) * Fixes an issue that we are having with carnary builds See this issue for more information: conda/conda-build#4572 * undoing upates to cytoolz * Update CONTRIBUTING.md (conda#11816) Change all references to `triaging` to `issue sorting` per conda/infrastructure#575 * Release 22.9.0 (conda#11844) * Updated .authors.yml * Updated .mailmap * Updated news * Updated authorship for 22.9.0 * Updated CHANGELOG for 22.9.0 * Added first contributions * Update CHANGELOG.md Co-authored-by: Ken Odegard <kodegard@anaconda.com> * Update CHANGELOG.md Co-authored-by: Ken Odegard <kodegard@anaconda.com> * Update CHANGELOG.md Co-authored-by: Ken Odegard <kodegard@anaconda.com> * Update CHANGELOG.md Co-authored-by: Ken Odegard <kodegard@anaconda.com> * Update CHANGELOG.md Co-authored-by: Ken Odegard <kodegard@anaconda.com> * Add special announcement to changelog. * Remove emoji to not freak out rever. Co-authored-by: Jannis Leidel <jannis@leidel.info> Co-authored-by: Ken Odegard <kodegard@anaconda.com> * Expose --mach and --arch to devenv script (conda#11851) * [pre-commit.ci] pre-commit autoupdate (conda#11859) updates: - [github.com/PyCQA/pylint: v2.15.2 → v2.15.3](pylint-dev/pylint@v2.15.2...v2.15.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * 🔄 Synced file(s) with conda/infra (conda#11853) Co-authored-by: Conda Bot <conda-bot@users.noreply.github.com> * Require `ruamel.yaml` (conda#11868) * Update requirements.txt (conda#11842) Updating the flask to address multiple CVEs including ones listed in conda#11831 * Grammatical correction in docs (conda#11870) * Removed allow_other_channels from conda docs. (conda#11866) * Use maintained `ruamel.yaml` (conda#11837) * Try using maintained ruamel.yaml The conda specific fork is maintained as a conda package only in https://github.com/conda-forge/ruamel_yaml-feedstock/tree/master/recipe. My understanding of what's being patched there seems to indicate it's just the __init__.py file. I'm hoping just a rename of the import will be enough, or at least surface what real problems exist. Ref conda#10691 * Only use ruamel.yaml * Use updated ruamel.yaml API stringio * Cache yaml parsers * TEMP CI CHANGE, REMOVE BEFORE MERGE * Add ruamel_yaml fallback * Add news * Undo CI fixes * Update news Co-authored-by: YuviPanda <yuvipanda@gmail.com> Co-authored-by: Orion Poplawski <orion@nwra.com> * document conda-build: pkg_format: 2 (conda#11881) * document conda-build: pkg_format: 2 * Apply suggestions from code review Co-authored-by: Katherine Kinnaman <kkinnaman@anaconda.com> Co-authored-by: Cheng H. Lee <chenghlee@users.noreply.github.com> Co-authored-by: Ken Odegard <kodegard@anaconda.com> Co-authored-by: Katherine Kinnaman <kkinnaman@anaconda.com> Co-authored-by: Jannis Leidel <jannis@leidel.info> Co-authored-by: Conda Bot <18747875+conda-bot@users.noreply.github.com> Co-authored-by: Conda Bot <conda-bot@users.noreply.github.com> Co-authored-by: Isuru Fernando <isuruf@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Travis Hathaway <travis.j.hathaway@gmail.com> Co-authored-by: Shaun Walbridge <46331011+scdub@users.noreply.github.com> Co-authored-by: Nikhil Raverkar <raverkar.nikhil@gmail.com> Co-authored-by: Satyam Vyas <vyas.satyam.04@gmail.com> Co-authored-by: YuviPanda <yuvipanda@gmail.com> Co-authored-by: Orion Poplawski <orion@nwra.com> Co-authored-by: Daniel Holth <dholth@anaconda.com>
0a49f45
to
8f37d52
Compare
Some of the CI test failures are due to this issue: #11905 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the naming issue, this LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is as good as it gets. @beeankha @travishathaway @kenodegard Would you mind a final review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
* Add hook for virtual package plugins * Add documentation on virtual package plugins * Add virtual package plugin hook test * Fix virtual packages unit test, update index module * Add news item * Remove virtual package code from index.py, add plugins and register them in context.py * Update 'available version' on plugins docs page * Update virtual packages plugin hook naming for consistency * Mark conda.common.cuda.cuda_detect for deprecation. * Use functools.wraps for properly wrapping functions. * Be explicit about exception. * Move and fix cuda tests. * Add a cached version to make sure conda.common.cuda.cuda_detect stays uncached. * Update news file with PR number * Move _supplement_index_with_system back up to where it was previous to refactoring * Using for-else and contextlib.suppress in cuda virtual pkg plugin * Update `maxsize` to None in `lru_cache()` decorator for efficiency * Fix virtual packages unit test, update index module * Move virtual package plugins into submodule. * Update structure of virtual package plugins, re-do imports * Fixes issue with tests plus more The order of decorator functions was causing an issue with tests. Before this commit we had the following order: cache -> env_var_override Now it is: env_var_override -> cache This means that the env_var_override will always override the value where before this was being cached. Also changed in this commit is the adding back of the `cuda_version` to the `context` object. I figured this would be a good idea because removing this may break other projects out there that have come to depend on it. * Update test_solve.py file to make tests pass * Add pluggy as a requirement to setup.py and recipe files, update test_create to test for Python3 vs 2 * Clear cache in three more cuda tests, change python version to 3.8 to enable test to pass * Change location of cache clearing in virtual package cuda tests * Mark conda.base.context.cuda_version function as pending deprecation. * Refactor plugins package. * Try using a fixture for cache invalidation. * Remove duplicate item in recipe. * Use correct path in autodoc directives Co-authored-by: Ken Odegard <kodegard@anaconda.com> Co-authored-by: Filipe Lains <lains@riseup.net> Co-authored-by: Jannis Leidel <jannis@leidel.info> Co-authored-by: Travis Hathaway <travis.j.hathaway@gmail.com>
This work will enable virtual packages plugins to be able to hook into
conda
. This is something with precedented demand:Fixes #11811