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

Disable Poetry "package mode" #293

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Disable Poetry "package mode" #293

merged 1 commit into from
Jun 14, 2024

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Jun 13, 2024

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 in appropriate and has the following effects:

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 Jun 13, 2024
@per1234 per1234 self-assigned this Jun 13, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.81%. Comparing base (573eab4) to head (42518d8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #293   +/-   ##
=======================================
  Coverage   99.81%   99.81%           
=======================================
  Files           2        2           
  Lines        1623     1623           
=======================================
  Hits         1620     1620           
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 in appropriate 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 merged commit c20b3e2 into arduino:main Jun 14, 2024
44 checks passed
@per1234 per1234 deleted the package-mode branch June 14, 2024 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants