Skip to content

Commit 7b85243

Browse files
authored
CI test for minimal python & deps versions support (#827)
Hi, could you please review proposal to have a CI test against checking the minimal support python and deps version can pass the test suite. It fixes #826. The job is expected to fail the first time it runs, because attrs minimal version of 20.1.0 fails to bootstrap the tests, which is also proving the point of this patch. It will subsequently be corrected to the next available version which will pass the test. Thanks --------- Co-authored-by: ikappaki <[email protected]>
1 parent 5fbfc29 commit 7b85243

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

.github/workflows/run-tests.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,61 @@ jobs:
7777
name: code-coverage
7878
path: coverage/.coverage.py*
7979

80+
min-deps-test:
81+
# Attempt to run the TOX-ENV tests for the given OS and python
82+
# VERSION with the minimal possible Basilisp dependencies
83+
# versions.
84+
#
85+
# For dependencies to be elligible for minimum version testing,
86+
# they should be declared in `pyproject.toml` as such in the
87+
# following format
88+
#
89+
# <dependency-name> = "^..."
90+
# <dependency-name> = ">=..."
91+
# <dependency-name> = { version = "^..." ...
92+
# <dependency-name> = { version = ">=..." ...
93+
runs-on: ${{matrix.os}}
94+
strategy:
95+
matrix:
96+
os: [ubuntu-latest]
97+
version: ['3.8']
98+
tox-env: ['py38']
99+
steps:
100+
- uses: actions/checkout@v3
101+
- uses: actions/setup-python@v4
102+
with:
103+
python-version: ${{ matrix.version }}
104+
- name: Cache dependencies
105+
id: cache-deps
106+
uses: actions/cache@v3
107+
with:
108+
path: |
109+
.tox
110+
~/.cache/pip
111+
~/.cache/pypoetry
112+
~/.local/share/pypoetry
113+
key: mdt-${{ runner.os }}-python-${{ matrix.version }}-poetry-${{ hashFiles('pyproject.toml', 'tox.ini') }}
114+
- name: Install Poetry
115+
if: steps.cache-deps.outputs.cache-hit != 'true'
116+
run: curl -sSL https://install.python-poetry.org | python3 -
117+
- name: Install Tox
118+
run: |
119+
pip install -U pip
120+
pip install tox
121+
- name: Run minimum deps test
122+
env:
123+
TOX_PARALLEL_NO_SPINNER: 1
124+
TOX_SHOW_OUTPUT: "True"
125+
TOXENV: ${{ matrix.tox-env }}
126+
run: |
127+
poetry lock
128+
DEPENDENCY_REGEX="$(poetry show -T --without=dev | awk '{print $1}' | paste -s -d '|' -)"
129+
[[ -z "$DEPENDENCY_REGEX" ]] && { echo "Error: can't source dependencies" ; exit 1; }
130+
echo ::deps $DEPENDENCY_REGEX
131+
sed -i -E 's/('$DEPENDENCY_REGEX')( = )(|\{ version = )"(\^|>=)([0-9])/\1\2\3"==\5/' pyproject.toml
132+
git diff
133+
tox run-parallel -p 2
134+
80135
report-coverage:
81136
runs-on: ubuntu-latest
82137
needs: run-tests

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
* Make `pr` a dynamic variable (#820)
2929
* Emit OS specific line endings for the `println` and `prn` fns (#810)
3030
* Support any character in character literals (#816)
31+
* Loosen `typing-extensions` dependency's minimal version to 4.7.0 (#809)
3132

3233
### Fixed
3334
* Fix issue with `(count nil)` throwing an exception (#759)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ include = ["README.md", "LICENSE"]
3131

3232
[tool.poetry.dependencies]
3333
python = "^3.8"
34-
attrs = ">=20.1.0"
34+
attrs = ">=20.2.0"
3535
immutables = ">=0.20,<1.0.0"
3636
prompt-toolkit = "^3.0.0"
3737
pyrsistent = ">=0.18.0,<1.0.0"
3838
python-dateutil = "^2.8.1"
3939
readerwriterlock = "^1.0.8"
40-
typing_extensions = "^4.9.0"
40+
typing-extensions = "^4.7.0"
4141

4242
astor = { version = "^0.8.1", python = "<3.9", optional = true }
4343
pytest = { version = "^7.0.0", optional = true }

0 commit comments

Comments
 (0)