Skip to content

Commit

Permalink
Version 3.0.0 (#434)
Browse files Browse the repository at this point in the history
* Add GitHub Action for coveralls

* Version 3.0.0

* Add support to Python 3.12 (#431)
* Drop support to Python 3.7
* Bump Flask version to >=3.0.0
* Bump JQuery version from 1.8.1 to 3.7.1 (fix security issue)
* Bump several dependencies versions
* Migrate configuration to pyproject.toml
* Reorganizze requirements files
* Remove flask_jsonrpc.__version__ attribute in favor to pyproject.toml version attribute
* Add multi Python version on update workflow (#332)
* Add new param to allow/disallow JSON-RPC Notification (#385)
* Unified API Browser when using modular server (#391)
* Add tests to all Python versions supported by the project (#395)
* Add e2e tests to Web Browsable API (#401)
* Goodbye Python 3.6 (#404)
* Add support to Python 3.11 (#408)
* Add rpc.describe RPC method: JSON Schema Service Descriptor (#412)
* Project links fixed (#429)
  • Loading branch information
nycholas authored Jan 19, 2024
1 parent 473103b commit 4abceb1
Show file tree
Hide file tree
Showing 24 changed files with 95 additions and 215 deletions.
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

0 comments on commit 4abceb1

Please sign in to comment.