Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Commit 4eb2d19

Browse files
authored
Hatch, doc updates and adapting to new aoe2.net api (endpoints removals)
2 parents 91298aa + aa540be commit 4eb2d19

31 files changed

+1334
-3168
lines changed

.github/workflows/coverage.yml

Lines changed: 18 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -13,79 +13,30 @@ on: # Runs on all push events to master branch and any push related to a pull r
1313

1414
jobs:
1515
coverage:
16-
name: ${{ matrix.os }} / ${{ matrix.python-version }}
17-
runs-on: ${{ matrix.os }}
18-
strategy:
19-
matrix: # only lowest supported python on ubuntu-latest
20-
os: [ubuntu-latest]
21-
python-version: [3.7]
16+
runs-on: ubuntu-latest
17+
env:
18+
python-version: 3.12
2219

2320
steps:
24-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2522

26-
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v2
23+
- name: Set up Python ${{ env.python-version }}
24+
uses: actions/setup-python@v5
2825
with:
29-
python-version: ${{ matrix.python-version }}
26+
python-version: ${{ env.python-version }}
27+
cache: 'pip'
28+
cache-dependency-path: '**/pyproject.toml'
3029

31-
- name: Get full Python version
32-
id: full-python-version
33-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
30+
- name: Upgrade pip
31+
run: python -m pip install --upgrade pip
3432

35-
- name: Install poetry
36-
uses: abatilo/actions-poetry@v2.1.0
37-
with:
38-
poetry-version: 1.1.4
39-
40-
- name: Configure Poetry
41-
run: |
42-
echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
43-
poetry config virtualenvs.in-project true
44-
45-
- name: Set up cache
46-
uses: actions/cache@v2
47-
id: cache
48-
with:
49-
path: .venv
50-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
51-
52-
- name: Ensure cache is healthy
53-
if: steps.cache.outputs.cache-hit == 'true'
54-
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
55-
56-
- name: Upgrade pip, setuptools and wheel
57-
run: poetry run python -m pip install --upgrade pip setuptools wheel
58-
59-
- name: Install dependencies
60-
run: poetry install -v -E dataframe
61-
62-
- name: Set up env for CodeClimate (push)
63-
run: |
64-
echo "GIT_BRANCH=$GITHUB_REF" >> $GITHUB_ENV
65-
echo "GIT_COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
66-
if: github.event_name == 'push'
67-
68-
- name: Set up env for CodeClimate (pull_request)
69-
env:
70-
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
71-
run: |
72-
echo "GIT_BRANCH=$GITHUB_HEAD_REF" >> $GITHUB_ENV
73-
echo "GIT_COMMIT_SHA=$PR_HEAD_SHA" >> $GITHUB_ENV
74-
if: github.event_name == 'pull_request'
75-
76-
- name: Prepare CodeClimate binary
77-
env:
78-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
79-
run: |
80-
curl -LSs 'https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64' >./cc-test-reporter;
81-
chmod +x ./cc-test-reporter
82-
./cc-test-reporter before-build
33+
- name: Install package with test dependencies
34+
run: python -m pip install ".[test]"
8335

8436
- name: Run all tests
85-
run: poetry run python -m pytest
37+
run: python -m pytest
8638

87-
- name: Push Coverage to CodeClimate
88-
if: ${{ success() }} # only if tests were successful
89-
env:
90-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
91-
run: ./cc-test-reporter after-build
39+
- name: Upload Coverage to Codecov
40+
uses: codecov/codecov-action@v4
41+
with:
42+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/cron.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,25 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
matrix:
18-
os: [ubuntu-18.04, ubuntu-20.04, macos-latest, windows-latest]
19-
python-version: [3.7, 3.8, 3.9] # crons should always run latest python hence 3.x
18+
os: [ubuntu-22.04, ubuntu-24.04, macos-latest, windows-latest]
19+
python-version: ["3.10", 3.11, 3.12, 3.x] # crons should always run latest python hence 3.x
20+
fail-fast: false
2021

2122
steps:
22-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2324

2425
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v2
26+
uses: actions/setup-python@v5
2627
with:
2728
python-version: ${{ matrix.python-version }}
29+
cache: 'pip'
30+
cache-dependency-path: '**/pyproject.toml'
2831

29-
- name: Get full Python version
30-
id: full-python-version
31-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
32+
- name: Upgrade pip
33+
run: python -m pip install --upgrade pip
3234

33-
- name: Set up cache
34-
uses: actions/cache@v2
35-
id: cache
36-
with:
37-
path: .venv
38-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
39-
40-
- name: Ensure cache is healthy
41-
if: steps.cache.outputs.cache-hit == 'true'
42-
run: pip --version >/dev/null 2>&1 || rm -rf .venv
43-
44-
- name: Install poetry
45-
uses: abatilo/actions-poetry@v2.1.0
46-
with:
47-
poetry-version: 1.1.4
48-
49-
- name: Configure Poetry
50-
run: |
51-
echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
52-
poetry config virtualenvs.in-project true
53-
54-
- name: Upgrade pip, setuptools and wheel
55-
run: poetry run python -m pip install --upgrade pip setuptools wheel
56-
57-
- name: Install dependencies
58-
run: poetry install -v -E dataframe
35+
- name: Install package with test dependencies
36+
run: python -m pip install ".[test]"
5937

6038
- name: Run Tests
61-
run: poetry run python -m pytest
39+
run: python -m pytest

.github/workflows/documentation.yml

Lines changed: 28 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,43 @@ on: # Runs on any push event to master
1212

1313
jobs:
1414
documentation:
15-
name: ${{ matrix.os }} / ${{ matrix.python-version }}
16-
runs-on: ${{ matrix.os }}
17-
strategy:
18-
matrix: # only lowest supported python on ubuntu-latest
19-
os: [ubuntu-latest]
20-
python-version: [3.7]
15+
runs-on: ubuntu-latest
16+
env:
17+
python-version: 3.12
2118

2219
steps:
23-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2421

25-
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
22+
- name: Set up Python ${{ env.python-version }}
23+
uses: actions/setup-python@v5
2724
with:
28-
python-version: ${{ matrix.python-version }}
25+
python-version: ${{ env.python-version }}
26+
cache: 'pip'
27+
cache-dependency-path: '**/pyproject.toml'
2928

30-
- name: Get full Python version
31-
id: full-python-version
32-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
29+
- name: Upgrade pip
30+
run: python -m pip install --upgrade pip
3331

34-
- name: Install poetry
35-
uses: abatilo/actions-poetry@v2.1.0
36-
with:
37-
poetry-version: 1.1.4
32+
- name: Install package with doc dependencies
33+
run: python -m pip install ".[docs]"
3834

39-
- name: Configure Poetry
40-
run: |
41-
echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
42-
poetry config virtualenvs.in-project true
35+
- name: Build documentation
36+
run: portray as_html -o doc_build
4337

44-
- name: Set up cache
45-
uses: actions/cache@v2
46-
id: cache
38+
# Upload artifacts if in PR so reviewers can have a quick look without building documentation from the branch locally
39+
- name: Upload build artifacts
40+
uses: actions/upload-artifact@v4
41+
if: success() && github.event_name == 'pull_request' # only for pushes in PR
4742
with:
48-
path: .venv
49-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
50-
51-
- name: Ensure cache is healthy
52-
if: steps.cache.outputs.cache-hit == 'true'
53-
run: pip --version >/dev/null 2>&1 || rm -rf .venv
54-
55-
- name: Upgrade pip, setuptools and wheel
56-
run: poetry run python -m pip install --upgrade pip setuptools wheel
57-
58-
- name: Install dependencies
59-
run: poetry install -v -E docs -E dataframe
60-
61-
- name: Build documentation
62-
run: poetry run portray as_html -o doc_build
43+
name: site-build
44+
path: doc_build
45+
retention-days: 5
6346

47+
# Upload the doc to github pages branch and publish if from a push to master
6448
- name: Upload documentation to gh-pages
65-
if: ${{ success() }}
66-
uses: JamesIves/github-pages-deploy-action@3.7.1
49+
if: success() && github.ref == 'refs/heads/master' # only for pushes to master
50+
uses: JamesIves/github-pages-deploy-action@v4
6751
with:
68-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
BRANCH: gh-pages
70-
FOLDER: doc_build
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
branch: gh-pages
54+
folder: doc_build

.github/workflows/publish.yml

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,22 @@ on: # Runs everytime a release is added to the repository
1111

1212
jobs:
1313
deploy:
14-
name: ${{ matrix.os }} / ${{ matrix.python-version }}
15-
runs-on: ${{ matrix.os }}
16-
strategy:
17-
matrix: # only lowest supported python on ubuntu-latest
18-
os: [ubuntu-latest]
19-
python-version: [3.7]
20-
14+
runs-on: ubuntu-latest
15+
env:
16+
python-version: 3.12
2117

2218
steps:
23-
- uses: actions/checkout@v2
24-
25-
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
27-
with:
28-
python-version: ${{ matrix.python-version }}
29-
30-
- name: Get full Python version
31-
id: full-python-version
32-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
33-
34-
- name: Install poetry
35-
uses: abatilo/actions-poetry@v2.1.0
36-
with:
37-
poetry-version: 1.1.4
19+
- uses: actions/checkout@v4
3820

39-
- name: Configure Poetry
40-
run: |
41-
echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
42-
poetry config virtualenvs.in-project true
43-
44-
- name: Set up cache
45-
uses: actions/cache@v2
46-
id: cache
47-
with:
48-
path: .venv
49-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
50-
51-
- name: Ensure cache is healthy
52-
if: steps.cache.outputs.cache-hit == 'true'
53-
run: pip --version >/dev/null 2>&1 || rm -rf .venv
54-
55-
- name: Upgrade pip, setuptools and wheel
56-
run: poetry run python -m pip install --upgrade pip setuptools wheel
21+
- name: Install hatch
22+
run: pipx install hatch
5723

5824
- name: Build wheels and sdist
59-
run: poetry build
25+
run: hatch build
6026

61-
- name: Publish package to PyPI
62-
if: ${{ success() }}
63-
env:
64-
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
65-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
66-
run: poetry publish -u "$PYPI_USERNAME" -p "$PYPI_PASSWORD"
27+
- name: Publish Python distribution to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
verbose: true
31+
print-hash: true
32+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/tests.yml

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,41 @@
1-
name: Tests
1+
# Runs all tests
2+
name: All Tests
23

34
defaults:
45
run:
56
shell: bash
67

7-
on: [push]
8+
on: # Runs on any push event to any branch except master (the coverage workflow takes care of that)
9+
push:
10+
branches-ignore:
11+
- 'master'
12+
813

914
jobs:
1015
tests:
1116
name: ${{ matrix.os }} / ${{ matrix.python-version }}
1217
runs-on: ${{ matrix.os }}
1318
strategy:
1419
matrix:
15-
os: [ubuntu-18.04, ubuntu-20.04, macos-latest, windows-latest]
16-
python-version: [3.7, 3.8, 3.9]
20+
os: [ubuntu-22.04, ubuntu-24.04, macos-latest, windows-latest]
21+
python-version: ["3.10", 3.11, 3.12]
22+
fail-fast: false
1723

1824
steps:
19-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
2026

2127
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v2
28+
uses: actions/setup-python@v5
2329
with:
2430
python-version: ${{ matrix.python-version }}
31+
cache: 'pip'
32+
cache-dependency-path: '**/pyproject.toml'
2533

26-
- name: Get full Python version
27-
id: full-python-version
28-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
29-
30-
- name: Install poetry
31-
uses: abatilo/actions-poetry@v2.1.0
32-
with:
33-
poetry-version: 1.1.4
34-
35-
- name: Configure Poetry
36-
run: |
37-
echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
38-
poetry config virtualenvs.in-project true
39-
40-
- name: Set up cache
41-
uses: actions/cache@v2
42-
id: cache
43-
with:
44-
path: .venv
45-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
46-
47-
- name: Ensure cache is healthy
48-
if: steps.cache.outputs.cache-hit == 'true'
49-
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
50-
51-
- name: Upgrade pip, setuptools and wheel
52-
run: poetry run python -m pip install --upgrade pip setuptools wheel
34+
- name: Upgrade pip
35+
run: python -m pip install --upgrade pip
5336

54-
- name: Install dependencies
55-
run: poetry install -v -E dataframe
37+
- name: Install package with test dependencies
38+
run: python -m pip install ".[test]"
5639

57-
- name: Run Tests
58-
run: poetry run python -m pytest
40+
- name: Run all tests
41+
run: python -m pytest

0 commit comments

Comments
 (0)