-
-
Notifications
You must be signed in to change notification settings - Fork 12
Disable Poetry "package mode" #942
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The project's Python package dependencies are managed using the Poetry tool. By default, Poetry is configured in "package mode", which is intended for use with projects that are a Python package. When Poetry is used in a project like this that is a standalone script, this configuration is inappropriate and has the following effects: * `poetry install` command installs the project as a Python package in addition to the dependencies. * `name`, `version`, `description`, and `authors` fields of the pyproject.toml file are required. Installing the project as a package is completely inappropriate if the project is not a package, and may cause the command to fail with a cryptic error. This can be avoided by passing the `--no-root` flag to the `install` command, but that increases the usage complexity and chance for user error. Although metadata fields under the `tool.poetry` section of the pyproject.toml configuration file are important for a package, in a non-package project there are better ways to provide that information. Since Git tags are used for versioning, the presence of a `version` field is especially harmful since it means duplication of information and extra work for the project maintainer (and likelihood the metadata will not be kept updated). This "package mode" can be disabled via the pyproject.toml configuration file, which causes Poetry to operate purely in the sole capacity in which it is used by this project: to manage dependencies.
@per1234
per1234
added
type: enhancement
Proposed improvement
topic: infrastructure
Related to project infrastructure
labels
Sep 12, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #942 +/- ## ======================================= Coverage 83.33% 83.33% ======================================= Files 1 1 Lines 180 180 ======================================= Hits 150 150 Misses 19 19 Partials 11 11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The project's Python package dependencies are managed using the Poetry tool.
By default, Poetry is configured in "package mode", which is intended for use with projects that are a Python package. When Poetry is used in a project like this that is a standalone script, this configuration is inappropriate and has the following effects:
poetry install
command installs the project as a Python package in addition to the dependencies.name
,version
,description
, andauthors
fields of the pyproject.toml file are required.Installing the project as a package is completely inappropriate if the project is not a package, and may cause the command to fail with a cryptic error. This can be avoided by passing the
--no-root
flag to theinstall
command, but that increases the usage complexity and chance for user error.Although metadata fields under the
tool.poetry
section of the pyproject.toml configuration file are important for a package, in a non-package project there are better ways to provide that information. Since Git tags are used for versioning, the presence of aversion
field is especially harmful since it means duplication of information and extra work for the project maintainer (and likelihood the metadata will not be kept updated).This "package mode" can be disabled via the pyproject.toml configuration file, which causes Poetry to operate purely in the sole capacity in which it is used by this project: to manage dependencies.