Skip to content

Commit b7e8f7c

Browse files
authored
update range of support Python versions (#1347)
1 parent d6622b5 commit b7e8f7c

File tree

8 files changed

+27
-14
lines changed

8 files changed

+27
-14
lines changed

.github/workflows/black.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
python: [ "3.12" ]
12+
python: [ "3.13" ]
1313
os: [ ubuntu-22.04 ]
1414
defaults:
1515
run:

.github/workflows/macos_CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
python: [ "3.11", "3.12" ]
16+
python: [ "3.12", "3.13" ]
1717
os: [ macos-14, macos-13 ]
1818
rust: [1.62.1]
1919
defaults:

.github/workflows/ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
python: [ 3.9, "3.10", "3.11", "3.12" ]
12+
python: [ "3.10", "3.11", "3.12", "3.13" ]
1313
os: [ ubuntu-22.04 ]
1414
compiler: [gcc, clang14]
1515
rust: [1.62.1]

.github/workflows/wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
needs: ['build_sdist']
108108
strategy:
109109
matrix:
110-
python: [3.9, "3.10", "3.11", "3.12"]
110+
python: ["3.10", "3.11", "3.12", "3.13"]
111111
steps:
112112
- name: Cancel Previous Runs
113113
uses: styfle/cancel-workflow-action@0.12.1
@@ -144,7 +144,7 @@ jobs:
144144
needs: ['manylinux2_28']
145145
strategy:
146146
matrix:
147-
python: [3.8, 3.9, "3.10", "3.11", "3.12"]
147+
python: ["3.10", "3.11", "3.12", "3.13"]
148148
steps:
149149
- name: Cancel Previous Runs
150150
uses: styfle/cancel-workflow-action@0.12.1
@@ -172,7 +172,7 @@ jobs:
172172
needs: ['macos-wheels']
173173
strategy:
174174
matrix:
175-
python: ["3.11", "3.12"]
175+
python: ["3.12", "3.13"]
176176
os: [macos-14, macos-13]
177177
steps:
178178
- name: Cancel Previous Runs

doc/long_vignettes/tskitconvert_vignette.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,14 @@ We can pass the `params` object on when exporting the data to `tskit`:
159159
```{code-cell} python
160160
ts = pop.dump_tables_to_tskit(model_params=params)
161161
def rebuild_params(md):
162+
import copy
163+
import inspect
162164
import fwdpy11
165+
md = copy.deepcopy(md)
163166
for i in dir(fwdpy11):
164-
exec(f"from fwdpy11 import {i}")
167+
if md.find(i) > 0:
168+
if inspect.isclass(eval(f"fwdpy11.{i}")):
169+
md = md.replace(i, "fwdpy11." + i)
165170
recovered_params = fwdpy11.ModelParams(**eval(md))
166171
return recovered_params
167172
recovered_params = rebuild_params(ts.metadata["model_params"])

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies = [
3030
"demes ~= 0.2.2",
3131
"Deprecated",
3232
]
33-
requires-python = ">=3.9, <3.13"
33+
requires-python = ">=3.10, <3.14"
3434

3535
[project.scripts]
3636
fwdpy11 = "fwdpy11.__main__:main"
@@ -59,7 +59,7 @@ test-requires = "pytest msprime hypothesis"
5959
build-frontend = "build"
6060

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

6565
[tool.cibuildwheel.linux]

tests/test_metadata_roundtrips_via_simulation.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,16 @@ def test_metadata_roundtrip_single_deme_sim_with_parameters(rng, pdict, pop, inc
201201
provenance = json.loads(ts.provenance(0).record)
202202

203203
def rebuild_pdict(provenance):
204+
import copy
204205
import fwdpy11
206+
import inspect
205207

208+
params = copy.deepcopy(provenance["parameters"]["params_dict"])
206209
for i in dir(fwdpy11):
207-
exec(f"from fwdpy11 import {i}")
208-
params_dict = eval(provenance["parameters"]["params_dict"])
210+
if params.find(i) > 0:
211+
if inspect.isclass(eval(f"fwdpy11.{i}")):
212+
params = params.replace(i, "fwdpy11." + i)
213+
params_dict = eval(params)
209214
return params_dict
210215

211216
params_dict = rebuild_pdict(provenance)

tests/test_tskit_metadata.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
# You should have received a copy of the GNU General Public License
1717
# along with fwdpy11. If not, see <http://www.gnu.org/licenses/>.
1818
#
19+
import copy
20+
import inspect
1921

20-
import demes
2122
import fwdpy11
2223
import pytest
2324
import tskit
@@ -62,10 +63,12 @@ def test_single_model_params(pop, pdict1):
6263
ts = pop.dump_tables_to_tskit(model_params=mp)
6364

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

68-
mp_rebuilt = fwdpy11.ModelParams(**eval(ts.metadata["model_params"]))
71+
mp_rebuilt = fwdpy11.ModelParams(**eval(params))
6972

7073
assert mp == mp_rebuilt
7174

0 commit comments

Comments
 (0)