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

Make use of poetry 1.2+ groups #15

Closed
3 tasks done
maxrake opened this issue Apr 4, 2022 · 1 comment · Fixed by #152
Closed
3 tasks done

Make use of poetry 1.2+ groups #15

maxrake opened this issue Apr 4, 2022 · 1 comment · Fixed by #152
Assignees
Labels
low priority This should be addressed as time permits task Task/chore unrelated to a bug or feature request

Comments

@maxrake
Copy link
Contributor

maxrake commented Apr 4, 2022

Description

Use requirement groups in poetry to ensure only the dev-dependencies needed for running in a given environment are installed. For example, a "CI" group could be created to capture those dependencies that are only used in the CI environment, saving them from being installed in local or other environments.

Additional Details

  • This should be possible when Poetry 1.2 is available, using the groups feature as documented in poetry issue 1644
  • Create distinct groups to capture all of the possible environments and use cases
    • Other possible groups: dev, test, doc

Acceptance Criteria

  • Groups are created and used for dev-dependencies
  • pyproject.toml and all affected workflows are updated
  • Documentation is updated
@maxrake maxrake added low priority This should be addressed as time permits task Task/chore unrelated to a bug or feature request labels Apr 4, 2022
@maxrake maxrake self-assigned this Sep 21, 2022
@maxrake
Copy link
Contributor Author

maxrake commented Sep 21, 2022

poetry v1.2.0 was released last month, with this announcement post. There has already been a v1.2.1 release as well, fixing many bugs and updating documentation.

maxrake added a commit that referenced this issue Oct 28, 2022
Poetry 1.2+ allows for dependency groups. Three new groups were created to split up what used to be considered the `dev` dependencies. All three groups were made to be optional and will therefore require specifying during a `poetry install` command with the `--with` option. The `test` group includes packages needed to run the test suite. The `ci` group includes packages that are only used in the Continuous Integration (CI) environment, in GitHub workflows. The `qa` group includes (or will include, when there are more) packages related to ensuring Quality Assurance (QA) (e.g., with linting, formatting, and typing tools).

Additional actions taken:
* Ensure `tox` environments have `test` dependency group installed
* Use the minimum dependency groups necessary in CI workflows
* Bump `poetry.lock` dependencies
  * The lockfile was regenerated and updated to match the latest install of `poetry` and the updated `pyproject.toml` file
  * An issue was found with the casing of the `levenshtein` package
    * It would not complete Phylum processing due to a mis-match in name: it expects `Levenshtein`
    * Even though the name is controlled by `poetry`, the lockfile was manually updated to change the case on this package to enable analysis completion
    * The issue has been brought forward to the relevant Phylum developers and will be addressed in a separate issue(s)
* Use poetry plugin `poetry-plugin-export` for `export` command 
  * The `export` command is now provided as a plugin
    * It is installed by default for the `poetry` v1.2 release, but future releases will deprecate this automatic install
  * Installing the plugin directly now does not harm the function of the plugin or cause any errors given that it may already be installed
  * This change is getting ahead of the future deprecation
* Update `CONTRIBUTING.md` to account for poetry dependency groups
* Remove `poetry install` step from `auto_updates` workflow
  * It turns out that the project does not need to be installed in order for `poetry` to update the lockfile
  * Removing this step saves some workflow execution time

Closes #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority This should be addressed as time permits task Task/chore unrelated to a bug or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant