Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Python 3.8 support, and add python 3.13 and numpy 2.0 support #548

Merged
merged 13 commits into from
Oct 8, 2024
21 changes: 13 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand All @@ -36,15 +36,13 @@ jobs:
- run: pip install --user dist/*.tar.gz
- run: pip install --user . montepy[test]
- run: pip install --user . montepy[doc]
if: ${{ matrix.python-version != '3.8'}}
- run: pip install --user . montepy[format]
- run: pip install --user . montepy[build]
- run: pip install --user . montepy[develop]
if: ${{ matrix.python-version != '3.8'}}
- run: pip freeze
- name: Upload build artifacts
uses: actions/[email protected]
if: ${{ matrix.python-version == '3.9' }}
if: ${{ matrix.python-version == '3.12' && matrix.numpy-version == '2.0' }}
with:
name: build
path: dist/*
Expand All @@ -54,35 +52,42 @@ jobs:
permissions: write-all
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
numpy-version: ["1.0", "2.0"]

steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install numpy~=${{ matrix.numpy-version }}
name: install specific numpy version
- run: pip install --user . montepy[test]
- run: pip install --user . montepy[build]
- run: pip uninstall -y pytest-profiling
name: Uninstall incompatible library
if: ${{ matrix.python-version == '3.13' }}
- run: pip freeze
- run: coverage run -m pytest --junitxml=test_report.xml
- run: coverage report
if: ${{ success() || failure() }}
- run: coverage xml
if: ${{ success() || failure() }}
- name: Upload test report
if: ${{ matrix.python-version == '3.9' && (success() || failure() )}}
if: ${{ matrix.python-version == '3.12' && matrix.numpy-version == '2.0' && (success() || failure() )}}
uses: actions/upload-artifact@v4
with:
name: test
path: test_report.xml
- name: Upload coverage report
if: ${{ matrix.python-version == '3.9' && (success() || failure() )}}
if: ${{ matrix.python-version == '3.12' && matrix.numpy-version == '2.0' && (success() || failure() )}}
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.xml
- name: Coveralls GitHub Action
if: ${{ matrix.python-version == '3.9' && (success() || failure() )}}
if: ${{ matrix.python-version == '3.12' && matrix.numpy-version == '2.0' && (success() || failure() )}}
uses: coverallsapp/github-action@v2
with:
file: coverage.xml
Expand Down
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "A library for reading, editing, and writing MCNP input files"

# gitlab limits the readme to 4,000 chars.
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
maintainers = [
{name = "Micah Gale", email = "[email protected]"}
]
Expand All @@ -18,7 +18,6 @@ keywords = ["MCNP", "neutronics", "imcnp", "input file", "monte carlo", "radiati
license = {file="LICENSE"}
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
Expand All @@ -27,7 +26,12 @@ classifiers = [
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Human Machine Interfaces",

"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13"
]
dependencies = [
"numpy>=1.18",
Expand Down
14 changes: 8 additions & 6 deletions tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def run_script(args):

def test_delete_bad(self):
for in_file in self.files:
with open(os.path.join("tests", "inputs", in_file), "rb") as in_fh, open(
self.files[in_file]["-d"], "rb"
) as out_fh:
with (
open(os.path.join("tests", "inputs", in_file), "rb") as in_fh,
open(self.files[in_file]["-d"], "rb") as out_fh,
):
for in_line, out_line in zip(in_fh, out_fh):
try:
in_line.decode("ascii")
Expand All @@ -52,9 +53,10 @@ def test_delete_bad(self):

def test_whitespace_bad(self):
for in_file in self.files:
with open(os.path.join("tests", "inputs", in_file), "rb") as in_fh, open(
self.files[in_file]["-w"], "rb"
) as out_fh:
with (
open(os.path.join("tests", "inputs", in_file), "rb") as in_fh,
open(self.files[in_file]["-w"], "rb") as out_fh,
):
for in_line, out_line in zip(in_fh, out_fh):
try:
in_line.decode("ascii")
Expand Down
Loading