Skip to content

Commit 62a1c73

Browse files
Merge pull request #404 from robbievanleeuwen/python-312
Add python 3.12 support
2 parents eeb9c52 + e813b0b commit 62a1c73

File tree

8 files changed

+555
-541
lines changed

8 files changed

+555
-541
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
include:
19-
- { python: "3.11", os: "ubuntu-latest", session: "pre-commit" }
19+
- { python: "3.12", os: "ubuntu-latest", session: "pre-commit" }
20+
- { python: "3.12", os: "ubuntu-latest", session: "mypy" }
2021
- { python: "3.11", os: "ubuntu-latest", session: "mypy" }
2122
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
2223
- { python: "3.9", os: "ubuntu-latest", session: "mypy" }
24+
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
2325
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
2426
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
2527
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
28+
- { python: "3.12", os: "windows-latest", session: "tests" }
2629
- { python: "3.11", os: "windows-latest", session: "tests" }
2730
- { python: "3.10", os: "windows-latest", session: "tests" }
2831
- { python: "3.9", os: "windows-latest", session: "tests" }
32+
- { python: "3.12", os: "macos-latest", session: "tests" }
2933
- { python: "3.11", os: "macos-latest", session: "tests" }
3034
- { python: "3.10", os: "macos-latest", session: "tests" }
3135
- { python: "3.9", os: "macos-latest", session: "tests" }
@@ -126,7 +130,7 @@ jobs:
126130
- name: Set up Python
127131
uses: actions/setup-python@v5
128132
with:
129-
python-version: "3.11"
133+
python-version: "3.12"
130134

131135
- name: Upgrade pip
132136
run: |

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ duplication of work, and allows for feedback on your ideas.
4040

4141
## How to set up your development environment
4242

43-
You need Python 3.9, 3.10 or 3.11, and the following tools:
43+
You need Python 3.9, 3.10, 3.11 or 3.12, and the following tools:
4444

4545
- [Poetry]
4646
- [Nox]

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ on your ideas.
4949
How to set up your development environment
5050
------------------------------------------
5151

52-
You need Python 3.9, 3.10 or 3.11, and the following tools:
52+
You need Python 3.9, 3.10, 3.11 or 3.12, and the following tools:
5353

5454
- `Poetry <https://python-poetry.org/>`__
5555
- `Nox <https://nox.thea.codes/>`__

docs/installation.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Installation
44
============
55

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

99
Installing ``sectionproperties``
1010
--------------------------------
@@ -71,3 +71,6 @@ To install ``sectionproperties`` with the above functionality, use the ``dxf`` a
7171
7272
pip install sectionproperties[dxf]
7373
pip install sectionproperties[rhino]
74+
75+
.. warning:: The "rhino" extras do not currently support python 3.12, this may only be
76+
installed for python 3.9, 3.10 and 3.11.

noxfile.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
package = "sectionproperties"
26-
python_versions = ["3.11", "3.10", "3.9"]
26+
python_versions = ["3.12", "3.11", "3.10", "3.9"]
2727
nox.needs_version = ">= 2021.6.6"
2828
nox.options.sessions = (
2929
"pre-commit",
@@ -161,9 +161,21 @@ def tests(session: Session) -> None:
161161
Args:
162162
session: Nox session
163163
"""
164-
session.run_always(
165-
"poetry", "install", "--only", "main", "--extras", "dxf rhino", external=True
166-
)
164+
# if python version is 3.12, don't install rhino extras
165+
if session.python == "3.12":
166+
session.run_always(
167+
"poetry", "install", "--only", "main", "--extras", "dxf", external=True
168+
)
169+
else:
170+
session.run_always(
171+
"poetry",
172+
"install",
173+
"--only",
174+
"main",
175+
"--extras",
176+
"dxf rhino",
177+
external=True,
178+
)
167179

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

203215

204-
@session(name="docs-build", python=python_versions[1])
216+
@session(name="docs-build", python=python_versions[2])
205217
def docs_build(session: Session) -> None:
206218
"""Build the documentation.
207219
@@ -241,7 +253,7 @@ def docs_build(session: Session) -> None:
241253
session.run("sphinx-build", *args)
242254

243255

244-
@session(python=python_versions[1])
256+
@session(python=python_versions[2])
245257
def docs(session: Session) -> None:
246258
"""Build and serve the documentation with live reloading on file changes.
247259

0 commit comments

Comments
 (0)