mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 09:36:48 +03:00
a5166bf591
* Add Python 3.12 Support (#752) * Ignore .vscode * Python 3.12 Support * Change base python to 3.12 and pin pydantic to V1 * all tests passed * ci: change default python to 3.12 * remove legacy python versions * annotate pydantic models for tests * Update publishing pipeline to use Python 3.12 * Test environment updates * Update Cython to the latest prior 3.0 version and remove tracing from CI/CD * Give up using editable tox installation in the coverage job * Add mypy test fixes * Remove tracing from the coverage job * Fix typing test * Remove PyPy 2.7 * Fix typing test * Fix the typing issue with pydantic * Remove pypy 3.9 * Fix the typing issue with mypy * Update pydantic version to the latest from 1.x * Update scipy deprecation warning filter * Fix the tox job running coveralls * Update changelog --------- Co-authored-by: Anton Petrov <anton.a.petrov@gmail.com>
126 lines
3.3 KiB
YAML
126 lines
3.3 KiB
YAML
name: Publishing
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
name: Run tests
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.12
|
|
- run: pip install tox
|
|
- run: tox
|
|
env:
|
|
TOXENV: 3.12
|
|
|
|
linters:
|
|
name: Run linters
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
matrix:
|
|
toxenv: [flake8, pydocstyle, mypy, pylint]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.12
|
|
- run: pip install tox
|
|
- run: tox
|
|
env:
|
|
TOXENV: ${{ matrix.toxenv }}
|
|
|
|
build-sdist:
|
|
name: Build source tarball
|
|
needs: [tests, linters]
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.12
|
|
- run: python setup.py sdist
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
path: ./dist/*
|
|
|
|
build-wheels:
|
|
name: Build wheels
|
|
needs: [tests, linters]
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-22.04, windows-2019, macos-11]
|
|
env:
|
|
CIBW_SKIP: cp27-win*
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v2.11.3
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
path: ./wheelhouse/*.whl
|
|
|
|
build-wheels-linux-aarch64:
|
|
name: Build wheels (ubuntu-22.04-aarch64)
|
|
needs: [tests, linters]
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up QEMU
|
|
if: runner.os == 'Linux'
|
|
uses: docker/setup-qemu-action@v2
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v2.11.3
|
|
env:
|
|
CIBW_ARCHS_LINUX: aarch64
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
path: ./wheelhouse/*.whl
|
|
|
|
publish:
|
|
name: Publish on PyPI
|
|
needs: [build-sdist, build-wheels, build-wheels-linux-aarch64]
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: artifact
|
|
path: dist
|
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
# For publishing to Test PyPI, uncomment next two lines:
|
|
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
# repository_url: https://test.pypi.org/legacy/
|
|
|
|
publish-docs:
|
|
name: Publish docs
|
|
needs: [publish]
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.12
|
|
- run: pip install -r requirements-doc.txt
|
|
- run: pip install awscli
|
|
- run: pip install -e .
|
|
- run: (cd docs && make clean html)
|
|
- run: |
|
|
aws s3 sync docs/_build/html s3://python-dependency-injector-docs --delete
|
|
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --path "/*" > /dev/null
|
|
echo "Cache invalidation triggered"
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
|