Skip to content

Commit d295c7c

Browse files
committed
Disable Poetry "package mode"
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.
1 parent 1719ade commit d295c7c

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Taskfile.yml

-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ tasks:
388388
cmds:
389389
- |
390390
poetry install \
391-
--no-root \
392391
{{if .POETRY_GROUPS}} --only {{.POETRY_GROUPS}} {{end}}
393392
394393
python:coverage-report:

pyproject.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
line-length = 120
33

44
[tool.poetry]
5-
name = "compilesketches"
6-
version = "0.0.0"
7-
description = ""
8-
authors = ["Arduino <[email protected]>"]
5+
package-mode = false
96

107
[tool.poetry.dependencies]
118
python = "3.11.2"

0 commit comments

Comments
 (0)