Skip to content

Commit 0ca4ef3

Browse files
committed
Mod python_requires= >=3.11
1 parent f3bda1b commit 0ca4ef3

File tree

10 files changed

+120
-19
lines changed

10 files changed

+120
-19
lines changed

.flake8

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
lint-and-unit:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.11", "3.12", "3.13"]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
cache: pip
27+
cache-dependency-path: |
28+
requirements.txt
29+
requirements-dev.txt
30+
setup.py
31+
pyproject.toml
32+
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -r requirements-dev.txt
37+
pip install -e .
38+
39+
- name: Ruff
40+
run: ruff check .
41+
42+
- name: Unit tests
43+
run: pytest -q
44+
45+
integration:
46+
runs-on: ubuntu-latest
47+
needs: lint-and-unit
48+
49+
services:
50+
core:
51+
image: datarhei/core:latest
52+
ports:
53+
- 8080:8080
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
59+
- name: Set up Python
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: "3.11"
63+
cache: pip
64+
cache-dependency-path: |
65+
requirements.txt
66+
requirements-dev.txt
67+
setup.py
68+
pyproject.toml
69+
70+
- name: Install dependencies
71+
run: |
72+
python -m pip install --upgrade pip
73+
pip install -r requirements-dev.txt
74+
pip install -e .
75+
76+
- name: Wait for Core
77+
run: |
78+
for i in {1..60}; do
79+
if curl -fsS http://127.0.0.1:8080/api > /dev/null; then
80+
exit 0
81+
fi
82+
sleep 1
83+
done
84+
echo "Core service not ready in time"
85+
exit 1
86+
87+
- name: Integration tests (no cluster)
88+
env:
89+
RUN_INTEGRATION_TESTS: "1"
90+
CORE_URL: "http://127.0.0.1:8080"
91+
run: pytest -q tests

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ repos:
1717
rev: 22.3.0
1818
hooks:
1919
- id: black
20-
args: ["--line-length=79"]
2120

22-
- repo: https://github.com/pycqa/flake8
23-
rev: 4.0.1
21+
- repo: local
2422
hooks:
25-
- id: flake8
26-
args: ["--max-line-length=79", "--ignore=E203,E501,W503", "--exclude=.git,__pycache__,__init__.py,.mypy_cache,.pytest_cache"]
23+
- id: ruff
24+
name: ruff
25+
entry: ruff check
26+
language: system
27+
types: [python]
2728

2829
- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit
2930
rev: v1.0.5
@@ -41,7 +42,7 @@ repos:
4142
rev: v2.29.0
4243
hooks:
4344
- id: pyupgrade
44-
args: [--py37-plus]
45+
args: [--py311-plus]
4546
- repo: https://github.com/jorisroovers/gitlint
4647
rev: v0.16.0
4748
hooks:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Changelog
1818
- Mod `process_config` model (scheduler, runtime_duration_seconds)
1919
- Mod `v3_process_get_report` is now `v3_report_get_process_list`
2020
- Fix `v3_process_put_command` model
21+
- Drop Python `3.7`-`3.10` support, require Python `3.11+` (tested up to `3.13`)
22+
- Add Ruff lint integration and replace Flake8 in pre-commit
2123

2224
Breaking changes:
2325
- `v3_process_get_report` is now `v3_process_get_report_list`

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ release: dist
2828
twine upload dist/*
2929

3030
lint:
31+
ruff check .
3132
SKIP=no-commit-to-branch pre-commit run -a -v

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# datarhei MediaCore Python Client
22
For rapid development of Python applications around [datarhei Core](https://github.com/datarhei/core) / MediaCore.
3-
Requires Python 3.7+ and datarhei Core v16.10+.
3+
Requires Python 3.11+ and datarhei Core v16.10+.
44

55
---
66

@@ -830,7 +830,7 @@ $ CORE_URL=http://127.0.0.1:8080 \
830830

831831
#### Docker
832832
```sh
833-
$ docker build --build-arg PYTHON_VERSION=3.7 \
833+
$ docker build --build-arg PYTHON_VERSION=3.11 \
834834
-f tests/Dockerfile -t core_test .
835835

836836
$ docker run -it --rm \
@@ -841,9 +841,10 @@ $ docker run -it --rm \
841841
### Code checks
842842

843843
```sh
844+
$ ruff check .
844845
$ pre-commit run --all-files
845846
```
846-
*Requires `pip install pre-commit`.*
847+
*Requires `pip install -r requirements-dev.txt`.*
847848

848849
## Changelog
849850

pyproject.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
[tool.black]
22
line-length = 110
3-
target-version = ['py310']
3+
target-version = ['py311']
44

55
[tool.isort]
66
profile = 'black'
77
line_length = 110
88
force_alphabetical_sort_within_sections = true
99
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
1010
default_section = "THIRDPARTY"
11+
12+
[tool.ruff]
13+
line-length = 110
14+
target-version = "py311"
15+
exclude = [".git", "__pycache__", ".mypy_cache", ".pytest_cache"]
16+
17+
[tool.ruff.lint]
18+
select = ["E", "F", "W"]
19+
ignore = ["E203", "E501", "F401", "F811", "W292", "W293"]

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pre-commit
44
pytest
55
pytest-asyncio
66
pytest-cov
7+
ruff

setup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,18 @@
1515

1616
setup(
1717
name="datarhei-mediacore-client",
18-
version="2.0.0",
18+
version="16.20.0",
1919
url="https://github.com/datarhei/core-client-python",
2020
description="datarhei MediaCore Python client",
2121
author="FOSS GmbH",
2222
author_email="support@datarhei.com",
2323
classifiers=[
24-
"Programming Language :: Python :: 3.7",
25-
"Programming Language :: Python :: 3.8",
26-
"Programming Language :: Python :: 3.9",
27-
"Programming Language :: Python :: 3.10",
2824
"Programming Language :: Python :: 3.11",
2925
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
3027
"Topic :: datarhei Core Development :: Libraries",
3128
],
29+
python_requires=">=3.11",
3230
keywords="datarhei mediacore core rest client http httpx asyncio pydantic",
3331
packages=find_packages(exclude=["tests*"]),
3432
setup_requires=["pytest-runner"],

tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PYTHON_VERSION=3.7
1+
ARG PYTHON_VERSION=3.11
22

33
FROM python:${PYTHON_VERSION}-alpine
44

0 commit comments

Comments
 (0)