Skip to content

Commit b922af7

Browse files
authored
Updated poetry and python versions used in GitHub actions (#141)
* Updates GitHub actions to use Python 3.9 and poetry 1.2.2 * Updates GitHub actions to use `poetry lock --check` command to check freshness of poetry.lock * Updates steps to use v7 of Gr1N/setup-poetry
1 parent d157faf commit b922af7

4 files changed

Lines changed: 21 additions & 49 deletions

File tree

.github/workflows/PR.yml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,23 @@ on:
66
- main
77

88
env:
9-
POETRY_VERSION: 1.1.10
9+
POETRY_VERSION: 1.2.2
1010

1111
jobs:
1212
checks-nims:
1313
runs-on: ubuntu-latest
1414
env:
15-
PYTHON_VERSION: 3.8
15+
PYTHON_VERSION: 3.9
1616
steps:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-python@v2
1919
with:
2020
python-version: ${{ env.PYTHON_VERSION }}
21-
- uses: Gr1N/setup-poetry@v4
21+
- uses: Gr1N/setup-poetry@v7
2222
with:
2323
poetry-version: ${{ env.POETRY_VERSION }}
24-
# @TODO: This is a workaround for there not being a way to check the lock file
25-
# See: https://github.com/python-poetry/poetry/issues/453
26-
# We might need to make sure the Test dependencies(as of now - Style Guides)
2724
- name: Check for lock changes (measurement service)
28-
run: |
29-
PYTHONPATH="${PYTHONPATH}:${HOME}/.poetry/lib:${HOME}/.poetry/lib/poetry/_vendor/py${{ env.PYTHON_VERSION }}" \
30-
python -c "from poetry.factory import Factory; \
31-
locker = Factory().create_poetry('.').locker; \
32-
lock_is_fresh = locker.is_locked() and locker.is_fresh(); \
33-
print(\"\" if lock_is_fresh else \"Lock is stale, run 'poetry lock' to update the lock file.\"); \
34-
exit(0) if lock_is_fresh else exit(1)"
25+
run: poetry lock --check
3526
- uses: actions/cache@v2
3627
with:
3728
path: ~/.cache/pypoetry/virtualenvs
@@ -53,26 +44,17 @@ jobs:
5344
run:
5445
working-directory: ./ni_measurement_generator
5546
env:
56-
PYTHON_VERSION: 3.8
47+
PYTHON_VERSION: 3.9
5748
steps:
5849
- uses: actions/checkout@v2
5950
- uses: actions/setup-python@v2
6051
with:
6152
python-version: ${{ env.PYTHON_VERSION }}
62-
- uses: Gr1N/setup-poetry@v4
53+
- uses: Gr1N/setup-poetry@v7
6354
with:
6455
poetry-version: ${{ env.POETRY_VERSION }}
65-
# @TODO: This is a workaround for there not being a way to check the lock file
66-
# See: https://github.com/python-poetry/poetry/issues/453
67-
# We might need to make sure the Test dependencies(as of now - Style Guides)
6856
- name: Check for lock changes (generator)
69-
run: |
70-
PYTHONPATH="${PYTHONPATH}:${HOME}/.poetry/lib:${HOME}/.poetry/lib/poetry/_vendor/py${{ env.PYTHON_VERSION }}" \
71-
python -c "from poetry.factory import Factory; \
72-
locker = Factory().create_poetry('.').locker; \
73-
lock_is_fresh = locker.is_locked() and locker.is_fresh(); \
74-
print(\"\" if lock_is_fresh else \"Lock is stale, run 'poetry lock' to update the lock file.\"); \
75-
exit(0) if lock_is_fresh else exit(1)"
57+
run: poetry lock --check
7658
working-directory: ./ni_measurement_generator
7759
- uses: actions/cache@v2
7860
with:
@@ -95,7 +77,7 @@ jobs:
9577
with:
9678
python-version: ${{ matrix.python-version }}
9779

98-
- uses: Gr1N/setup-poetry@v4
80+
- uses: Gr1N/setup-poetry@v7
9981
with:
10082
poetry-version: ${{ env.POETRY_VERSION }}
10183
- uses: actions/cache@v2

.github/workflows/Publish_NIMG.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ concurrency: publish_to_pypi
88

99
env:
1010
# Versions are also listed in PR.yml
11-
POETRY_VERSION: 1.1.10
12-
PYTHON_VERSION: 3.8
11+
POETRY_VERSION: 1.2.2
12+
PYTHON_VERSION: 3.9
1313

1414
jobs:
1515
build:
@@ -20,18 +20,13 @@ jobs:
2020
- uses: actions/setup-python@v2
2121
with:
2222
python-version: ${{ env.PYTHON_VERSION }}
23-
- uses: Gr1N/setup-poetry@v4
23+
- uses: Gr1N/setup-poetry@v7
2424
with:
2525
poetry-version: ${{ env.POETRY_VERSION }}
26-
# @TODO: This is a workaround for there not being a way to check the lock file
27-
# See: https://github.com/python-poetry/poetry/issues/453
26+
2827
- name: Check for lock changes
29-
run: |
30-
PYTHONPATH="${PYTHONPATH}:${HOME}/.poetry/lib:${HOME}/.poetry/lib/poetry/_vendor/py${{ env.PYTHON_VERSION }}" \
31-
python -c "from poetry.factory import Factory; \
32-
locker = Factory().create_poetry('./ni_measurement_generator').locker; \
33-
exit(0) if locker.is_locked() and locker.is_fresh() else exit(1)" \
34-
&& echo 'OK'
28+
run: poetry lock --check
29+
3530
- uses: actions/cache@v2
3631
with:
3732
path: ~/.cache/pypoetry/virtualenvs

.github/workflows/Publish_NIMS.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ concurrency: publish_to_pypi
88

99
env:
1010
# Versions are also listed in PR.yml
11-
POETRY_VERSION: 1.1.10
12-
PYTHON_VERSION: 3.8
11+
POETRY_VERSION: 1.2.2
12+
PYTHON_VERSION: 3.9
1313

1414
jobs:
1515
build:
@@ -20,18 +20,13 @@ jobs:
2020
- uses: actions/setup-python@v2
2121
with:
2222
python-version: ${{ env.PYTHON_VERSION }}
23-
- uses: Gr1N/setup-poetry@v4
23+
- uses: Gr1N/setup-poetry@v7
2424
with:
2525
poetry-version: ${{ env.POETRY_VERSION }}
26-
# @TODO: This is a workaround for there not being a way to check the lock file
27-
# See: https://github.com/python-poetry/poetry/issues/453
26+
2827
- name: Check for lock changes
29-
run: |
30-
PYTHONPATH="${PYTHONPATH}:${HOME}/.poetry/lib:${HOME}/.poetry/lib/poetry/_vendor/py${{ env.PYTHON_VERSION }}" \
31-
python -c "from poetry.factory import Factory; \
32-
locker = Factory().create_poetry('.').locker; \
33-
exit(0) if locker.is_locked() and locker.is_fresh() else exit(1)" \
34-
&& echo 'OK'
28+
run: poetry lock --check
29+
3530
- uses: actions/cache@v2
3631
with:
3732
path: ~/.cache/pypoetry/virtualenvs

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ typed-ast = "*"
4444
mako = "*"
4545

4646
[build-system]
47-
requires = ["poetry-core>=1.0.0"]
47+
requires = ["poetry-core>=1.2.0"]
4848
build-backend = "poetry.core.masonry.api"
4949

5050
[tool.ni-python-styleguide]

0 commit comments

Comments
 (0)