Skip to content

Commit 8905e2e

Browse files
committed
Updated to Python 3.9, upgraded dependencies, and adjusted Makefile for Poetry 2.1.2.
Also disabled MSSSQL tests.
1 parent 9265902 commit 8905e2e

7 files changed

Lines changed: 1463 additions & 1506 deletions

File tree

.github/workflows/github-actions.yml

Lines changed: 13 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,12 @@
11
name: CI
22
on: [push, pull_request]
33

4-
env:
5-
POETRY_HOME: /home/runner/.local
6-
POETRY_CACHE_DIR: /home/runner/.local/.cache
7-
84
jobs:
9-
prepare:
10-
strategy:
11-
fail-fast: false
12-
matrix:
13-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
14-
sqlalchemy-version: ["<2.0", "default"]
15-
os: [ubuntu-20.04]
16-
runs-on: ${{ matrix.os }}
17-
steps:
18-
- uses: actions/checkout@v4
19-
- uses: actions/setup-python@v5
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
- name: Set up cache
23-
id: cached-dependencies
24-
uses: actions/cache@v4
25-
with:
26-
path: /home/runner/.local
27-
key: os-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ matrix.sqlalchemy-version }}-${{ hashFiles('**/poetry.lock') }}-poetry-1.6.1
28-
- name: Install and set up Poetry
29-
if: steps.cached-dependencies.outputs.cache-hit != 'true'
30-
run: make install-poetry
31-
- name: Install packages
32-
if: steps.cached-dependencies.outputs.cache-hit != 'true'
33-
run: make install-packages opts="--no-root"
34-
- name: Downgrade SQLAlchemy
35-
if: ${{ matrix.sqlalchemy-version != 'default' }}
36-
run: poetry run pip install -U "sqlalchemy${{ matrix.sqlalchemy-version }}"
37-
- name: Downgrade Flask-SQLAlchemy
38-
if: ${{ matrix.sqlalchemy-version != 'default' }}
39-
run: poetry run pip install -U "flask-sqlalchemy<3.1"
40-
41-
lint:
42-
strategy:
43-
fail-fast: false
44-
matrix:
45-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
46-
sqlalchemy-version: ["<2.0", "default"]
47-
os: [ubuntu-20.04]
48-
runs-on: ${{ matrix.os }}
49-
needs: prepare
50-
steps:
51-
- uses: actions/checkout@v4
52-
- uses: actions/setup-python@v5
53-
with:
54-
python-version: ${{ matrix.python-version }}
55-
- name: Set up cache
56-
uses: actions/cache@v4
57-
with:
58-
path: /home/runner/.local
59-
key: os-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ matrix.sqlalchemy-version }}-${{ hashFiles('**/poetry.lock') }}-poetry-1.6.1
60-
- name: Lint
61-
run: make lint
62-
63-
tests:
64-
needs: prepare
5+
lint-and-test:
656
strategy:
667
fail-fast: false
678
matrix:
68-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
9+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
6910
sqlalchemy-version: ["<2.0", "default"]
7011
os: [ubuntu-20.04]
7112
runs-on: ${{ matrix.os }}
@@ -88,13 +29,16 @@ jobs:
8829
- uses: actions/setup-python@v5
8930
with:
9031
python-version: ${{ matrix.python-version }}
91-
92-
- name: Set up cache
93-
uses: actions/cache@v4
94-
with:
95-
path: /home/runner/.local
96-
key: os-${{ matrix.os }}-python-${{ matrix.python-version }}-${{matrix.sqlalchemy-version }}-${{ hashFiles('**/poetry.lock') }}-poetry-1.6.1
97-
32+
- name: Install and set up Poetry
33+
run: make install-poetry
34+
- name: Install packages
35+
run: make install
36+
- name: Downgrade SQLAlchemy
37+
run: poetry@2.1.2 run pip install -U "sqlalchemy${{ matrix.sqlalchemy-version }}"
38+
- name: Downgrade Flask-SQLAlchemy
39+
run: poetry@2.1.2 run pip install -U "flask-sqlalchemy<3.1"
40+
- name: Lint
41+
run: make lint
9842
- name: Setup PostgreSQL database
9943
run: |
10044
PGPASSWORD=postgres psql -c 'CREATE DATABASE eventsourcing_sqlalchemy;' -U postgres -h localhost
@@ -113,7 +57,7 @@ jobs:
11357
make create-mssql-schema
11458
11559
- name: Print SQLAlchemy version
116-
run: poetry run python -c "import sqlalchemy; print(f'Using sqlalchemy {sqlalchemy.__version__}')"
60+
run: poetry@2.1.2 run python -c "import sqlalchemy; print(f'Using sqlalchemy {sqlalchemy.__version__}')"
11761

11862
- name: Run tests
11963
run: make test

Makefile

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
COMPOSE_FILE ?= docker/docker-compose-local.yml
44
COMPOSE_PROJECT_NAME ?= eventsourcing_sqlalchemy
55

6-
POETRY_VERSION = 1.6.1
7-
POETRY ?= poetry
6+
POETRY_VERSION=2.1.2
7+
POETRY ?= poetry@$(POETRY_VERSION)
88

99
DOTENV_BASE_FILE ?= .env-base
1010
DOTENV_LOCAL_FILE ?= .env
@@ -16,32 +16,27 @@ POETRY_INSTALLER_URL ?= https://install.python-poetry.org
1616

1717
.PHONY: install-poetry
1818
install-poetry:
19-
curl -sSL $(POETRY_INSTALLER_URL) | python3
19+
@pipx install --suffix="@$(POETRY_VERSION)" "poetry==$(POETRY_VERSION)"
2020
$(POETRY) --version
2121

22-
.PHONY: install-packages
23-
install-packages:
24-
$(POETRY) install -vv $(opts)
25-
26-
.PHONY: install-pre-commit-hooks
27-
install-pre-commit-hooks:
28-
ifeq ($(opts),)
29-
$(POETRY) run pre-commit install
30-
endif
31-
32-
.PHONY: uninstall-pre-commit-hooks
33-
uninstall-pre-commit-hooks:
34-
ifeq ($(opts),)
35-
$(POETRY) run pre-commit uninstall
36-
endif
37-
38-
.PHONY: lock-packages
39-
lock-packages:
40-
$(POETRY) lock -vv --no-update
41-
42-
.PHONY: update-packages
43-
update-packages:
44-
$(POETRY) update -vv
22+
.PHONY: poetry-version
23+
poetry-version:
24+
$(POETRY) --version
25+
26+
.PHONY: python-version
27+
python-version:
28+
$(POETRY) run python --version
29+
30+
.PHONY: install
31+
install:
32+
$(POETRY) sync --all-extras $(opts)
33+
34+
.PHONY: update
35+
update: update-lock install
36+
37+
.PHONY: update-lock
38+
update-lock:
39+
$(POETRY) update --lock -v
4540

4641
.PHONY: docker-up
4742
docker-up:

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[mypy]
2-
python_version = 3.8
2+
python_version = 3.9
33
files = eventsourcing_sqlalchemy,tests
44

55
check_untyped_defs = True

0 commit comments

Comments
 (0)