Skip to content

Commit

Permalink
update range of support Python versions (#1347)
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen authored Dec 10, 2024
1 parent d6622b5 commit b7e8f7c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [ "3.12" ]
python: [ "3.13" ]
os: [ ubuntu-22.04 ]
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [ "3.11", "3.12" ]
python: [ "3.12", "3.13" ]
os: [ macos-14, macos-13 ]
rust: [1.62.1]
defaults:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [ 3.9, "3.10", "3.11", "3.12" ]
python: [ "3.10", "3.11", "3.12", "3.13" ]
os: [ ubuntu-22.04 ]
compiler: [gcc, clang14]
rust: [1.62.1]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
needs: ['build_sdist']
strategy:
matrix:
python: [3.9, "3.10", "3.11", "3.12"]
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
needs: ['manylinux2_28']
strategy:
matrix:
python: [3.8, 3.9, "3.10", "3.11", "3.12"]
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
needs: ['macos-wheels']
strategy:
matrix:
python: ["3.11", "3.12"]
python: ["3.12", "3.13"]
os: [macos-14, macos-13]
steps:
- name: Cancel Previous Runs
Expand Down
7 changes: 6 additions & 1 deletion doc/long_vignettes/tskitconvert_vignette.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,14 @@ We can pass the `params` object on when exporting the data to `tskit`:
```{code-cell} python
ts = pop.dump_tables_to_tskit(model_params=params)
def rebuild_params(md):
import copy
import inspect
import fwdpy11
md = copy.deepcopy(md)
for i in dir(fwdpy11):
exec(f"from fwdpy11 import {i}")
if md.find(i) > 0:
if inspect.isclass(eval(f"fwdpy11.{i}")):
md = md.replace(i, "fwdpy11." + i)
recovered_params = fwdpy11.ModelParams(**eval(md))
return recovered_params
recovered_params = rebuild_params(ts.metadata["model_params"])
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"demes ~= 0.2.2",
"Deprecated",
]
requires-python = ">=3.9, <3.13"
requires-python = ">=3.10, <3.14"

[project.scripts]
fwdpy11 = "fwdpy11.__main__:main"
Expand Down Expand Up @@ -59,7 +59,7 @@ test-requires = "pytest msprime hypothesis"
build-frontend = "build"

[tool.cibuildwheel.macos]
build = "cp3{11,12}-*"
build = "cp3{12,13}-*"
before-all = "./deployment/macos_wheels/install_gsl.sh"

[tool.cibuildwheel.linux]
Expand Down
9 changes: 7 additions & 2 deletions tests/test_metadata_roundtrips_via_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,16 @@ def test_metadata_roundtrip_single_deme_sim_with_parameters(rng, pdict, pop, inc
provenance = json.loads(ts.provenance(0).record)

def rebuild_pdict(provenance):
import copy
import fwdpy11
import inspect

params = copy.deepcopy(provenance["parameters"]["params_dict"])
for i in dir(fwdpy11):
exec(f"from fwdpy11 import {i}")
params_dict = eval(provenance["parameters"]["params_dict"])
if params.find(i) > 0:
if inspect.isclass(eval(f"fwdpy11.{i}")):
params = params.replace(i, "fwdpy11." + i)
params_dict = eval(params)
return params_dict

params_dict = rebuild_pdict(provenance)
Expand Down
9 changes: 6 additions & 3 deletions tests/test_tskit_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with fwdpy11. If not, see <http://www.gnu.org/licenses/>.
#
import copy
import inspect

import demes
import fwdpy11
import pytest
import tskit
Expand Down Expand Up @@ -62,10 +63,12 @@ def test_single_model_params(pop, pdict1):
ts = pop.dump_tables_to_tskit(model_params=mp)

# reconstruct
params = copy.deepcopy(ts.metadata["model_params"])
for i in dir(fwdpy11):
exec(f"from fwdpy11 import {i}")
if inspect.isclass(eval(f"fwdpy11.{i}")):
params = params.replace(i, "fwdpy11." + i)

mp_rebuilt = fwdpy11.ModelParams(**eval(ts.metadata["model_params"]))
mp_rebuilt = fwdpy11.ModelParams(**eval(params))

assert mp == mp_rebuilt

Expand Down

0 comments on commit b7e8f7c

Please sign in to comment.