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

207 Refactor RecipeParserDeps #209

Merged
merged 17 commits into from
Oct 21, 2024
Merged

Conversation

schuylermartin45
Copy link
Collaborator

Addresses #207

While developing another prototype, I noticed that we did not have an ability to add or remove Dependency objects in recipe files. I also noticed that RecipeParserDeps was not in line with the new Parser/Reader naming scheme.

Hence this PR that contains:

  • Renaming RecipeParserDeps -> RecipeReaderDeps
  • A new RecipeParserDeps that extends the RecipeReaderDeps class and includes editing capabilities
    • This new class includes new, high-level add_dependency() and remove_dependency() functions
  • A new SelectorParser::render() function.
  • A handful of patch(), SelctorParser and other bug fixes found along the way
  • A whole lot of TODO Add V1 support notices
  • Regression tests for the bugs found
  • Some missing unit tests
  • Significant unit testing for the new functionality

@schuylermartin45 schuylermartin45 added bug Something isn't working enhancement New feature or request labels Oct 18, 2024
@schuylermartin45 schuylermartin45 requested a review from a team as a code owner October 18, 2024 22:10
@schuylermartin45 schuylermartin45 linked an issue Oct 18, 2024 that may be closed by this pull request
@schuylermartin45 schuylermartin45 merged commit c3a99ec into main Oct 21, 2024
14 checks passed
@schuylermartin45 schuylermartin45 deleted the 207-refactor-recipeparserdeps branch October 21, 2024 14:17
ForgottenProgramme pushed a commit that referenced this pull request Nov 6, 2024
* Renames RecipeParserDeps -> RecipeReaderDeps

* Renames RecipeParserDeps -> RecipeReaderDeps

* Fleshes-out initial utility functions in the new RecipeParserDeps class

* Improves SelectorParser capabilities

* Adds selector management to the add_dependency() function

* Adds unit test for selector rendering

* Added SelectorParser type variant to test_add_selector()

* Adds initial RecipeParserDeps unit tests

* Adds initial multi-output add_dependency() test variants

* Adds unit tests for remove_dependency()

* Adds invalid path tests to test_add_dependency()

* Adds alternative DependencyMode unit tests to test_add_dependency()

* Adds missing invalid path checks for test_add_dependency()

* Adds more edge-case unit tests to test_add_dependency()

* Fixes patch-add append edge case

* Adds missing unit test for adding a dependency to a non-existent dependency section

* Adds another missing unit test for adding a dependency to a non-existent dependency section
schuylermartin45 added a commit that referenced this pull request Nov 6, 2024
* add bump-recipe command

* fix type error

* add test

* fix failing tests

* Update conda_recipe_manager/commands/bump_recipe.py

Co-authored-by: Schuyler Martin <schuylermartin45@gmail.com>

* add some suggestions from the code review

* more changes based on previous code review

* check if the build number was actually incremented

* parametrize the test

* Update tests/commands/test_bump_recipe.py

Co-authored-by: Schuyler Martin <schuylermartin45@gmail.com>

* Update tests/commands/test_bump_recipe.py

Co-authored-by: Schuyler Martin <schuylermartin45@gmail.com>

* Update tests/commands/test_bump_recipe.py

Co-authored-by: Schuyler Martin <schuylermartin45@gmail.com>

* Update tests/commands/test_bump_recipe.py

Co-authored-by: Schuyler Martin <schuylermartin45@gmail.com>

* Update tests/commands/test_bump_recipe.py

Co-authored-by: Schuyler Martin <schuylermartin45@gmail.com>

* Update `convert` to properly handle complex Jinja expressions (#176)

* Add tilde to _JINJA_VAR_FUNCTION_PATTERN

* Create V0_FORBIDDEN_JINJA constant and check for strings containing them when converting recipes

* Add exception for when Jinja syntax that is too complex to convert is detected

* Make the linter happy

* Change name of V0_UNSUPPORTED_JINJA constant

* Log 'complex Jinja' warning with the MessageTable instance instead of throwing an exception

* Add more unsupported Jinja to regression_jinja_sub.yaml test recipe file to catch new warning in test

* Simplify warning message and update related test

* Fixes #186: Parser cannot handle addition in JINJA replacements (#191)

* Fixes #186 and adds some support for JINJA addition/concatenation

* Adds unit tests for JINJA addition/concatentation evaluations

* Python code Dependency Scanner Prototype (#180)

* Initial blueprint for dependency scanning module

* Starts to adapt work from abandonned dependency CLI branch

* Finishes initial work on pulling module names as dependencies

* Adds local module filtering

* Adds dependency type support to PythonDependencyScanner

* Adds MessageTable instance to base dependency class

* Adds missing docs

* Minor fixes

* Adds note about scanning performance

* Addresses linter and analyzer issues

* Adds initial dependency scanning unit test

* Adds ignore line to dummy project file

* Improves unit test coverage

* Updates recipe file to ignore test data directory

* Adds support for multiple imports on one line

* Add __init__ files to all test directories (#192)

* v0.3.0 commit (#193)

* Forgot to include some minor changes in the v0.3.0 release commit (#194)

* Updates the recipe doc link (#195)

* Fixes #197 and adds regression tests. Partially fixes #190 (#199)

* Removes missed debug statement (#200)

* 🤖 updated file(s) (#201)

* v0.3.1 (#202)

* Removes conda-forge channel (#204)

* Test the `MessageTable` class (#196)

* Add test for all methods in MessageTable class from types.py

* Split up/parametrize MessageTable unit tests

* Parametrize the MessageTable class tests and expand test cases

* Correct doc string formatting

* 207 Refactor `RecipeParserDeps` (#209)

* Renames RecipeParserDeps -> RecipeReaderDeps

* Renames RecipeParserDeps -> RecipeReaderDeps

* Fleshes-out initial utility functions in the new RecipeParserDeps class

* Improves SelectorParser capabilities

* Adds selector management to the add_dependency() function

* Adds unit test for selector rendering

* Added SelectorParser type variant to test_add_selector()

* Adds initial RecipeParserDeps unit tests

* Adds initial multi-output add_dependency() test variants

* Adds unit tests for remove_dependency()

* Adds invalid path tests to test_add_dependency()

* Adds alternative DependencyMode unit tests to test_add_dependency()

* Adds missing invalid path checks for test_add_dependency()

* Adds more edge-case unit tests to test_add_dependency()

* Fixes patch-add append edge case

* Adds missing unit test for adding a dependency to a non-existent dependency section

* Adds another missing unit test for adding a dependency to a non-existent dependency section

* v0.3.2 (#210)

* Fixes `numpy {{numpy}}` dependency bug (#214)

* Fixes resilience issue with dependency_data_from_str() function also makes function names more consistent

* Adds missing unit tests for dependency module

* Removes outdated TODO comment

* Adds regression testing for the numpy dependency parsing issue

* v0.3.3 (#216)

* v0.3.4 (#217)

* Improves pytest config filter to be less aggressive (#223)

* 🤖 updated file(s) (#226)

* Incorporating user documentation feedback and simplifies the `Makefile` (#227)

* Ignores another pytest deprecation

* Simplifications and deprecations for the Makefile. The preferred method for installing CRM is through conda/conda-forge

* Overhauls existing README documentation

* Updates README TOC

* More README doc work

* More README improvements

* Filling more doc gaps

* Simplifies and automates the API documentaiton process

* Update README.md

Co-authored-by: Mahe Iram Khan <65779580+ForgottenProgramme@users.noreply.github.com>

* Update README.md

Co-authored-by: Mahe Iram Khan <65779580+ForgottenProgramme@users.noreply.github.com>

* Update README.md

Co-authored-by: Mahe Iram Khan <65779580+ForgottenProgramme@users.noreply.github.com>

* Adds a contribution file

* Update CONTRIBUTING.md

---------

Co-authored-by: Mahe Iram Khan <65779580+ForgottenProgramme@users.noreply.github.com>

* remove dangling else statements

---------

Co-authored-by: Schuyler Martin <schuylermartin45@gmail.com>
Co-authored-by: Bianca Henderson <bhenderson@anaconda.com>
Co-authored-by: conda-bot <18747875+conda-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla-signed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor RecipeParserDeps
3 participants