Skip to content

Commit 89c1776

Browse files
committed
Manage versioning of Poetry tool dependency
The project Python package dependencies are managed by the "Poetry" tool. Previously, the version of Poetry was not managed in any way. The GitHub Actions workflows used whichever version of Poetry happened to be installed on the runner machine. This meant that the GitHub Actions workflows could break at any time through the Poetry installation on the runner machine being updated to an incompatible version. The contributors used whichever version of Poetry happened to be installed on their machine. This meant that they might get different results from that produced by the environment of the GitHub Actions workflows. The better solution is to take the same approach for managing the Poetry dependency as is done for the project's other dependencies: * Install a specific version of Poetry according to a single source of versioning data. * Use the Dependabot service to get automated update pull requests. The logical place to define the Poetry package dependency version is in pyproject.toml, as is done for all other Python package dependencies. Dependabot has support for two different forms of dependency data in the pyproject.toml file: * Original Poetry data format, under the `tool.poetry` table * PEP 621 format data, under the `project` table Since Poetry can't be used to manage itself (it is instead installed using the "pipx" tool), the obvious approach would be to define the Poetry dependency via the `project` table in the file. However, this is not possible because if a `tool.poetry` table is present in pyproject.toml, Dependabot ignores the dependencies data from the `project` table. So it is necessary to place the data for the Poetry dependency under the `tool.poetry` table of the file. A special dependencies group is created for this purpose. That group is configured as "optional" so that it won't be installed redundantly by `poetry install` commands. Unfortunately pipx doesn't support using pyproject.toml as a dependency configuration file so it is necessary to get the Poetry version constraint for use in the dependency argument of the `pipx install` command by parsing the project.toml file.
1 parent 67e85b1 commit 89c1776

File tree

120 files changed

+1737
-479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1737
-479
lines changed

.github/workflows/check-mkdocs-task.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ jobs:
8888
with:
8989
python-version-file: pyproject.toml
9090

91-
- name: Install Poetry
92-
run: pip install poetry
93-
9491
- name: Setup Node.js
9592
uses: actions/setup-node@v5
9693
with:

.github/workflows/check-python-task.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
- "**/poetry.lock"
1212
- "**/pyproject.toml"
1313
- "**/setup.cfg"
14+
- "go.mod"
15+
- "go.sum"
1416
- "Taskfile.ya?ml"
1517
- "**/tox.ini"
1618
- "**.py"
@@ -21,6 +23,8 @@ on:
2123
- "**/poetry.lock"
2224
- "**/pyproject.toml"
2325
- "**/setup.cfg"
26+
- "go.mod"
27+
- "go.sum"
2428
- "Taskfile.ya?ml"
2529
- "**/tox.ini"
2630
- "**.py"
@@ -66,14 +70,16 @@ jobs:
6670
- name: Checkout repository
6771
uses: actions/checkout@v5
6872

73+
- name: Install Go
74+
uses: actions/setup-go@v5
75+
with:
76+
go-version-file: go.mod
77+
6978
- name: Install Python
7079
uses: actions/setup-python@v6
7180
with:
7281
python-version-file: pyproject.toml
7382

74-
- name: Install Poetry
75-
run: pip install poetry
76-
7783
- name: Install Task
7884
uses: arduino/setup-task@v2
7985
with:
@@ -102,9 +108,6 @@ jobs:
102108
with:
103109
python-version-file: pyproject.toml
104110

105-
- name: Install Poetry
106-
run: pip install poetry
107-
108111
- name: Install Task
109112
uses: arduino/setup-task@v2
110113
with:

.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ jobs:
7272
with:
7373
python-version-file: pyproject.toml
7474

75-
- name: Install Poetry
76-
run: |
77-
python -m pip install --upgrade pip
78-
python -m pip install poetry
79-
80-
- name: Setup Node.js
81-
uses: actions/setup-node@v5
82-
with:
83-
node-version-file: package.json
84-
8575
- name: Install Task
8676
uses: arduino/setup-task@v2
8777
with:
@@ -92,7 +82,7 @@ jobs:
9282
run: task docs:generate
9383

9484
- name: Install Python dependencies
95-
run: poetry install --no-root
85+
run: task poetry:install-deps
9686

9787
- name: Determine versioning parameters
9888
id: determine-versioning

.github/workflows/spell-check-task.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ jobs:
5353
with:
5454
python-version-file: pyproject.toml
5555

56-
- name: Install Poetry
57-
run: pip install poetry
58-
5956
- name: Install Task
6057
uses: arduino/setup-task@v2
6158
with:

.github/workflows/test-go-integration-task.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ jobs:
8484
with:
8585
python-version-file: pyproject.toml
8686

87-
- name: Install Poetry
88-
run: pip install poetry
89-
9087
- name: Install Task
9188
uses: arduino/setup-task@v2
9289
with:

.licenses/arduino-lint/go/github.com/fatih/color.dep.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: github.com/fatih/color
3-
version: v1.15.0
3+
version: v1.18.0
44
type: go
55
summary: Package color is an ANSI color package to output colorized or SGR defined
66
output to the standard output.

.licenses/arduino-lint/go/github.com/magiconair/properties.dep.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: github.com/magiconair/properties
3-
version: v1.8.7
3+
version: v1.8.10
44
type: go
55
summary: Package properties provides functions for reading and writing ISO-8859-1
66
and UTF-8 encoded .properties files and has support for recursive property expansion.

.licenses/arduino-lint/go/github.com/mattn/go-colorable.dep.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: github.com/mattn/go-colorable
3-
version: v0.1.13
3+
version: v0.1.14
44
type: go
55
summary:
66
homepage: https://pkg.go.dev/github.com/mattn/go-colorable

.licenses/arduino-lint/go/github.com/pelletier/go-toml/v2.dep.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: github.com/pelletier/go-toml/v2
3-
version: v2.1.0
3+
version: v2.2.4
44
type: go
55
summary: Package toml is a library to read and write TOML documents.
66
homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2

.licenses/arduino-lint/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
name: github.com/pelletier/go-toml/v2/internal/characters
3-
version: v2.1.0
3+
version: v2.2.4
44
type: go
55
summary:
66
homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/characters
77
license: mit
88
licenses:
9-
- sources: v2@v2.1.0/LICENSE
9+
- sources: v2@v2.2.4/LICENSE
1010
text: |
1111
The MIT License (MIT)
1212
@@ -30,6 +30,6 @@ licenses:
3030
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3131
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3232
SOFTWARE.
33-
- sources: v2@v2.1.0/README.md
33+
- sources: v2@v2.2.4/README.md
3434
text: The MIT License (MIT). Read [LICENSE](LICENSE).
3535
notices: []

0 commit comments

Comments
 (0)