Skip to content

Commit

Permalink
Merge pull request #125 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 May 27, 2024
2 parents 9eb0f51 + 9f9e6dc commit ff82e37
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 95 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ 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: "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-13", session: "tests" }
- { python: "3.11", os: "macos-13", session: "tests" }
- { python: "3.10", os: "macos-13", session: "tests" }
- { python: "3.9", os: "macos-13", session: "tests" }
Expand Down Expand Up @@ -123,7 +126,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
2 changes: 1 addition & 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 ``concreteproperties`` 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 ``concreteproperties``
---------------------------------
Expand Down
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


package = "concreteproperties"
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 @@ -171,7 +171,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 @@ -203,7 +203,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
156 changes: 78 additions & 78 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
packages = [
{ include = "concreteproperties", from = "src" },
Expand All @@ -44,7 +45,7 @@ Changelog = "https://github.com/robbievanleeuwen/concrete-properties/releases"
"Bug Tracker" = "https://github.com/robbievanleeuwen/concrete-properties/issues"

[tool.poetry.dependencies]
python = ">=3.9.0,<3.12"
python = ">=3.9.0,<3.13"
numpy = "^1.26.4"
scipy = "^1.12.0"
matplotlib = "^3.8.3"
Expand Down
10 changes: 5 additions & 5 deletions src/concreteproperties/design_codes/nzs3101.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,15 +726,15 @@ def check_axial_limits(
# compare to axial load
if n_design < phi * max_ten:
raise ValueError(
f"The specified axial load of {n_design*n_scale:.2f} kN, is less than "
f"the tension capacity of the concrete section, phiN_t = "
f"{phi*max_ten*n_scale:.2f} kN"
f"The specified axial load of {n_design * n_scale:.2f} kN, is less "
f"than the tension capacity of the concrete section, phiN_t = "
f"{phi * max_ten * n_scale:.2f} kN"
)
elif n_design > phi * max_comp:
raise ValueError(
f"The specified axial load of {n_design*n_scale:.2f} kN, is greater "
f"The specified axial load of {n_design * n_scale:.2f} kN, is greater "
f"than the compression capacity of the concrete section, phiN_c = "
f"{phi*max_comp*n_scale:.2f} kN"
f"{phi * max_comp * n_scale:.2f} kN"
)

def check_f_y_limit(self) -> None:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_nzs3101.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def test_nzs3101_create_os_section(
for steel_geom in concrete_os_section.reinf_geometries_lumped:
assert (
pytest.approx(steel_geom.material.__getattribute__("steel_grade"))
== f"user_{yield_strength*phi_os:.0f}"
== f"user_{yield_strength * phi_os:.0f}"
)
assert (
pytest.approx(
Expand Down Expand Up @@ -833,7 +833,7 @@ def test_nzs3101_create_prob_section(
for steel_geom in concrete_prob_section.reinf_geometries_lumped:
assert (
pytest.approx(steel_geom.material.__getattribute__("steel_grade"))
== f"user_{yield_strength*1.08:.0f}"
== f"user_{yield_strength * 1.08:.0f}"
)
assert (
pytest.approx(
Expand Down Expand Up @@ -974,7 +974,7 @@ def test_nzs3101_create_prob_os_section(
for steel_geom in concrete_prob_section.reinf_geometries_lumped:
assert (
pytest.approx(steel_geom.material.__getattribute__("steel_grade"))
== f"user_{yield_strength*phi_os:.0f}"
== f"user_{yield_strength * phi_os:.0f}"
)
assert (
pytest.approx(
Expand Down

0 comments on commit ff82e37

Please sign in to comment.