Skip to content

Commit 420b435

Browse files
authored
os: Use pipx to install poetry (#585)
* This is the recommended installation method for poetry https://python-poetry.org/docs/#installation * Makes `poetry` available in the $PATH for developers
1 parent b96a616 commit 420b435

File tree

12 files changed

+536
-495
lines changed

12 files changed

+536
-495
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# EditorConfig is awesome: https://editorconfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Tab indentation (no size specified)
12+
[Makefile]
13+
indent_style = tab

.github/workflows/documentation-build.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
paths:
1515
- 'documentation/**'
1616
- 'hardware/**'
17+
- '.github/workflows/documentation-build.yml'
1718
merge_group:
1819
workflow_dispatch:
1920
inputs:
@@ -47,7 +48,7 @@ jobs:
4748

4849
# Build documentation website
4950
- name: Install poetry
50-
run: pipx install poetry==1.7.1
51+
run: pipx install poetry==2.1.2
5152

5253
- name: Set up Python
5354
uses: actions/setup-python@v5
@@ -59,17 +60,20 @@ jobs:
5960
6061
- name: Install build dependencies
6162
run: |
62-
poetry -C ./documentation/ install
63+
poetry -C ./documentation/ install --no-root
6364
6465
- name: Make documentation ${{ matrix.variant }}
6566
if: matrix.variant != 'default'
66-
run: poetry -C ./documentation/ run poe --root ./documentation/ make-${{ matrix.variant }}
67+
working-directory: documentation
68+
run: poetry run poe make-${{ matrix.variant }}
6769

6870
- name: Check documentation
69-
run: poetry -C ./documentation/ run poe --root ./documentation/ check
71+
working-directory: documentation
72+
run: poetry run poe check
7073

7174
- name: Build documentation
72-
run: poetry -C ./documentation/ run poe --root ./documentation/ build
75+
working-directory: documentation
76+
run: poetry run poe build
7377

7478
# Work around a bug where capital letters in the GitHub username (e.g. "PlanktoScope") make it
7579
# impossible to push to GHCR. See https://github.com/macbre/push-to-ghcr/issues/12

.github/workflows/documentation-deploy-beta.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
sudo apt-get -y install pngquant
3838
3939
- name: Install poetry
40-
run: pipx install poetry==1.7.1
40+
run: pipx install poetry==2.1.2
4141

4242
- name: Set up Python
4343
uses: actions/setup-python@v5
@@ -49,16 +49,19 @@ jobs:
4949
5050
- name: Install build dependencies
5151
run: |
52-
poetry -C ./documentation/ install --with imaging
52+
sudo apt install libjpeg-dev
53+
poetry -C ./documentation/ install --with imaging --no-root
5354
5455
- name: Set release channel
55-
run: poetry -C ./documentation/ run poe --root ./documentation/ set-beta-release-channel
56+
working-directory: documentation
57+
run: poetry run poe set-beta-release-channel
5658

5759
- name: Build documentation
5860
env:
5961
DOCS_DEPLOY: true
6062
DOCS_SITEURL: ${{ vars.URL }}
61-
run: poetry -C ./documentation/ run poe --root ./documentation/ build
63+
working-directory: documentation
64+
run: poetry run poe build
6265

6366
- name: Push to ${{ vars.REPOSITORY_NAME }}
6467
uses: cpina/github-action-push-to-another-repository@main

.github/workflows/documentation-deploy-edge.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
sudo apt-get -y install pngquant
4343
4444
- name: Install poetry
45-
run: pipx install poetry==1.7.1
45+
run: pipx install poetry==2.1.2
4646

4747
- name: Set up Python
4848
uses: actions/setup-python@v5
@@ -54,16 +54,19 @@ jobs:
5454
5555
- name: Install build dependencies
5656
run: |
57-
poetry -C ./documentation/ install --with imaging
57+
sudo apt install libjpeg-dev
58+
poetry -C ./documentation/ install --with imaging --no-root
5859
5960
- name: Set release channel
60-
run: poetry -C ./documentation/ run poe --root ./documentation/ set-edge-release-channel
61+
working-directory: documentation
62+
run: poetry run poe set-edge-release-channel
6163

6264
- name: Build documentation
6365
env:
6466
DOCS_DEPLOY: true
6567
DOCS_SITEURL: ${{ vars.URL }}
66-
run: poetry -C ./documentation/ run poe --root ./documentation/ build
68+
working-directory: documentation
69+
run: poetry run poe build
6770

6871
- name: Set up Pages
6972
id: pages

.github/workflows/documentation-deploy-stable.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
sudo apt-get -y install pngquant
3838
3939
- name: Install poetry
40-
run: pipx install poetry==1.7.1
40+
run: pipx install poetry==2.1.2
4141

4242
- name: Set up Python
4343
uses: actions/setup-python@v5
@@ -48,14 +48,17 @@ jobs:
4848
documentation/poetry.lock
4949
5050
- name: Install build dependencies
51+
working-directory: documentation
5152
run: |
52-
poetry -C ./documentation/ install --with imaging
53+
sudo apt install libjpeg-dev
54+
poetry install --with imaging --no-root
5355
5456
- name: Build documentation
5557
env:
5658
DOCS_DEPLOY: true
5759
DOCS_SITEURL: ${{ vars.URL }}
58-
run: poetry -C ./documentation/ run poe --root ./documentation/ build
60+
working-directory: documentation
61+
run: poetry run poe build
5962

6063
- name: Push to ${{ vars.REPOSITORY_NAME }}
6164
uses: cpina/github-action-push-to-another-repository@main

documentation/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ cd /some/path/here/PlanktoScope/documentation
6464
poetry run poe build
6565
```
6666

67-
If you really don't want to change your current working directory to `/some/path/here/PlanktoScope/documentation`, you can instead run the following command:
68-
69-
```
70-
poetry -C /some/path/here/PlanktoScope/documentation/ run poe --root /some/path/here/PlanktoScope/documentation/ build
71-
```
72-
7367
(this also works for `preview`, `check`, and any other subcommands of `poe`)
7468

7569
#### Publishing your changes

0 commit comments

Comments
 (0)