Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.0.0 #434

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/codeql_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# queries: security-extended,security-and-quality
- name: Setup Python
if: ${{ matrix.language == 'python' }}
uses: actions/setup-python@v5
Expand All @@ -36,7 +35,7 @@ jobs:
- name: Build Application using script
if: ${{ matrix.language == 'python' }}
run: |
python -m pip install --upgrade pip setuptools build
python -m pip install build
python -m build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
19 changes: 12 additions & 7 deletions .github/workflows/on_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
platform:
- ubuntu-latest
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand All @@ -31,7 +31,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -r requirements/base.txt -r requirements/ci.txt
python -m pip install -r requirements/base.txt -r requirements/style.txt
- name: Run flake8
run: |
flake8 src/ tests/
Expand All @@ -47,7 +47,7 @@ jobs:
matrix:
platform:
- ubuntu-latest
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand All @@ -59,20 +59,20 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -r requirements/base.txt -r requirements/test.txt
python -m pip install -r requirements/base.txt -r requirements/tests.txt
- name: Run py.test
run: |
py.test

run-tox:
name: Tox | Test, Style, Lint, Typing, Security and Docs
name: Tox | Test, Style, Lint, Typing, Pytype, Security and Docs
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
python-version: ["3.12"]
python-version: ["3.11", "3.12"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand All @@ -86,5 +86,10 @@ jobs:
run: |
python -m pip install --upgrade pip tox
- name: Run tox
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
run: |
tox -e py,py-async,style,typing,pytype,security,docs
tox -e py,py-async,style,typing,security,docs
- name: Run tox (Pytype)
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.11' }}
run: |
tox -e pytype
183 changes: 32 additions & 151 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@ on:
branches:
- master
- release/**
tags-ignore:
- v**

permissions:
contents: read

jobs:
lint:
name: Lint
run-tox:
name: Tox | Test, Style, Lint, Typing, Pytype, Security and Docs
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand All @@ -28,113 +30,20 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements/base.txt
pip install -r requirements/ci.txt
- name: Lint with Flake8
run: |
flake8 src/ tests/
- name: Lint with PyLint
run: |
pylint src/ tests/

pytype:
name: Typing
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
python-version: ["3.11"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements/base.txt
pip install -r requirements/ci.txt
- name: Static type check with Pytype
run: |
pytype

typing:
name: Typing
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
python-version: ["3.12"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements/base.txt
pip install -r requirements/ci.txt
- name: Static type check with MyPy
run: |
mypy --install-types --non-interactive src/

security:
name: Security
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- ubuntu-latest
python-version: ["3.12"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements/base.txt
pip install -r requirements/ci.txt
- name: Check security issue in code with Bandit
python -m pip install --upgrade pip tox
- name: Run tox
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
run: |
bandit -r src/
- name: Check dependencies for known security vulnerabilities with Safety
tox -e py,py-async,style,typing,security,docs
- name: Run tox (Pytype)
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.11' }}
run: |
safety check
tox -e pytype

test:
name: Test
needs: [lint, typing, security]
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
Expand All @@ -159,7 +68,7 @@ jobs:
run: |
pip install --upgrade pip
pip install -r requirements/base.txt
pip install -r requirements/test.txt
pip install -r requirements/tests.txt
- name: Test and and run coverage with PyTest
run: |
py.test
Expand All @@ -170,6 +79,7 @@ jobs:
name: test-n-coverage-report
path: |
.coverage
coverage.lcov
junit/
htmlcov/

Expand All @@ -184,34 +94,21 @@ jobs:
- ubuntu-latest
python-version: ["3.12"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements/test.txt
- name: Download a coverage artifact
uses: actions/download-artifact@v4
with:
name: test-n-coverage-report
- name: Send coverage stats to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
format: lcov
file: coverage.lcov
allow-empty: true

build:
name: Build source
needs: coverage
needs: [run-tox, coverage]
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
Expand All @@ -232,19 +129,16 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Build source and wheel distributions
run: |
python -m pip install --upgrade pip setuptools build
python -m pip install build
python -m build --outdir dist-${{ matrix.platform }}-${{ matrix.python-version }}
- name: Tar build and wheel distributions files
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
run: |
mv dist-${{ matrix.platform }}-${{ matrix.python-version }} dist
tar -cvf dist.tar dist
tar -cvf dist-${{ matrix.platform }}-${{ matrix.python-version }}.tar dist-${{ matrix.platform }}-${{ matrix.python-version }}
- name: Upload build and wheel distributions files
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
uses: actions/upload-artifact@v4
with:
name: pre-release-build
path: dist.tar
name: pre-release-build-${{ matrix.platform }}-${{ matrix.python-version }}
path: dist-${{ matrix.platform }}-${{ matrix.python-version }}.tar

publish-testpypi:
name: Publish to TestPyPI
Expand All @@ -270,30 +164,17 @@ jobs:
- name: Download build and wheel distributions files
uses: actions/download-artifact@v4
with:
name: pre-release-build
name: pre-release-build-${{ matrix.platform }}-${{ matrix.python-version }}
- name: Build source and wheel distributions to version ${{ github.ref_name }}
run: |
python -m pip install --upgrade pip setuptools twine
tar -xvf dist.tar
twine check --strict dist/*
python -m pip install twine
tar -xvf dist-${{ matrix.platform }}-${{ matrix.python-version }}.tar
twine check --strict dist-${{ matrix.platform }}-${{ matrix.python-version }}/*
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.8.11
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
# - name: Create GitHub Pre Release
# id: create_release
# uses: softprops/action-gh-release@v1
# with:
# name: ${{ github.ref_name }}
# draft: false
# prerelease: true
# generate_release_notes: true
# files: |
# COPYING
# LICENSE
# AUTHORS
# README.md
# dist/*
repository-url: https://test.pypi.org/legacy/
packages-dir: dist-${{ matrix.platform }}-${{ matrix.python-version }}/
skip-existing: true
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Build source and wheel distributions to version ${{ github.ref_name }}
run: |
python -m pip install --upgrade pip setuptools build twine
python -m pip install build twine
python -m build
twine check --strict dist/*
- name: Publish distribution to PyPI
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Tests
name: Tests [Docker]

on:
push:
branches: ["master"]
branches:
- master
- release/**
tags-ignore:
- v**
pull_request:
branches: ["master"]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ htmlcov/
.nox/
.coverage
.coverage.*
coverage.*
.cache
nosetests.xml
coverage.xml
Expand Down
Loading
Loading