Skip to content

Commit

Permalink
Merge pull request #404 from robbievanleeuwen/python-312
Browse files Browse the repository at this point in the history
Add python 3.12 support
  • Loading branch information
robbievanleeuwen authored Mar 9, 2024
2 parents eeb9c52 + e813b0b commit 62a1c73
Show file tree
Hide file tree
Showing 8 changed files with 555 additions and 541 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@ jobs:
fail-fast: false
matrix:
include:
- { python: "3.11", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.12", os: "ubuntu-latest", session: "pre-commit" }
- { python: "3.12", os: "ubuntu-latest", session: "mypy" }
- { python: "3.11", os: "ubuntu-latest", session: "mypy" }
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
- { python: "3.9", os: "ubuntu-latest", session: "mypy" }
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
- { python: "3.12", os: "windows-latest", session: "tests" }
- { python: "3.11", os: "windows-latest", session: "tests" }
- { python: "3.10", os: "windows-latest", session: "tests" }
- { python: "3.9", os: "windows-latest", session: "tests" }
- { python: "3.12", os: "macos-latest", session: "tests" }
- { python: "3.11", os: "macos-latest", session: "tests" }
- { python: "3.10", os: "macos-latest", session: "tests" }
- { python: "3.9", os: "macos-latest", session: "tests" }
Expand Down Expand Up @@ -126,7 +130,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Upgrade pip
run: |
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ duplication of work, and allows for feedback on your ideas.

## How to set up your development environment

You need Python 3.9, 3.10 or 3.11, and the following tools:
You need Python 3.9, 3.10, 3.11 or 3.12, and the following tools:

- [Poetry]
- [Nox]
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ on your ideas.
How to set up your development environment
------------------------------------------

You need Python 3.9, 3.10 or 3.11, and the following tools:
You need Python 3.9, 3.10, 3.11 or 3.12, and the following tools:

- `Poetry <https://python-poetry.org/>`__
- `Nox <https://nox.thea.codes/>`__
Expand Down
5 changes: 4 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation
============

These instructions will get you a copy of ``sectionproperties`` up and running on your
machine. You will need a working copy of python 3.9, 3.10 or 3.11 to get started.
machine. You will need a working copy of python 3.9, 3.10, 3.11 or 3.12 to get started.

Installing ``sectionproperties``
--------------------------------
Expand Down Expand Up @@ -71,3 +71,6 @@ To install ``sectionproperties`` with the above functionality, use the ``dxf`` a
pip install sectionproperties[dxf]
pip install sectionproperties[rhino]
.. warning:: The "rhino" extras do not currently support python 3.12, this may only be
installed for python 3.9, 3.10 and 3.11.
24 changes: 18 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


package = "sectionproperties"
python_versions = ["3.11", "3.10", "3.9"]
python_versions = ["3.12", "3.11", "3.10", "3.9"]
nox.needs_version = ">= 2021.6.6"
nox.options.sessions = (
"pre-commit",
Expand Down Expand Up @@ -161,9 +161,21 @@ def tests(session: Session) -> None:
Args:
session: Nox session
"""
session.run_always(
"poetry", "install", "--only", "main", "--extras", "dxf rhino", external=True
)
# if python version is 3.12, don't install rhino extras
if session.python == "3.12":
session.run_always(
"poetry", "install", "--only", "main", "--extras", "dxf", external=True
)
else:
session.run_always(
"poetry",
"install",
"--only",
"main",
"--extras",
"dxf rhino",
external=True,
)

# install relevant tooling
session.install("coverage[toml]", "pytest", "pygments", "pytest-check")
Expand Down Expand Up @@ -201,7 +213,7 @@ def coverage(session: Session) -> None:
session.run("coverage", *args)


@session(name="docs-build", python=python_versions[1])
@session(name="docs-build", python=python_versions[2])
def docs_build(session: Session) -> None:
"""Build the documentation.
Expand Down Expand Up @@ -241,7 +253,7 @@ def docs_build(session: Session) -> None:
session.run("sphinx-build", *args)


@session(python=python_versions[1])
@session(python=python_versions[2])
def docs(session: Session) -> None:
"""Build and serve the documentation with live reloading on file changes.
Expand Down
Loading

0 comments on commit 62a1c73

Please sign in to comment.