Skip to content

Commit

Permalink
Merge pull request #79 from sequence-dev/mcflugen/add-python-3.12
Browse files Browse the repository at this point in the history
Add support for Python 3.12
  • Loading branch information
mcflugen committed Nov 22, 2023
2 parents 9fe8439 + fae7d46 commit a27f8a0
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
micromamba-version: latest
environment-name: testing
create-args: >-
python=3.11
python=3.12
mamba
pandoc
nox
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.11
python-version: 3.12

- name: Lint
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.10"
python-version: "3.12"
channels: conda-forge
channel-priority: true

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: "3.12"

- name: Install twine
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: "3.12"

- name: Install twine
run: |
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
Expand All @@ -39,11 +39,13 @@ jobs:
run: pip install nox

- name: Test
run: nox -s test
run: |
nox -s test --force-pythons="${{ matrix.python-version }}" -- -m "${{ matrix.pytest-marker }}"
- name: Test the cli
run: nox -s test-cli
run: |
nox -s test-cli --force-pythons="${{ matrix.python-version }}" -- -m "${{ matrix.pytest-marker }}"
- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: AndreMiras/coveralls-python-action@v20201129
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.11.0
hooks:
- id: black
name: black
Expand All @@ -26,7 +26,7 @@ repos:
rev: 1.7.0
hooks:
- id: nbqa-pyupgrade
args: ["--py38-plus"]
args: ["--py310-plus"]
- id: nbqa-isort
- id: nbqa-flake8
args: ["--extend-ignore=E402"]
Expand All @@ -48,7 +48,7 @@ repos:
- flake8-simplify

- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand All @@ -60,7 +60,7 @@ repos:
files: \.py$

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-builtin-literals
- id: check-added-large-files
Expand Down Expand Up @@ -89,7 +89,7 @@ repos:
additional_dependencies: [".[toml]"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.7.0
hooks:
- id: mypy
additional_dependencies: [types-all]
Expand Down
3 changes: 3 additions & 0 deletions news/79.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

Added support for Python 3.12 and dropped support for Python version older
than 3.10.
7 changes: 4 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import nox

PYTHON_VERSION = "3.12"
PROJECT = "sequence"
ROOT = pathlib.Path(__file__).parent

Expand All @@ -18,7 +19,7 @@
}


@nox.session
@nox.session(python=PYTHON_VERSION, venv_backend="conda")
def test(session: nox.Session) -> None:
"""Run the tests."""
session.install("-r", "requirements-testing.in")
Expand All @@ -30,7 +31,7 @@ def test(session: nox.Session) -> None:
session.run("pytest", *args)


@nox.session(name="test-notebooks")
@nox.session(name="test-notebooks", python=PYTHON_VERSION, venv_backend="conda")
def test_notebooks(session: nox.Session) -> None:
"""Run the notebooks."""
session.install("nbmake")
Expand All @@ -41,7 +42,7 @@ def test_notebooks(session: nox.Session) -> None:
session.run("pytest", "--nbmake", str(FOLDER["notebooks"]))


@nox.session(name="test-cli")
@nox.session(name="test-cli", python=PYTHON_VERSION, venv_backend="conda")
def test_cli(session: nox.Session) -> None:
"""Test the command line interface."""
session.install(".")
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ maintainers = [
{name = "Eric Hutton"}
]
keywords = ["sequence", "stratigraphy", "landlab"]
license = {file = "LICENSE.rst"}
license = {text = "MIT"}
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.8"
requires-python = ">=3.10"
dependencies = [
"compaction",
"landlab",
Expand All @@ -43,7 +43,7 @@ dynamic = ["readme", "version"]
homepage = "https://github.com/sequence-dev/sequence"
documentation = "https://sequence.readthedocs.io"
repository = "https://github.com/sequence-dev/sequence"
changelog = "https://github.com/sequence-dev/sequence/blob/develop/CHANGES.rst"
changelog = "https://github.com/sequence-dev/sequence/blob/develop/CHANGES.md"

[project.optional-dependencies]
dev = ["nox"]
Expand All @@ -55,7 +55,7 @@ sequence = "sequence.cli:sequence"
packages = ["sequence"]

[tool.setuptools.dynamic]
readme = {file = ["README.md", "AUTHORS.md"]}
readme = {file = ["README.md", "AUTHORS.md"], content-type="text/markdown"}
version = {attr = "sequence._version.__version__"}

[tool.pytest.ini_options]
Expand Down

0 comments on commit a27f8a0

Please sign in to comment.