diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b0f596..f384b14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,54 +2,23 @@ name: CI on: schedule: - - cron: 00 00 * * 1 # run every Monday at 00:00 + - cron: 00 00 * * 1 # Run every Monday at 00:00 push: - branches: - - main - tags: - - v[0-9]+.[0-9]+.[0-9]+ + branches: [main] pull_request: - branches: - - main + branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - uses: actions/cache@v3 - with: - path: ~/.cache/pre-commit - key: precommit-${{ env.pythonLocation }}-${{ hashFiles('**/.pre-commit-config.yaml') }} - - - name: Install dependencies - run: | - sudo apt-get update -y - sudo apt install libenchant-2-dev pandoc - python -m pip install --upgrade pip - python -m pip install tox - - - name: Linting - run: | - tox -e lint,check-docs,readme - test: runs-on: ${{ matrix.os }} strategy: fail-fast: false - max-parallel: 5 matrix: - python: ['3.8', '3.10', '3.11'] + python: ['3.8', '3.10', '3.11', '3.12'] os: [ubuntu-latest] slepc: ['noslepc'] include: @@ -87,30 +56,3 @@ jobs: env_vars: OS,PYTHON fail_ci_if_error: false verbose: true - - deploy: - needs: [lint, test] - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install pypa/build - run: | - python -m pip install --upgrade pip - pip install build - - name: Build a binary wheel and a source tarball - run: | - python -m build --sdist --wheel --outdir dist/ - - - name: Publish package on PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_PASSWORD }} - skip_existing: true - verify-metadata: true - verbose: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..7cad946 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,40 @@ +name: Lint + +on: + schedule: + - cron: 00 00 * * 1 # run every Monday at 00:00 + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Cache pre-commit + uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('**/.pre-commit-config.yaml') }} + + - name: Install dependencies + run: | + sudo apt-get update -y + sudo apt install libenchant-2-dev pandoc + python -m pip install --upgrade pip + python -m pip install tox + + - name: Linting + run: | + tox -e lint,check-docs,readme diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3ead81d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Upload package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install pip dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build package + run: | + python -m build --sdist --wheel --outdir dist/ + + - name: Publish package on PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} + skip_existing: true + verify-metadata: true + verbose: true diff --git a/.readthedocs.yml b/.readthedocs.yml index e359638..a30a4ce 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,21 +1,17 @@ version: 2 +build: + os: ubuntu-22.04 + tools: + python: '3.10' + sphinx: builder: html configuration: docs/source/conf.py fail_on_warning: false -formats: -- htmlzip -- pdf - -build: - image: latest - python: - version: 3.8 install: - method: pip path: . - extra_requirements: - - docs + extra_requirements: [docs] diff --git a/tox.ini b/tox.ini index 7aa6907..0168a8d 100644 --- a/tox.ini +++ b/tox.ini @@ -79,7 +79,7 @@ isolated_build = True envlist = covclean lint - py{3.8,3.9,3.10,3.11}-{slepc,noslepc} + py{3.8,3.9,3.10,3.11,3.12}-{slepc,noslepc} coverage readme check-docs @@ -113,7 +113,7 @@ deps = coverage diff_cover skip_install = true -depends = py{3.8,3.9,3.10,3.11} +depends = py{3.8,3.9,3.10,3.11,3.12} parallel_show_output = True commands = coverage report --omit="tox/*"