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

Update supported Python versions #293

Merged
merged 8 commits into from
Nov 29, 2023
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
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
versioning-strategy: "lockfile-only"
groups:
dependencies:
Expand All @@ -12,4 +12,4 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
24 changes: 12 additions & 12 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
required: false

env:
MAIN_PYTHON_VERSION: "3.8"
MAIN_PYTHON_VERSION: "3.9"
PACKAGE_NAME: "ansys-acp-core"
DOCUMENTATION_CNAME: "acp.docs.pyansys.com"

Expand Down Expand Up @@ -50,17 +50,14 @@ jobs:
pip-${{ runner.os }}

# pre-commit needs all dev dependencies, since it also checks the test and example files
# TODO: remove 'poetry config installer.modern-installation false' once we use a pydata-sphinx-theme
# version where https://github.com/pydata/pydata-sphinx-theme/issues/1253 is resolved.
# The same needs to be removed in the README.
- name: Install library, with all optional groups
run: |
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-api-acp".insteadOf "https://github.com/ansys-internal/ansys-api-acp"
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-tools-filetransfer".insteadOf "https://github.com/ansys-internal/ansys-tools-filetransfer"
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-api-tools-filetransfer".insteadOf "https://github.com/ansys-internal/ansys-api-tools-filetransfer"
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-tools-local-product-launcher".insteadOf "https://github.com/ansys-internal/ansys-tools-local-product-launcher"
pip install poetry
poetry config installer.modern-installation false
pip install -U pip
pip install 'poetry!=1.7.0'
poetry install --with dev,test

- name: Install custom API branch if needed
Expand Down Expand Up @@ -104,7 +101,8 @@ jobs:
run: |
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-api-acp".insteadOf "https://github.com/ansys-internal/ansys-api-acp"
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-tools-local-product-launcher".insteadOf "https://github.com/ansys-internal/ansys-tools-local-product-launcher"
pip install poetry
pip install -U pip
pip install 'poetry!=1.7.0'
poetry build

- name: Validate packages
Expand All @@ -125,7 +123,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
python-version: ["3.8", "3.10"]
python-version: ["3.9", "3.10"]

steps:
- uses: actions/checkout@v4
Expand All @@ -149,7 +147,8 @@ jobs:
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-tools-filetransfer".insteadOf "https://github.com/ansys-internal/ansys-tools-filetransfer"
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-api-tools-filetransfer".insteadOf "https://github.com/ansys-internal/ansys-api-tools-filetransfer"
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-tools-local-product-launcher".insteadOf "https://github.com/ansys-internal/ansys-tools-local-product-launcher"
pip install poetry
pip install -U pip
pip install 'poetry!=1.7.0'
poetry install --with test

- name: Install custom API branch if needed
Expand All @@ -176,7 +175,7 @@ jobs:
- name: Benchmarks
working-directory: tests/benchmarks
run: |
poetry run pytest -v --license-server=1055@$LICENSE_SERVER --no-server-log-files --docker-image=$IMAGE_NAME --build-benchmark-image --benchmark-json benchmark_output.json --benchmark-group-by=fullname ${{ (matrix.python-version == '3.8' && github.ref == 'refs/heads/main') && ' ' || '--validate-benchmarks-only' }}
poetry run pytest -v --license-server=1055@$LICENSE_SERVER --no-server-log-files --docker-image=$IMAGE_NAME --build-benchmark-image --benchmark-json benchmark_output.json --benchmark-group-by=fullname ${{ (matrix.python-version == '3.9' && github.ref == 'refs/heads/main') && ' ' || '--validate-benchmarks-only' }}
env:
LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
IMAGE_NAME: "ghcr.io/ansys-internal/pyacp${{ github.event.inputs.docker_image_suffix || ':latest' }}"
Expand All @@ -190,7 +189,7 @@ jobs:
benchmark-data-dir-path: benchmarks
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}
if: matrix.python-version == '3.8' && github.ref == 'refs/heads/main'
if: matrix.python-version == '3.9' && github.ref == 'refs/heads/main'

docs:
name: Build Documentation
Expand Down Expand Up @@ -230,7 +229,8 @@ jobs:
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-tools-filetransfer".insteadOf "https://github.com/ansys-internal/ansys-tools-filetransfer"
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-api-tools-filetransfer".insteadOf "https://github.com/ansys-internal/ansys-api-tools-filetransfer"
git config --global url."https://${{ secrets.PYANSYS_CI_BOT_TOKEN }}@github.com/ansys-internal/ansys-tools-local-product-launcher".insteadOf "https://github.com/ansys-internal/ansys-tools-local-product-launcher"
pip install poetry
pip install -U pip
pip install 'poetry!=1.7.0'
poetry install --with dev

- name: Install custom API branch if needed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10']
timeout-minutes: 30

steps:
Expand Down
138 changes: 71 additions & 67 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,69 +1,73 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: '23.3.0' # when changed, also update the version in blacken-docs
hooks:
- id: black
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.3.0]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: "23.3.0" # when changed, also update the version in blacken-docs
hooks:
- id: black
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.3.0]

- repo: https://github.com/pycqa/isort
rev: '5.12.0'
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: '6.0.0'
hooks:
- id: flake8
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies: ['tomli'] # needed to parse pyproject.toml
exclude: '^poetry\.lock$'
- repo: https://github.com/python-poetry/poetry/
rev: '1.4.0'
hooks:
- id: poetry-check
name: "poetry: check pyproject.toml syntax"
# We're slightly abusing the 'poetry-lock' hook, by running
# 'poetry lock --check' instead of 'poetry lock'
- id: poetry-lock
name: "poetry: check poetry.lock consistency"
args: ['--check']
files: '^(pyproject\.toml|poetry\.lock)$'
# - repo: https://github.com/pycqa/pydocstyle
# rev: 6.1.1
# hooks:
# - id: pydocstyle
# additional_dependencies: [toml]
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
args: ["--extra-keys", "metadata.interpreter metadata.kernelspec metadata.language_info metadata.vscode"]
- repo: local
hooks:
- id: mypy-code
name: "mypy: strict checks on code"
entry: mypy
language: python
types: [python]
require_serial: true
exclude: "^(doc/)|(tests/)|^(examples/)"
args: ["--strict", "--namespace-packages", "--explicit-package-bases"]
- id: mypy-tests
name: "mypy: lenient checks on tests"
entry: mypy
language: python
types: [python]
require_serial: true
files: "^(tests/)|^(examples/)"
args: ["--namespace-packages", "--explicit-package-bases"]
- repo: https://github.com/pycqa/isort
rev: "5.12.0"
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: "6.0.0"
hooks:
- id: flake8
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
additional_dependencies: ["tomli"] # needed to parse pyproject.toml
exclude: '^poetry\.lock$'
- repo: https://github.com/python-poetry/poetry/
rev: "1.4.0"
hooks:
- id: poetry-check
name: "poetry: check pyproject.toml syntax"
# We're slightly abusing the 'poetry-lock' hook, by running
# 'poetry lock --check' instead of 'poetry lock'
- id: poetry-lock
name: "poetry: check poetry.lock consistency"
args: ["--check"]
files: '^(pyproject\.toml|poetry\.lock)$'
# - repo: https://github.com/pycqa/pydocstyle
# rev: 6.1.1
# hooks:
# - id: pydocstyle
# additional_dependencies: [toml]
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
args:
[
"--extra-keys",
"metadata.interpreter metadata.kernelspec metadata.language_info metadata.vscode",
]
- repo: local
hooks:
- id: mypy-code
name: "mypy: strict checks on code"
entry: mypy
language: python
types: [python]
require_serial: true
exclude: "^(doc/)|(tests/)|^(examples/)"
args: ["--strict", "--namespace-packages", "--explicit-package-bases"]
- id: mypy-tests
name: "mypy: lenient checks on tests"
entry: mypy
language: python
types: [python]
require_serial: true
files: "^(tests/)|^(examples/)"
args: ["--namespace-packages", "--explicit-package-bases"]
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PyACP
:target: https://docs.pyansys.com/
:alt: PyAnsys

.. |python| image:: https://img.shields.io/badge/Python-3.8%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue.svg
.. |python| image:: https://img.shields.io/badge/Python-3.9%20%7C%203.9%20%7C%203.9%20%7C%203.10%20%7C%203.12-blue.svg
:target: https://pypi.org/project/ansys-acp-core
:alt: Python

Expand Down
Loading
Loading