Skip to content

Commit

Permalink
Bump python version (#24)
Browse files Browse the repository at this point in the history
* ci(tests): update how tests are run
* build(bump): bump to py3.9+
  • Loading branch information
nstarman authored Jan 8, 2025
1 parent c91e7d0 commit b930abb
Show file tree
Hide file tree
Showing 5 changed files with 1,607 additions and 30 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
fetch-depth: 0
- uses: actions/setup-python@v5
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version-file: ".python-version"
- name: Install the project
run: uv sync --group nox
- uses: pre-commit/[email protected]
with:
extra_args: --hook-stage manual --all-files
- name: Run PyLint
run: |
echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
pipx run nox -s pylint
run: uv run nox -s pylint -- --output-format=github

checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
Expand All @@ -42,7 +46,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.13"]
python-version: ["3.9", "3.13"]
runs-on: [ubuntu-latest, macos-latest, windows-latest]

include:
Expand All @@ -51,20 +55,22 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install package
run: python -m pip install .[test]
- name: Install the project
run: uv sync --group test

- name: Test package
run: >-
python -m pytest -ra --cov --cov-report=xml --cov-report=term
uv run pytest -ra --cov --cov-report=xml --cov-report=term
--durations=20
- name: Upload coverage report
Expand Down
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ ci:
autofix_commit_msg: "style: pre-commit fixes"

repos:
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.0
hooks:
- id: commitizen
additional_dependencies: [cz-conventional-gitmoji]

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.19.0"
hooks:
Expand All @@ -25,13 +31,6 @@ repos:
args: ["--pytest-test-first"]
- id: trailing-whitespace

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9
18 changes: 10 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
Expand All @@ -35,13 +34,20 @@
readme = "README.md"
requires-python = ">=3.8"

[project.optional-dependencies]
[dependency-groups]
dev = [
"cz-conventional-gitmoji>=0.6.1",
"ipykernel>=6.29.5",
"pre-commit>=3.5.0",
{ include-group = "test" },
{ include-group = "nox" },
]
nox = ["nox>=2024.10.9"]
test = [
"pytest >=6",
"pytest-cov >=3",
"sybil",
]
dev = ["dataclassish[test]"]

[project.urls]
"Bug Tracker" = "https://github.com/GalacticDynamics/optional_dependencies/issues"
Expand All @@ -54,10 +60,6 @@
build.hooks.vcs.version-file = "src/optional_dependencies/_version.py"
version.source = "vcs"

[tool.hatch.envs.default]
features = ["src", "test"]
scripts.test = "pytest {args}"


[tool.pytest.ini_options]
addopts = ["--showlocals", "--strict-config", "--strict-markers", "-ra"]
Expand Down Expand Up @@ -94,7 +96,7 @@

[tool.ruff]
src = ["src"]
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
extend-select = ["ALL"]
Expand Down
Loading

0 comments on commit b930abb

Please sign in to comment.