diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 25d4dd2..ce04e24 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -54,7 +54,7 @@ jobs: fail-fast: false matrix: os: [ ubuntu-24.04, macos-14, macos-15-intel ] - python-version: [ 310, 311 ] + python-version: [ 310, 311, 312, 313 ] steps: - name: "Checkout code" @@ -99,7 +99,7 @@ jobs: - name: "Build sdist" run: | - pip3 install pipx ppsetuptools + pip3 install pipx pipx run build --sdist - name: "Upload build artifacts" diff --git a/cibuildwheel.toml b/cibuildwheel.toml index b207a11..901c4d0 100644 --- a/cibuildwheel.toml +++ b/cibuildwheel.toml @@ -31,18 +31,11 @@ linux.before-test = [ "pip install 'biopython' 'matplotlib' 'numpy<2' 'pandas' 'pygments' 'scipy'" ] -# Run examples serially (one at a time) without parallel to avoid memory issues in CI +# Run ALL examples serially (one at a time) - including slow ones after memory fixes linux.test-command = [ """cd {project}/examples && for f in *.py; do - case "$f" in - benefits_of_sex.py|genealogies_with_selection.py|measuring_fixation_probabilities.py|multi_sample_adaptive.py|mutation_selection_balance_highd.py|neutral_LD_highd.py|speed_highd.py|speed_lowd.py) - echo "Skipping slow example: $f" - ;; - *) - echo "Testing $f..." - MPLBACKEND=Agg python3 "$f" || exit 1 - ;; - esac + echo "Testing $f..." + MPLBACKEND=Agg python3 "$f" || exit 1 done""" ] @@ -51,17 +44,10 @@ macos.before-test = [ "pip install 'biopython' 'matplotlib' 'numpy<2' 'pandas' 'pygments' 'scipy'" ] -# Run same tests as Linux for consistency - serially without parallel +# Run ALL examples serially - including slow ones after memory fixes macos.test-command = [ """cd {project}/examples && for f in *.py; do - case "$f" in - benefits_of_sex.py|genealogies_with_selection.py|measuring_fixation_probabilities.py|multi_sample_adaptive.py|mutation_selection_balance_highd.py|neutral_LD_highd.py|speed_highd.py|speed_lowd.py) - echo "Skipping slow example: $f" - ;; - *) - echo "Testing $f..." - MPLBACKEND=Agg python3 "$f" || exit 1 - ;; - esac + echo "Testing $f..." + MPLBACKEND=Agg python3 "$f" || exit 1 done""" ] diff --git a/examples/mutation_selection_balance_highd.py b/examples/mutation_selection_balance_highd.py index 7f492d0..8d15803 100644 --- a/examples/mutation_selection_balance_highd.py +++ b/examples/mutation_selection_balance_highd.py @@ -65,7 +65,7 @@ for locus in range(L): # make histogram - y,x = np.histogram(allele_frequencies[:,locus], bins=af_bins, normed='True') + y,x = np.histogram(allele_frequencies[:,locus], bins=af_bins, density=True) # plot plt.plot(bc, y, color=plt.cm.jet(locus*4)) @@ -78,7 +78,7 @@ # compare explicitly to diffusion theory by normalizing to the diffusion theory prediction plt.figure() for locus in range(L): - y,x = np.histogram(allele_frequencies[:,locus], bins=af_bins, normed='True') + y,x = np.histogram(allele_frequencies[:,locus], bins=af_bins, density=True) # calculate the diffusion theory single locus result diffusion_theory = bc**(2*N*mu-1)*(1-bc)**(2*N*mu-1)*np.exp(2*N*s[locus]*bc) diff --git a/pyproject.toml b/pyproject.toml index ac23077..2a9b884 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ authors = [ { name = "Ivan Aksamentov" }, ] readme = "README.md" -requires-python = ">=3.6" +requires-python = ">=3.10" keywords = ["packaging", "dependency", "infer", "pyproject.toml"] classifiers = [ "Programming Language :: Python :: 3", @@ -25,8 +25,7 @@ repository = "https://github.com/neherlab/ffpopsim" [build-system] build-backend = "setuptools.build_meta" requires = [ - "numpy", - "ppsetuptools", + "numpy<2", "setuptools", "wheel", ] diff --git a/setup.py b/setup.py index d00e9b9..676a501 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,10 @@ #!/usr/bin/env python # vim: fdm=indent -import sys import subprocess import os -# Python 3.6 compatibility: Python 3.6 has no compatible version of setuptools that supports -# PEP-517 (the `pyproject.toml`-based config), so we use a shim package `ppsetuptools` instead. -if sys.version_info >= (3, 7): - from setuptools import setup, Extension -else: - from ppsetuptools import setup, Extension - +from setuptools import setup, Extension import numpy as np # Get GSL include paths