Skip to content

Disable Poetry "package mode" #603

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 1 commit into from
Jun 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
line-length = 120

[tool.poetry]
name = "tooling-project-assets"
version = "0.0.0"
description = ""
authors = ["Arduino <[email protected]>"]
package-mode = false

[tool.poetry.dependencies]
python = "~3.9"
Expand Down
26 changes: 26 additions & 0 deletions workflow-templates/assets/poetry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Poetry Assets

Python package dependencies are managed using the [**Poetry**](https://python-poetry.org/) tool.

In addition to direct dependencies used by project Python code, **Poetry** is also used to manage Python package-based tools that are used for development and maintenance operations in the project.

## Installation

### Assets

Install [`pyproject.toml`](pyproject.toml) to the root of the project repository.

## Configuration

### If the project is not a Python package

No configuration is needed.

### If the project is a Python package

1. Delete the following line from the `pyproject.toml` file:
```toml
package-mode = false
```
1. Define the package metadata under the `tool.poetry` section of the `pyproject.toml` file:<br />
https://python-poetry.org/docs/pyproject#the-toolpoetry-section
11 changes: 11 additions & 0 deletions workflow-templates/assets/poetry/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry/pyproject.toml

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
package-mode = false

[tool.poetry.dependencies]
python = "^3.9"
2 changes: 2 additions & 0 deletions workflow-templates/check-mkdocs-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Install the [`check-mkdocs-task.yml`](check-mkdocs-task.yml) GitHub Actions work

### Assets

- [`pyproject.toml`](assets/poetry/pyproject.toml) - [**Poetry**](https://python-poetry.org/) configuration.
- Install to: repository root (unless a `pyproject.toml` file is already present).
- [`Taskfile.yml`](assets/check-mkdocs-task/Taskfile.yml) - Build task.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/poetry-task/Taskfile.yml) - Installation task.
Expand Down
18 changes: 4 additions & 14 deletions workflow-templates/check-python-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Install the [`check-python-task.yml`](check-python-task.yml) GitHub Actions work

- [`.flake8`](assets/check-python/.flake8) - flake8 configuration file.
- Install to: repository root
- [`pyproject.toml`](assets/poetry/pyproject.toml) - [**Poetry**](https://python-poetry.org/) configuration.
- Install to: repository root (unless a `pyproject.toml` file is already present).
- [`Taskfile.yml`](assets/check-python-task/Taskfile.yml) - Python linting and formatting tasks.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/poetry-task/Taskfile.yml) - Installation task.
Expand All @@ -23,25 +25,13 @@ The code style defined in `pyproject.toml` and `.flake8` is the official standar

### Dependencies

The tool dependencies of this workflow are managed by [Poetry](https://python-poetry.org/).

Install Poetry by following these instructions:<br />
https://python-poetry.org/docs/#installation

If your project does not already use Poetry, you can initialize the [`pyproject.toml`](https://python-poetry.org/docs/pyproject/) file using these commands:

```
poetry init --python="^3.9" --dev-dependency="black@^25.1.0" --dev-dependency="flake8@^7.2.0" --dev-dependency="pep8-naming@^0.15.1"
poetry install
```

If already using Poetry, add the tool using this command:
Add the tool dependencies using this command:

```
poetry add --dev "black@^25.1.0" "flake8@^7.2.0" "pep8-naming@^0.15.1"
```

Commit the resulting `pyproject.toml` and `poetry.lock` files.
Commit the resulting changes to the `pyproject.toml` and `poetry.lock` files.

### Configuration

Expand Down
18 changes: 4 additions & 14 deletions workflow-templates/check-yaml-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Install the [check-yaml-task.yml](check-yaml-task.yml) GitHub Actions workflow t

- [`.yamllint.yml`](assets/check-yaml/.yamllint.yml) - `yamllint` configuration file.
- Install to: repository root
- [`pyproject.toml`](assets/poetry/pyproject.toml) - [**Poetry**](https://python-poetry.org/) configuration.
- Install to: repository root (unless a `pyproject.toml` file is already present).
- [`Taskfile.yml`](assets/check-yaml-task/Taskfile.yml) - Linting task.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/poetry-task/Taskfile.yml) - Installation task.
Expand All @@ -25,25 +27,13 @@ The code style defined in this file is the official standardized style to be use

### Dependencies

The `yamllint` tool dependency is managed by [Poetry](https://python-poetry.org/).

Install Poetry by following these instructions:<br />
https://python-poetry.org/docs/#installation

If your project does not already use Poetry, you can initialize the [`pyproject.toml`](https://python-poetry.org/docs/pyproject/) file using these commands:

```
poetry init --python="^3.9" --dev-dependency="yamllint@^1.37.1"
poetry install
```

If already using Poetry, add the tool using this command:
Add the tool dependency using this command:

```
poetry add --dev "yamllint@^1.37.1"
```

Commit the resulting `pyproject.toml` and `poetry.lock` files.
Commit the resulting changes to the `pyproject.toml` and `poetry.lock` files.

### Configuration

Expand Down
18 changes: 4 additions & 14 deletions workflow-templates/deploy-mkdocs-poetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Install the [`deploy-mkdocs-poetry.yml`](deploy-mkdocs-poetry.yml) GitHub Action

### Assets

- [`pyproject.toml`](assets/poetry/pyproject.toml) - [**Poetry**](https://python-poetry.org/) configuration.
- Install to: repository root (unless a `pyproject.toml` file is already present).
- [`Taskfile.yml`](assets/poetry-task/Taskfile.yml) - Python package dependency management tasks.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`mkdocs.yml`](assets/mkdocs/mkdocs.yml) - base MkDocs configuration file.
Expand All @@ -21,25 +23,13 @@ Install the [`deploy-mkdocs-poetry.yml`](deploy-mkdocs-poetry.yml) GitHub Action

### Dependencies

The website build dependencies are managed by [Poetry](https://python-poetry.org/).

Install Poetry by following these instructions:<br />
https://python-poetry.org/docs/#installation

If your project does not already use Poetry, you can initialize the [`pyproject.toml`](https://python-poetry.org/docs/pyproject/) file using these commands:

```
poetry init --python="^3.9" --dev-dependency="mkdocs@^1.3.0" --dev-dependency="mkdocs-material@^8.2.11" --dev-dependency="mdx_truly_sane_lists@^1.2"
poetry install
```

If already using Poetry, add the tool using this command:
Add the tool dependencies using this command:

```
poetry add --dev "mkdocs@^1.3.0" "mkdocs-material@^8.2.11" "mdx_truly_sane_lists@^1.2"
```

Commit the resulting `pyproject.toml` and `poetry.lock` files.
Commit the resulting changes to the `pyproject.toml` and `poetry.lock` files.

### Configuration

Expand Down
2 changes: 1 addition & 1 deletion workflow-templates/deploy-mkdocs-versioned-poetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ See the ["Deploy Website" workflow (MkDocs, Poetry) documentation](deploy-mkdocs
```
poetry add --dev "gitpython@^3.1.44" "mike@^1.1.2"
```
1. Commit the resulting `pyproject.toml` and `poetry.lock` files.
1. Commit the resulting changes to the `pyproject.toml` and `poetry.lock` files.

### Configuration

Expand Down
2 changes: 1 addition & 1 deletion workflow-templates/spell-check-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If already using Poetry, add the tool using this command:
poetry add --dev "codespell@^2.4.0"
```

Commit the resulting `pyproject.toml` and `poetry.lock` files.
Commit the resulting changes to the `pyproject.toml` and `poetry.lock` files.

### Configuration

Expand Down
18 changes: 4 additions & 14 deletions workflow-templates/test-go-integration-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Install the [`test-go-integration-task.yml`](test-go-integration-task.yml) GitHu

## Assets

- [`pyproject.toml`](assets/poetry/pyproject.toml) - [**Poetry**](https://python-poetry.org/) configuration.
- Install to: repository root (unless a `pyproject.toml` file is already present).
- [`Taskfile.yml`](assets/test-go-integration-task/Taskfile.yml) - Test runner task.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/go-task/Taskfile.yml) - Build task.
Expand All @@ -27,25 +29,13 @@ Install the [`test-go-integration-task.yml`](test-go-integration-task.yml) GitHu

### Dependencies

The Python dependencies are managed by [Poetry](https://python-poetry.org/).

Install Poetry by following these instructions:<br />
https://python-poetry.org/docs/#installation

If your project does not already use Poetry, you can initialize the [`pyproject.toml`](https://python-poetry.org/docs/pyproject/) file using these commands:

```
poetry init --python="^3.9" --dev-dependency="pytest@^8.4.1" --dev-dependency="invoke@^1.7.0"
poetry install
```

If already using Poetry, add the tool using this command:
Add the tool dependencies using this command:

```
poetry add --dev "pytest@^8.4.1" "invoke@^1.7.0"
```

Commit the resulting `pyproject.toml` and `poetry.lock` files.
Commit the resulting changes to the `pyproject.toml` and `poetry.lock` files.

### Configuration

Expand Down
18 changes: 4 additions & 14 deletions workflow-templates/test-python-poetry-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Install the [`test-python-poetry-task.yml`](test-python-poetry-task.yml) GitHub

### Assets

- [`pyproject.toml`](assets/poetry/pyproject.toml) - [**Poetry**](https://python-poetry.org/) configuration.
- Install to: repository root (unless a `pyproject.toml` file is already present).
- [`Taskfile.yml`](assets/test-python-poetry-task/Taskfile.yml) - Test runner task.
- Install to: repository root (or merge into the existing `Taskfile.yml`).
- [`Taskfile.yml`](assets/poetry-task/Taskfile.yml) - Installation task.
Expand All @@ -25,25 +27,13 @@ Install the [`test-python-poetry-task.yml`](test-python-poetry-task.yml) GitHub

### Dependencies

The Python dependencies are managed by [Poetry](https://python-poetry.org/).

Install Poetry by following these instructions:<br />
https://python-poetry.org/docs/#installation

If your project does not already use Poetry, you can initialize the [`pyproject.toml`](https://python-poetry.org/docs/pyproject/) file using these commands:

```
poetry init --python="^3.9" --dev-dependency="pytest@^8.4.1"
poetry install
```

If already using Poetry, add the tool using this command:
Add the tool dependency using this command:

```
poetry add --dev "pytest@^8.4.1"
```

Commit the resulting `pyproject.toml` and `poetry.lock` files.
Commit the resulting changes to the `pyproject.toml` and `poetry.lock` files.

### Readme badge

Expand Down
Loading