Skip to content

Commit 260eef5

Browse files
Add Python 3.13 support & drop python 3.8 & upgrade package version (#314)
1 parent 563fb26 commit 260eef5

File tree

107 files changed

+709
-7207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+709
-7207
lines changed

.github/workflows/docker.yml

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

.github/workflows/docs.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,58 @@
1-
name: build-docs
1+
name: Build Documentation
2+
23
on:
34
push:
45
tags:
56
- "**"
7+
8+
env:
9+
PYTHON_VERSION: "3.13"
10+
611
jobs:
712
build:
13+
name: Build and deploy documentation
814
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: write
18+
pages: write
19+
id-token: write
20+
921
steps:
10-
- uses: actions/checkout@v3.5.3
11-
- uses: actions/setup-python@v4.6.1
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up Python ${{ env.PYTHON_VERSION }}
28+
uses: actions/setup-python@v5
1229
with:
13-
python-version: "3.12"
14-
architecture: "x64"
30+
python-version: ${{ env.PYTHON_VERSION }}
31+
architecture: x64
32+
cache: 'pip'
1533

16-
- name: Install Dependencies
34+
- name: Cache pip dependencies
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.cache/pip
38+
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/pyproject.toml') }}
39+
restore-keys: |
40+
${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-
41+
42+
- name: Install dependencies
1743
run: |
1844
python -m pip install --upgrade pip
1945
python -m pip install .[docs]
2046
21-
- name: Build Docs
47+
- name: Configure Git
2248
run: |
2349
git config --local user.email "hakancelikdev@gmail.com"
2450
git config --local user.name "Hakan Celik"
25-
git fetch --all
26-
mike deploy ${{github.ref_name}} latest --update-aliases --push
51+
52+
- name: Fetch all branches
53+
run: git fetch --all
54+
55+
- name: Deploy documentation
56+
run: |
57+
mike deploy ${{ github.ref_name }} latest --update-aliases --push
58+
timeout-minutes: 10

.github/workflows/pre-commit.yml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
1-
name: pre-commit
1+
name: Pre-commit Checks
22
on: [push, pull_request]
3+
4+
env:
5+
PYTHON_VERSION: "3.13"
6+
37
jobs:
4-
run:
8+
pre-commit:
9+
name: Run pre-commit checks
510
runs-on: ubuntu-latest
11+
612
steps:
7-
- uses: actions/checkout@v3.5.3
8-
- uses: actions/setup-python@v4.6.1
9-
- name: Install dependencies for pre-commit
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up Python ${{ env.PYTHON_VERSION }}
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ env.PYTHON_VERSION }}
22+
architecture: x64
23+
cache: 'pip'
24+
25+
- name: Cache pip dependencies
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.cache/pip
29+
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/pyproject.toml') }}
30+
restore-keys: |
31+
${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-
32+
33+
- name: Install dependencies
1034
run: |
1135
python -m pip install --upgrade pip
1236
python -m pip install tox
13-
- name: pre-commit
14-
run: |
15-
tox -e pre-commit
37+
38+
- name: Run pre-commit checks
39+
run: tox -e pre-commit
40+
timeout-minutes: 10

.github/workflows/pypi.yml

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,91 @@
1-
name: publish-package-on-pypi
1+
name: Publish to PyPI
2+
23
on:
34
push:
45
tags:
56
- "**"
7+
8+
env:
9+
PYTHON_VERSION: "3.13"
10+
611
jobs:
712
test:
13+
name: Test package build
814
runs-on: ubuntu-latest
15+
916
steps:
10-
- uses: actions/checkout@v3.5.3
11-
- uses: actions/setup-python@v4.6.1
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ env.PYTHON_VERSION }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ env.PYTHON_VERSION }}
24+
architecture: x64
25+
cache: 'pip'
26+
27+
- name: Cache pip dependencies
28+
uses: actions/cache@v4
1229
with:
13-
python-version: "3.12"
14-
architecture: "x64"
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/pyproject.toml') }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-
1534
16-
- name: Install Dependencies
35+
- name: Install dependencies
1736
run: |
1837
python -m pip install --upgrade pip
1938
python -m pip install --upgrade build
2039
21-
- run: python -m build
22-
- name: Publish package to TestPyPI
40+
- name: Build package
41+
run: python -m build
42+
timeout-minutes: 5
43+
44+
- name: Publish to TestPyPI
2345
uses: pypa/gh-action-pypi-publish@release/v1
2446
with:
2547
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
2648
repository_url: https://test.pypi.org/legacy/
2749
verbose: true
50+
skip_existing: true
2851

2952
publish:
53+
name: Publish to PyPI
3054
runs-on: ubuntu-latest
55+
needs: test
56+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
57+
3158
steps:
32-
- uses: actions/checkout@v3.5.3
33-
- uses: actions/setup-python@v4.6.1
59+
- name: Checkout code
60+
uses: actions/checkout@v4
61+
62+
- name: Set up Python ${{ env.PYTHON_VERSION }}
63+
uses: actions/setup-python@v5
3464
with:
35-
python-version: "3.12"
36-
architecture: "x64"
65+
python-version: ${{ env.PYTHON_VERSION }}
66+
architecture: x64
67+
cache: 'pip'
3768

38-
- name: Install Dependencies
69+
- name: Cache pip dependencies
70+
uses: actions/cache@v4
71+
with:
72+
path: ~/.cache/pip
73+
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/pyproject.toml') }}
74+
restore-keys: |
75+
${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-
76+
77+
- name: Install dependencies
3978
run: |
4079
python -m pip install --upgrade pip
4180
python -m pip install --upgrade build
4281
43-
- run: python -m build
44-
- name: Publish a Python distribution to PyPI
82+
- name: Build package
83+
run: python -m build
84+
timeout-minutes: 5
85+
86+
- name: Publish to PyPI
4587
uses: pypa/gh-action-pypi-publish@release/v1
4688
with:
4789
password: ${{ secrets.PYPI_API_TOKEN }}
4890
verbose: true
91+
skip_existing: true

.github/workflows/test.yml

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,90 @@
1-
name: test
1+
name: Test
2+
23
on: [push, pull_request]
4+
5+
env:
6+
PYTHON_VERSION: "3.13"
7+
38
jobs:
49
test:
10+
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
511
runs-on: ${{ matrix.os }}
612
strategy:
13+
fail-fast: false
714
matrix:
815
os: [ubuntu-latest, macos-latest, windows-latest]
9-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
16+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
17+
1018
steps:
11-
- uses: actions/checkout@v3.5.3
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
1223

13-
- name: Set up Python${{ matrix.python-version }}
14-
uses: actions/setup-python@v4.6.1
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
1526
with:
1627
python-version: ${{ matrix.python-version }}
17-
architecture: x64
28+
architecture: ${{ matrix.os == 'macos-latest' && matrix.python-version >= '3.11' && 'x64' || matrix.os != 'macos-latest' && 'x64' || '' }}
29+
cache: 'pip'
1830

19-
- name: Install Dependencies for Python${{ matrix.python-version }}
31+
- name: Cache pip dependencies
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.cache/pip
35+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
36+
restore-keys: |
37+
${{ runner.os }}-pip-${{ matrix.python-version }}-
38+
39+
- name: Install dependencies
2040
run: |
2141
python -m pip install --upgrade pip
2242
python -m pip install tox
2343
24-
- name: Test with pytest for Python${{ matrix.python-version }}
25-
run: |
26-
tox -e ${{ matrix.python-version }}
44+
- name: Run tests with tox
45+
run: tox -e ${{ matrix.python-version }}
46+
timeout-minutes: 10
2747

2848
coverage:
49+
name: Generate coverage report
2950
runs-on: ubuntu-latest
51+
needs: test
52+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
53+
3054
steps:
31-
- uses: actions/checkout@v3.5.3
55+
- name: Checkout code
56+
uses: actions/checkout@v4
3257

33-
- name: Set up Python${{ matrix.python-version }}
34-
uses: actions/setup-python@v4.6.1
58+
- name: Set up Python ${{ env.PYTHON_VERSION }}
59+
uses: actions/setup-python@v5
3560
with:
36-
python-version: ${{ matrix.python-version }}
61+
python-version: ${{ env.PYTHON_VERSION }}
3762
architecture: x64
63+
cache: 'pip'
64+
65+
- name: Cache pip dependencies
66+
uses: actions/cache@v4
67+
with:
68+
path: ~/.cache/pip
69+
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/pyproject.toml') }}
70+
restore-keys: |
71+
${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-
3872
39-
- name: Install Dependencies
73+
- name: Install dependencies
4074
run: |
4175
python -m pip install --upgrade pip
4276
python -m pip install .[test]
4377
4478
- name: Generate coverage report
4579
run: |
46-
python -m pytest --cov=./ --cov-report=xml
80+
python -m pytest --cov=./ --cov-report=xml --cov-report=html
81+
timeout-minutes: 5
4782

4883
- name: Upload coverage to Codecov
49-
uses: codecov/codecov-action@v1.0.14
84+
uses: codecov/codecov-action@v4
5085
with:
51-
token: ${{secrets.CODECOV_TOKEN }}
86+
token: ${{ secrets.CODECOV_TOKEN }}
87+
file: ./coverage.xml
88+
flags: unittests
89+
name: codecov-umbrella
90+
fail_ci_if_error: false

0 commit comments

Comments
 (0)