From c97c6f8880118ba7e9f8be6570fc760c165a80fb Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 02:26:15 -0800 Subject: [PATCH 01/18] Python 2 compatibility --- setup.py | 8 ++++++-- stochastic_arrow/test/test_arrow.py | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 3f06677..fc40ce4 100644 --- a/setup.py +++ b/setup.py @@ -8,13 +8,17 @@ import setuptools # used indirectly for bdist_wheel cmd and long_description_content_type from distutils.core import setup from distutils.extension import Extension +import sys import numpy as np _ = setuptools -with open("README.md", 'r', encoding="utf-8") as readme: - long_description = readme.read() +with open("README.md", 'r') as readme: + if sys.version_info[0] < 3: + long_description = readme.read().decode('utf-8') + else: + long_description = readme.read() current_dir = os.getcwd() arrow_dir = os.path.join(current_dir, 'stochastic_arrow') diff --git a/stochastic_arrow/test/test_arrow.py b/stochastic_arrow/test/test_arrow.py index d97284b..db14eae 100644 --- a/stochastic_arrow/test/test_arrow.py +++ b/stochastic_arrow/test/test_arrow.py @@ -15,7 +15,6 @@ from time import time as seconds_since_epoch import json import numpy as np -from pathlib import Path import platform import psutil import pytest @@ -296,12 +295,15 @@ def test_fail_flagella(): # All reaction propensities should be printed if simulation fails def test_fail_stdout(): - curr_file = Path(os.path.realpath(__file__)) - main_dir = curr_file.parents[2] + curr_file = os.path.realpath(__file__) + main_dir = os.path.dirname(os.path.dirname(os.path.dirname(curr_file))) # sys.executable more reliable than 'python' in Windows virtualenv - result = subprocess.run( + env = os.environ.copy() + env.update({'PYTHONPATH': str(main_dir)}) + result = subprocess.Popen( [sys.executable, curr_file, '--test-fail-flagella'], - capture_output=True, env={**os.environ, 'PYTHONPATH': str(main_dir)}) + stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) + stdout, stderr = result.communicate() assert re.search(( 'failed simulation: total propensity is NaN.*' 'reaction 0 is -?0.000000.*' @@ -311,8 +313,8 @@ def test_fail_stdout(): 'reaction 4 is -?0.000000.*' 'reaction 5 is -?nan.*' 'largest reaction is 5 at -?nan.*'), - result.stdout.decode('utf-8'), flags=re.DOTALL) - assert result.stderr == b'' + stdout.decode('utf-8'), flags=re.DOTALL) + assert stderr == b'' def test_get_set_random_state(): stoich = np.array([[1, 1, -1, 0], [-2, 0, 0, 1], [-1, -1, 1, 0]], @@ -398,7 +400,7 @@ def check_gillespie_reference(): all_axes = np.asarray(all_axes) for (axes, system) in moves.zip(all_axes.flatten(), systems): - print(f'Running {system.__name__}') + print('Running {}'.format(system.__name__)) axes.set_title(system.__name__) time, counts, events = system() From 1f3db37c76e36f2eb4d62c3f0bc341755c5c0310 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 02:32:20 -0800 Subject: [PATCH 02/18] Use setuptools and build --- Makefile | 6 ++---- pyproject.toml | 3 +++ requirements.txt | 1 + setup.py | 22 ++++++---------------- 4 files changed, 12 insertions(+), 20 deletions(-) create mode 100644 pyproject.toml diff --git a/Makefile b/Makefile index 41f5961..6171f2c 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,7 @@ clean: find . -name "__pycache__" -delete compile: - USE_CYTHON=1 python setup.py build_ext --inplace + USE_CYTHON=1 python -m pip install -e . dist: - ### bdist_wheel is disabled on linux since the distribution machinery doesn't - ### yet have a way to specify compatible linux distros. - USE_CYTHON=1 python setup.py sdist # bdist_wheel + USE_CYTHON=1 python -m build --sdist diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..efa310c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel", "cython", "numpy"] +build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index 0c0af41..1c09869 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ pip setuptools +build Cython>=0.29.34 numpy diff --git a/setup.py b/setup.py index fc40ce4..6f60fe5 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,8 @@ -# distutils is deprecated; to be removed for Python 3.12. -# See https://numpy.org/devdocs/reference/distutils_status_migration.html for -# migration advice. -# This setup.py file no longer uses numpy.distutils so it might be easy to -# move fully to setuptools. - import os -import setuptools # used indirectly for bdist_wheel cmd and long_description_content_type -from distutils.core import setup -from distutils.extension import Extension +from setuptools import Extension, setup import sys import numpy as np -_ = setuptools with open("README.md", 'r') as readme: @@ -24,9 +15,9 @@ arrow_dir = os.path.join(current_dir, 'stochastic_arrow') # Compile the Cython code to C for development builds: -# USE_CYTHON=1 python setup.py build_ext --inplace +# USE_CYTHON=1 python -m pip install -e . # and for building source distribution packages: -# USE_CYTHON=1 python setup.py sdist +# USE_CYTHON=1 python -m build --sdist # and *not* when installing a distribution package. # See http://docs.cython.org/en/latest/src/userguide/source_files_and_compilation.html#distributing-cython-modules USE_CYTHON = 'USE_CYTHON' in os.environ @@ -39,7 +30,7 @@ 'stochastic_arrow/mersenne.c', 'stochastic_arrow/obsidian.c', 'stochastic_arrow/arrowhead'+ext,], - include_dirs=['stochastic_arrow', np.get_include()], + include_dirs=[arrow_dir, np.get_include()], define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')], )] @@ -47,7 +38,7 @@ from Cython.Build import cythonize cython_extensions = cythonize( cython_extensions, - include_path=['stochastic_arrow'], + include_path=[arrow_dir], annotate=True, # to get an HTML code listing ) @@ -59,11 +50,10 @@ author_email='ryan.spangler@gmail.com', url='https://github.com/CovertLab/arrow', license='MIT', - include_dirs=[arrow_dir, np.get_include()], ext_modules=cython_extensions, long_description=long_description, long_description_content_type='text/markdown', - requires=['numpy (>=1.14)', 'six'], + install_requires=['numpy>=1.14', 'six'], classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: MIT License', From 2468066075112d002a520accc106f84c8dfb9632 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 02:32:56 -0800 Subject: [PATCH 03/18] Test cibuildwheel --- .github/workflows/release.yml | 154 ++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3acb3c5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,154 @@ +name: Build and upload to PyPI + +on: + push: + branches: + - master + - numpy2 + release: + types: + - published + +jobs: + # Build the wheels for Linux, Windows and macOS for Python 3.9 and newer + build_wheels: + name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }} + runs-on: ${{ matrix.os }} + strategy: + # Ensure that a wheel builder finishes even if another fails + fail-fast: false + matrix: + include: + # Window 64 bit + - os: windows-latest + python: 39 + platform_id: win_amd64 + - os: windows-latest + python: 310 + platform_id: win_amd64 + - os: windows-latest + python: 311 + platform_id: win_amd64 + - os: windows-latest + python: 312 + platform_id: win_amd64 + - os: windows-latest + python: 313 + platform_id: win_amd64 + - os: windows-latest + python: 313t + platform_id: win_amd64 + free_threaded_support: True + + # Linux 64 bit manylinux2014 + - os: ubuntu-latest + python: 39 + platform_id: manylinux_x86_64 + - os: ubuntu-latest + python: 310 + platform_id: manylinux_x86_64 + - os: ubuntu-latest + python: 311 + platform_id: manylinux_x86_64 + - os: ubuntu-latest + python: 312 + platform_id: manylinux_x86_64 + - os: ubuntu-latest + python: 313 + platform_id: manylinux_x86_64 + - os: ubuntu-latest + python: 313t + platform_id: manylinux_x86_64 + free_threaded_support: True + + # MacOS x86_64 + - os: macos-13 + python: 39 + platform_id: macosx_x86_64 + - os: macos-13 + python: 310 + platform_id: macosx_x86_64 + - os: macos-13 + python: 311 + platform_id: macosx_x86_64 + - os: macos-13 + python: 312 + platform_id: macosx_x86_64 + - os: macos-13 + python: 313 + platform_id: macosx_x86_64 + - os: macos-13 + python: 313t + platform_id: macosx_x86_64 + free_threaded_support: True + + # MacOS arm64 + - os: macos-14 + python: 39 + platform_id: macosx_arm64 + - os: macos-14 + python: 310 + platform_id: macosx_arm64 + - os: macos-14 + python: 311 + platform_id: macosx_arm64 + - os: macos-14 + python: 312 + platform_id: macosx_arm64 + - os: macos-14 + python: 313 + platform_id: macosx_arm64 + - os: macos-14 + python: 313t + platform_id: macosx_arm64 + free_threaded_support: True + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + env: + CIBW_FREE_THREADED_SUPPORT: ${{ matrix.free_threaded_support }} + CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} + CIBW_TEST_REQUIRES: pytest psutil + CIBW_TEST_COMMAND: pytest {package}/test + USE_CYTHON: 1 + uses: pypa/cibuildwheel@v2.22.0 + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ From 92a308a7bf6aaabc321ac202d4dc4eebaaf236d9 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 04:04:20 -0800 Subject: [PATCH 04/18] Fix Windows decoding --- setup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 6f60fe5..52c73b9 100644 --- a/setup.py +++ b/setup.py @@ -3,12 +3,11 @@ import sys import numpy as np - - -with open("README.md", 'r') as readme: - if sys.version_info[0] < 3: +if sys.version_info[0] < 3: + with open("README.md", 'r') as readme: long_description = readme.read().decode('utf-8') - else: +else: + with open("README.md", 'r', encoding="utf-8") as readme: long_description = readme.read() current_dir = os.getcwd() From 9cfc7f939c976247e44fe12518199d8ece91ea5c Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 04:06:29 -0800 Subject: [PATCH 05/18] Fix paths --- setup.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 52c73b9..ccbb463 100644 --- a/setup.py +++ b/setup.py @@ -10,9 +10,6 @@ with open("README.md", 'r', encoding="utf-8") as readme: long_description = readme.read() -current_dir = os.getcwd() -arrow_dir = os.path.join(current_dir, 'stochastic_arrow') - # Compile the Cython code to C for development builds: # USE_CYTHON=1 python -m pip install -e . # and for building source distribution packages: @@ -29,7 +26,7 @@ 'stochastic_arrow/mersenne.c', 'stochastic_arrow/obsidian.c', 'stochastic_arrow/arrowhead'+ext,], - include_dirs=[arrow_dir, np.get_include()], + include_dirs=['stochastic_arrow', np.get_include()], define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')], )] @@ -37,7 +34,7 @@ from Cython.Build import cythonize cython_extensions = cythonize( cython_extensions, - include_path=[arrow_dir], + include_path=['stochastic_arrow'], annotate=True, # to get an HTML code listing ) From 70a8c408bcae1682a881962ca1578f093b877c66 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 04:18:11 -0800 Subject: [PATCH 06/18] Set USE_CYTHON to 1 in wheel builds --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3acb3c5..f4c4450 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -112,7 +112,7 @@ jobs: CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} CIBW_TEST_REQUIRES: pytest psutil CIBW_TEST_COMMAND: pytest {package}/test - USE_CYTHON: 1 + CIBW_ENVIRONMENT: USE_CYTHON=1 uses: pypa/cibuildwheel@v2.22.0 - uses: actions/upload-artifact@v4 From 6601b277403c2054b931dd7b3c76777fbd303181 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 04:20:13 -0800 Subject: [PATCH 07/18] Fix test directory --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4c4450..a35a30d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -111,7 +111,9 @@ jobs: CIBW_FREE_THREADED_SUPPORT: ${{ matrix.free_threaded_support }} CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} CIBW_TEST_REQUIRES: pytest psutil - CIBW_TEST_COMMAND: pytest {package}/test + CIBW_TEST_COMMAND: | + cp -r {project}/stochastic_arrow/test tmp_test_dir/ + pytest tmp_test_dir CIBW_ENVIRONMENT: USE_CYTHON=1 uses: pypa/cibuildwheel@v2.22.0 From 30e8606f7dfd2ff919bf7862db426fc968cb6d02 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 04:50:56 -0800 Subject: [PATCH 08/18] Fix pytests and install pre-release Cython for free-threading support --- .github/workflows/release.yml | 7 +++++-- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a35a30d..a6e148b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -112,8 +112,11 @@ jobs: CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} CIBW_TEST_REQUIRES: pytest psutil CIBW_TEST_COMMAND: | - cp -r {project}/stochastic_arrow/test tmp_test_dir/ - pytest tmp_test_dir + mkdir tmp_test_dir + cp -r {project}/stochastic_arrow/test tmp_test_dir/test + cp -r {project}/data tmp_test_dir/data + cd tmp_test_dir + pytest CIBW_ENVIRONMENT: USE_CYTHON=1 uses: pypa/cibuildwheel@v2.22.0 diff --git a/pyproject.toml b/pyproject.toml index efa310c..c34e725 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "wheel", "cython", "numpy"] +requires = ["setuptools", "wheel", "cython==3.1.0a1; python_version=='3.13'", "cython; python_version!='3.13'", "numpy"] build-backend = "setuptools.build_meta" From c05b4066b7db3457f33acaa44c9b7e6582a64222 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 05:11:38 -0800 Subject: [PATCH 09/18] Try marking freethreading compatible --- stochastic_arrow/arrow.pxd | 1 + stochastic_arrow/arrowhead.pyx | 1 + stochastic_arrow/mersenne.pxd | 1 + stochastic_arrow/obsidian.pxd | 1 + 4 files changed, 4 insertions(+) diff --git a/stochastic_arrow/arrow.pxd b/stochastic_arrow/arrow.pxd index a5b4559..172af76 100644 --- a/stochastic_arrow/arrow.pxd +++ b/stochastic_arrow/arrow.pxd @@ -1,4 +1,5 @@ # cython: language_level=3str +# cython: freethreading_compatible = True # This file works around a Cython 3.0.0a1+ error on arrowhead.pyx: # stochastic_arrow/arrowhead.pyx:14:0: 'arrow.pxd' not found diff --git a/stochastic_arrow/arrowhead.pyx b/stochastic_arrow/arrowhead.pyx index ddd0e94..902680c 100644 --- a/stochastic_arrow/arrowhead.pyx +++ b/stochastic_arrow/arrowhead.pyx @@ -1,4 +1,5 @@ # cython: language_level=3str +# cython: freethreading_compatible = True from __future__ import absolute_import, division, print_function diff --git a/stochastic_arrow/mersenne.pxd b/stochastic_arrow/mersenne.pxd index 5e70d0a..94f4d05 100644 --- a/stochastic_arrow/mersenne.pxd +++ b/stochastic_arrow/mersenne.pxd @@ -1,4 +1,5 @@ # cython: language_level=3str +# cython: freethreading_compatible = True from libc.stdint cimport uint32_t diff --git a/stochastic_arrow/obsidian.pxd b/stochastic_arrow/obsidian.pxd index 16981df..ea5a943 100644 --- a/stochastic_arrow/obsidian.pxd +++ b/stochastic_arrow/obsidian.pxd @@ -1,4 +1,5 @@ # cython: language_level=3str +# cython: freethreading_compatible = True from libc.stdint cimport int64_t, uint32_t From 93af1c8222188a366a0537651a9e1d6ab34f39e9 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 05:13:21 -0800 Subject: [PATCH 10/18] Ignore memory increases on macOS --- stochastic_arrow/test/test_arrow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stochastic_arrow/test/test_arrow.py b/stochastic_arrow/test/test_arrow.py index db14eae..245682c 100644 --- a/stochastic_arrow/test/test_arrow.py +++ b/stochastic_arrow/test/test_arrow.py @@ -224,7 +224,7 @@ def test_memory(): print('obsidian C implementation elapsed seconds for {} runs: {}'.format( amplify, obsidian_end - obsidian_start)) - if platform.system() == 'Windows': + if platform.system() == 'Windows' or platform.system() == 'Darwin': assert memory_increases <= 10 else: assert memory_increases <= 1 From 088d8ab81f652d16ebb5ecc98bb30651f65e0be8 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 12:06:29 -0800 Subject: [PATCH 11/18] Fix Windows test command --- .github/workflows/release.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6e148b..dfbbb5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,9 +2,6 @@ name: Build and upload to PyPI on: push: - branches: - - master - - numpy2 release: types: - published @@ -117,6 +114,16 @@ jobs: cp -r {project}/data tmp_test_dir/data cd tmp_test_dir pytest + CIBW_TEST_COMMAND_WINDOWS: | + echo "Starting tests on Windows"; + mkdir tmp_test_dir; + echo "Copying test directory"; + xcopy /E /I /Y stochastic_arrow\test tmp_test_dir\test; + echo "Copying data directory"; + xcopy /E /I /Y stochastic_arrow\data tmp_test_dir\data; + cd tmp_test_dir; + echo "Running pytest on Windows"; + pytest -v CIBW_ENVIRONMENT: USE_CYTHON=1 uses: pypa/cibuildwheel@v2.22.0 From b6c46a1809ca53528e49f866c8b7f837bae62226 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 13:52:55 -0800 Subject: [PATCH 12/18] Test publish --- .github/workflows/release.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dfbbb5b..f197b46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -149,10 +149,30 @@ jobs: upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest - environment: pypi + environment: + name: pypi + url: https://pypi.org/p/stochastic-arrow permissions: id-token: write if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + + upload_pypi_test: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/stochastic-arrow + permissions: + id-token: write steps: - uses: actions/download-artifact@v4 with: From b2f25fd8644d9f1f4d3b43a8cf44098bde655b77 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 15:26:06 -0800 Subject: [PATCH 13/18] Reorganize code into src folder to avoid import issues --- .github/workflows/release.yml | 17 +---------------- .gitignore | 6 +++--- MANIFEST.in | 4 ++-- Makefile | 4 +++- .../analysis => analysis}/__init__.py | 0 .../analysis => analysis}/distributions.py | 0 .../analysis => analysis}/plotting.py | 0 setup.py | 17 ++++++++++------- .../stochastic_arrow}/__init__.py | 0 .../stochastic_arrow}/arrow.pxd | 0 .../stochastic_arrow}/arrow.py | 0 .../stochastic_arrow}/arrowhead.pyx | 0 .../stochastic_arrow}/math.py | 0 .../stochastic_arrow}/mersenne.c | 0 .../stochastic_arrow}/mersenne.h | 0 .../stochastic_arrow}/mersenne.pxd | 0 .../stochastic_arrow}/obsidian.c | 0 .../stochastic_arrow}/obsidian.h | 0 .../stochastic_arrow}/obsidian.pxd | 0 .../stochastic_arrow}/reference.py | 0 {stochastic_arrow/test => test}/__init__.py | 0 .../test => test}/complex-counts.npy | Bin .../test => test}/negative_counts.py | 0 {stochastic_arrow/test => test}/rates.npy | Bin {stochastic_arrow/test => test}/stoich.npy | Bin {stochastic_arrow/test => test}/test_arrow.py | 0 {stochastic_arrow/test => test}/test_hang.py | 0 27 files changed, 19 insertions(+), 29 deletions(-) rename {stochastic_arrow/analysis => analysis}/__init__.py (100%) rename {stochastic_arrow/analysis => analysis}/distributions.py (100%) rename {stochastic_arrow/analysis => analysis}/plotting.py (100%) rename {stochastic_arrow => src/stochastic_arrow}/__init__.py (100%) rename {stochastic_arrow => src/stochastic_arrow}/arrow.pxd (100%) rename {stochastic_arrow => src/stochastic_arrow}/arrow.py (100%) rename {stochastic_arrow => src/stochastic_arrow}/arrowhead.pyx (100%) rename {stochastic_arrow => src/stochastic_arrow}/math.py (100%) rename {stochastic_arrow => src/stochastic_arrow}/mersenne.c (100%) rename {stochastic_arrow => src/stochastic_arrow}/mersenne.h (100%) rename {stochastic_arrow => src/stochastic_arrow}/mersenne.pxd (100%) rename {stochastic_arrow => src/stochastic_arrow}/obsidian.c (100%) rename {stochastic_arrow => src/stochastic_arrow}/obsidian.h (100%) rename {stochastic_arrow => src/stochastic_arrow}/obsidian.pxd (100%) rename {stochastic_arrow => src/stochastic_arrow}/reference.py (100%) rename {stochastic_arrow/test => test}/__init__.py (100%) rename {stochastic_arrow/test => test}/complex-counts.npy (100%) rename {stochastic_arrow/test => test}/negative_counts.py (100%) rename {stochastic_arrow/test => test}/rates.npy (100%) rename {stochastic_arrow/test => test}/stoich.npy (100%) rename {stochastic_arrow/test => test}/test_arrow.py (100%) rename {stochastic_arrow/test => test}/test_hang.py (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f197b46..d72bd3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,22 +108,7 @@ jobs: CIBW_FREE_THREADED_SUPPORT: ${{ matrix.free_threaded_support }} CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} CIBW_TEST_REQUIRES: pytest psutil - CIBW_TEST_COMMAND: | - mkdir tmp_test_dir - cp -r {project}/stochastic_arrow/test tmp_test_dir/test - cp -r {project}/data tmp_test_dir/data - cd tmp_test_dir - pytest - CIBW_TEST_COMMAND_WINDOWS: | - echo "Starting tests on Windows"; - mkdir tmp_test_dir; - echo "Copying test directory"; - xcopy /E /I /Y stochastic_arrow\test tmp_test_dir\test; - echo "Copying data directory"; - xcopy /E /I /Y stochastic_arrow\data tmp_test_dir\data; - cd tmp_test_dir; - echo "Running pytest on Windows"; - pytest -v + CIBW_TEST_COMMAND: pytest -v {project}/test CIBW_ENVIRONMENT: USE_CYTHON=1 uses: pypa/cibuildwheel@v2.22.0 diff --git a/.gitignore b/.gitignore index 5352095..4fa54bf 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,9 @@ profile /.idea/ /tmp/ -stochastic_arrow/arrowhead.c -stochastic_arrow/arrowhead.*.pyd -stochastic_arrow/*.html +src/stochastic_arrow/arrowhead.c +src/stochastic_arrow/arrowhead.*.pyd +src/stochastic_arrow/*.html arrow.egg-info/ stochastic_arrow.egg-info/ diff --git a/MANIFEST.in b/MANIFEST.in index 1f4aaf8..2c1e001 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ -include stochastic_arrow/obsidian.h -include stochastic_arrow/mersenne.h \ No newline at end of file +include src/stochastic_arrow/obsidian.h +include src/stochastic_arrow/mersenne.h \ No newline at end of file diff --git a/Makefile b/Makefile index 6171f2c..49cdf4e 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,11 @@ .DEFAULT_GOAL := compile clean: - ### Files for older versions of stochastic_arrow are in arrow folder + ### Files for older versions of stochastic_arrow are in arrow or stochastic_arrow folder rm -rf arrow/arrowhead*.so arrow/arrowhead.c arrow/arrowhead.html rm -rf stochastic_arrow/arrowhead*.so stochastic_arrow/arrowhead.c stochastic_arrow/arrowhead.html build/ dist/ MANIFEST .pytest_cache/ stochastic_arrow.egg-info/ + ### Newer versions of stochastic_arrow are in src/stochastic_arrow folder + rm -rf src/stochastic_arrow/arrowhead*.so src/stochastic_arrow/arrowhead.c src/stochastic_arrow/arrowhead.html src/stochastic_arrow.egg-info/ find . -name "*.pyc" -delete find . -name "__pycache__" -delete diff --git a/stochastic_arrow/analysis/__init__.py b/analysis/__init__.py similarity index 100% rename from stochastic_arrow/analysis/__init__.py rename to analysis/__init__.py diff --git a/stochastic_arrow/analysis/distributions.py b/analysis/distributions.py similarity index 100% rename from stochastic_arrow/analysis/distributions.py rename to analysis/distributions.py diff --git a/stochastic_arrow/analysis/plotting.py b/analysis/plotting.py similarity index 100% rename from stochastic_arrow/analysis/plotting.py rename to analysis/plotting.py diff --git a/setup.py b/setup.py index ccbb463..0d554dd 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ import os -from setuptools import Extension, setup +from setuptools import Extension, find_packages, setup import sys import numpy as np @@ -20,13 +20,15 @@ ext = '.pyx' if USE_CYTHON else '.c' +arrow_dir = os.path.join('src', 'stochastic_arrow') + cython_extensions = [ Extension('stochastic_arrow.arrowhead', sources=[ - 'stochastic_arrow/mersenne.c', - 'stochastic_arrow/obsidian.c', - 'stochastic_arrow/arrowhead'+ext,], - include_dirs=['stochastic_arrow', np.get_include()], + os.path.join(arrow_dir, 'mersenne.c'), + os.path.join(arrow_dir, 'obsidian.c'), + os.path.join(arrow_dir, 'arrowhead'+ext),], + include_dirs=[arrow_dir, np.get_include()], define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')], )] @@ -34,14 +36,15 @@ from Cython.Build import cythonize cython_extensions = cythonize( cython_extensions, - include_path=['stochastic_arrow'], + include_path=[arrow_dir], annotate=True, # to get an HTML code listing ) setup( name='stochastic-arrow', version='1.0.0', - packages=['stochastic_arrow'], + packages=find_packages('src'), + package_dir={'': 'src'}, author='Ryan Spangler, John Mason, Jerry Morrison, Chris Skalnik, Travis Ahn-Horst, Sean Cheah', author_email='ryan.spangler@gmail.com', url='https://github.com/CovertLab/arrow', diff --git a/stochastic_arrow/__init__.py b/src/stochastic_arrow/__init__.py similarity index 100% rename from stochastic_arrow/__init__.py rename to src/stochastic_arrow/__init__.py diff --git a/stochastic_arrow/arrow.pxd b/src/stochastic_arrow/arrow.pxd similarity index 100% rename from stochastic_arrow/arrow.pxd rename to src/stochastic_arrow/arrow.pxd diff --git a/stochastic_arrow/arrow.py b/src/stochastic_arrow/arrow.py similarity index 100% rename from stochastic_arrow/arrow.py rename to src/stochastic_arrow/arrow.py diff --git a/stochastic_arrow/arrowhead.pyx b/src/stochastic_arrow/arrowhead.pyx similarity index 100% rename from stochastic_arrow/arrowhead.pyx rename to src/stochastic_arrow/arrowhead.pyx diff --git a/stochastic_arrow/math.py b/src/stochastic_arrow/math.py similarity index 100% rename from stochastic_arrow/math.py rename to src/stochastic_arrow/math.py diff --git a/stochastic_arrow/mersenne.c b/src/stochastic_arrow/mersenne.c similarity index 100% rename from stochastic_arrow/mersenne.c rename to src/stochastic_arrow/mersenne.c diff --git a/stochastic_arrow/mersenne.h b/src/stochastic_arrow/mersenne.h similarity index 100% rename from stochastic_arrow/mersenne.h rename to src/stochastic_arrow/mersenne.h diff --git a/stochastic_arrow/mersenne.pxd b/src/stochastic_arrow/mersenne.pxd similarity index 100% rename from stochastic_arrow/mersenne.pxd rename to src/stochastic_arrow/mersenne.pxd diff --git a/stochastic_arrow/obsidian.c b/src/stochastic_arrow/obsidian.c similarity index 100% rename from stochastic_arrow/obsidian.c rename to src/stochastic_arrow/obsidian.c diff --git a/stochastic_arrow/obsidian.h b/src/stochastic_arrow/obsidian.h similarity index 100% rename from stochastic_arrow/obsidian.h rename to src/stochastic_arrow/obsidian.h diff --git a/stochastic_arrow/obsidian.pxd b/src/stochastic_arrow/obsidian.pxd similarity index 100% rename from stochastic_arrow/obsidian.pxd rename to src/stochastic_arrow/obsidian.pxd diff --git a/stochastic_arrow/reference.py b/src/stochastic_arrow/reference.py similarity index 100% rename from stochastic_arrow/reference.py rename to src/stochastic_arrow/reference.py diff --git a/stochastic_arrow/test/__init__.py b/test/__init__.py similarity index 100% rename from stochastic_arrow/test/__init__.py rename to test/__init__.py diff --git a/stochastic_arrow/test/complex-counts.npy b/test/complex-counts.npy similarity index 100% rename from stochastic_arrow/test/complex-counts.npy rename to test/complex-counts.npy diff --git a/stochastic_arrow/test/negative_counts.py b/test/negative_counts.py similarity index 100% rename from stochastic_arrow/test/negative_counts.py rename to test/negative_counts.py diff --git a/stochastic_arrow/test/rates.npy b/test/rates.npy similarity index 100% rename from stochastic_arrow/test/rates.npy rename to test/rates.npy diff --git a/stochastic_arrow/test/stoich.npy b/test/stoich.npy similarity index 100% rename from stochastic_arrow/test/stoich.npy rename to test/stoich.npy diff --git a/stochastic_arrow/test/test_arrow.py b/test/test_arrow.py similarity index 100% rename from stochastic_arrow/test/test_arrow.py rename to test/test_arrow.py diff --git a/stochastic_arrow/test/test_hang.py b/test/test_hang.py similarity index 100% rename from stochastic_arrow/test/test_hang.py rename to test/test_hang.py From b793f568239e6b3b66c5c72365665bcdc9a3a7e6 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 15:37:45 -0800 Subject: [PATCH 14/18] Fix data dir for pytest --- {data => test/data}/complexation/beginning-final.json | 0 {data => test/data}/complexation/beginning-initial.json | 0 {data => test/data}/complexation/large-initial.json | 0 {data => test/data}/complexation/simple-final.json | 0 {data => test/data}/complexation/simple-initial.json | 0 {data => test/data}/complexation/stoichiometry.json | 0 test/negative_counts.py | 6 +++++- test/test_arrow.py | 2 +- 8 files changed, 6 insertions(+), 2 deletions(-) rename {data => test/data}/complexation/beginning-final.json (100%) rename {data => test/data}/complexation/beginning-initial.json (100%) rename {data => test/data}/complexation/large-initial.json (100%) rename {data => test/data}/complexation/simple-final.json (100%) rename {data => test/data}/complexation/simple-initial.json (100%) rename {data => test/data}/complexation/stoichiometry.json (100%) diff --git a/data/complexation/beginning-final.json b/test/data/complexation/beginning-final.json similarity index 100% rename from data/complexation/beginning-final.json rename to test/data/complexation/beginning-final.json diff --git a/data/complexation/beginning-initial.json b/test/data/complexation/beginning-initial.json similarity index 100% rename from data/complexation/beginning-initial.json rename to test/data/complexation/beginning-initial.json diff --git a/data/complexation/large-initial.json b/test/data/complexation/large-initial.json similarity index 100% rename from data/complexation/large-initial.json rename to test/data/complexation/large-initial.json diff --git a/data/complexation/simple-final.json b/test/data/complexation/simple-final.json similarity index 100% rename from data/complexation/simple-final.json rename to test/data/complexation/simple-final.json diff --git a/data/complexation/simple-initial.json b/test/data/complexation/simple-initial.json similarity index 100% rename from data/complexation/simple-initial.json rename to test/data/complexation/simple-initial.json diff --git a/data/complexation/stoichiometry.json b/test/data/complexation/stoichiometry.json similarity index 100% rename from data/complexation/stoichiometry.json rename to test/data/complexation/stoichiometry.json diff --git a/test/negative_counts.py b/test/negative_counts.py index 6f2209f..5a314ee 100644 --- a/test/negative_counts.py +++ b/test/negative_counts.py @@ -1,4 +1,5 @@ import json +import os from stochastic_arrow import StochasticSystem import numpy as np @@ -6,7 +7,10 @@ duration = 2**31 -with open('data/complexation/large-initial.json') as f: +# Build the path to the data file relative to the script's directory +data_path = os.path.join(os.path.dirname(__file__), 'data', 'complexation', 'large-initial.json') + +with open(data_path) as f: data = json.load(f) stoich = np.array(data['stoich']) diff --git a/test/test_arrow.py b/test/test_arrow.py index 245682c..918e583 100644 --- a/test/test_arrow.py +++ b/test/test_arrow.py @@ -84,7 +84,7 @@ def test_dimerization(): def load_complexation(prefix='simple'): - fixtures_root = os.path.join('data', 'complexation') + fixtures_root = os.path.join(os.path.dirname(__file__), 'data', 'complexation') def load_state(filename): with open(os.path.join(fixtures_root, filename)) as f: From 3589de18424953375a05a9e4416d8077168d9393 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Thu, 5 Dec 2024 15:48:09 -0800 Subject: [PATCH 15/18] v1.1.0 --- README.md | 5 +++++ setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7885bb9..1f6ce05 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,11 @@ More examples: ## Changelog +### Version 1.1.0 +* Update build toolchain and automatically build/publish wheels for all +major platforms and recent Python versions. +* Build wheels with Numpy 2+ support + ### Version 1.0.0 * Rename module to `stochastic_arrow` to avoid name conflict (Issue #51). **All users must update their import statements to use `stochastic_arrow` instead of `arrow`.** diff --git a/setup.py b/setup.py index 0d554dd..2706347 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ setup( name='stochastic-arrow', - version='1.0.0', + version='1.1.0', packages=find_packages('src'), package_dir={'': 'src'}, author='Ryan Spangler, John Mason, Jerry Morrison, Chris Skalnik, Travis Ahn-Horst, Sean Cheah', From 8a8c67a81dce0d361d5424d711d07da003e1be96 Mon Sep 17 00:00:00 2001 From: Jerry Morrison <1fish2@users.noreply.github.com> Date: Fri, 6 Dec 2024 22:50:23 -0800 Subject: [PATCH 16/18] Fix the CLI test runner * Fix the clunky CLI test runner. * Update the README about it. * The `--plot` test requires installing matplotlib, in particular, one that's compatible with the installed numpy. * Moved the `analysis/` directory into the `test/` directory for the tests to import. * TODO: Fix the `--memory` test, which fails `assert memory_increases <= 10` on macOS. * TODO: Fix the `--plot` test, which raises `ValueError: x and y must have same first dimension, but have shapes (115,) and (114, 2469)` from matplotlib. * Delete `release.sh` which would be risky to run now and has been supplanted by GitHub Actions. Actually my process was to copy/paste from this script rather than run it as is. Q. Do *.pxd header files need `freethreading_compatible = True` or is it sufficient in the .pyx module? --- Makefile | 3 ++ README.md | 37 ++++++++++----- optional_requirements.txt | 2 +- release.sh | 50 -------------------- {analysis => test/analysis}/__init__.py | 0 {analysis => test/analysis}/distributions.py | 2 +- {analysis => test/analysis}/plotting.py | 0 test/test_arrow.py | 7 +-- 8 files changed, 33 insertions(+), 68 deletions(-) delete mode 100755 release.sh rename {analysis => test/analysis}/__init__.py (100%) rename {analysis => test/analysis}/distributions.py (97%) rename {analysis => test/analysis}/plotting.py (100%) diff --git a/Makefile b/Makefile index 49cdf4e..67deef3 100644 --- a/Makefile +++ b/Makefile @@ -13,5 +13,8 @@ clean: compile: USE_CYTHON=1 python -m pip install -e . +test: clean compile + pytest test + dist: USE_CYTHON=1 python -m build --sdist diff --git a/README.md b/README.md index 1f6ce05..1cdd3eb 100644 --- a/README.md +++ b/README.md @@ -91,32 +91,43 @@ from stochastic_arrow import reenact_events history = reenact_events(stoichiometric_matrix, result['events'], state) ``` -## Testing - -`stochastic_arrow` uses [pytest](https://docs.pytest.org/en/latest/). To test it: +## Building > make clean compile - > pytest + +This builds the extension package and installs it in editable mode. **NOTE:** `make compile` without an explicit `clean` might not fully build the extension. -There are more command line features in test_arrow: +## Testing - > python -m stochastic_arrow.test.test_arrow --complexation +`stochastic_arrow` uses [pytest](https://docs.pytest.org/en/latest/). +To run the main tests, in the source tree: - > python -m stochastic_arrow.test.test_arrow --plot + > make test - > python -m stochastic_arrow.test.test_arrow --obsidian +or - > python -m stochastic_arrow.test.test_arrow --memory + > pytest - > python -m stochastic_arrow.test.test_arrow --time +There are additional command line features in test_arrow: -More examples: + > python -m test.test_arrow --help + > python -m test.test_arrow --complexation + > python -m test.test_arrow --complexation --runs 3 + > python -m test.test_arrow --obsidian + > python -m test.test_arrow --memory + > python -m test.test_arrow --time + > python -m test.test_arrow --pickle + > python -m test.test_arrow --test-fail-flagella + > python -m test.test_arrow --test-fail-stdout + > python -m test.test_hang - > python -m stochastic_arrow.test.test_hang +This test requires installing a version of matplotlib that's compatible with the installed numpy: - > pytest -m stochastic_arrow/test/test_arrow.py + > python -m test.test_arrow --plot + +More examples: > pytest -k flagella diff --git a/optional_requirements.txt b/optional_requirements.txt index ae9e316..6ccafc3 100644 --- a/optional_requirements.txt +++ b/optional_requirements.txt @@ -1 +1 @@ -matplotlib==2.2.3 +matplotlib diff --git a/release.sh b/release.sh deleted file mode 100755 index b7d9cad..0000000 --- a/release.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Build a new release including a git tag and and publish it to PyPI. -# Do some basic checks to avoid mistakes. -# -# Usage: ./release.sh 0.1.0 - -set -eu - -version=$1 - -# Check the version number. -setup_py_version="$(python setup.py --version)" -if [ "$setup_py_version" != "$version" ]; then - echo "setup.py has version `$setup_py_version`, not `$version`." - echo "Aborting." - exit 1 -fi - -# Check that the working directory is clean. -if [ ! -z "$(git status --untracked-files=no --porcelain)" ]; then - echo "You have uncommitted git changes." - echo "Aborting." - exit 1 -fi - -# Check that we are on master. -branch="$(git rev-parse --abbrev-ref HEAD)" -if [ "$branch" != "master" ]; then - echo "You are on git branch `$branch` but should release from `master`." - echo "Aborting." - exit 1 -fi - -# Create and push a git tag. -git tag -m "Version v$version" "v$version" -git push --tags - -# Compile and test, allowing test failures. -make clean compile -set +e -pytest -set -e - -# Create and publish the package. -rm -rf dist build *.egg-info -python setup.py sdist -twine upload dist/* - -echo "Version v$version has been published on PyPI and has a git tag." -echo "Please make a GitHub Release from that tag." diff --git a/analysis/__init__.py b/test/analysis/__init__.py similarity index 100% rename from analysis/__init__.py rename to test/analysis/__init__.py diff --git a/analysis/distributions.py b/test/analysis/distributions.py similarity index 97% rename from analysis/distributions.py rename to test/analysis/distributions.py index c7eaf02..b430f6c 100644 --- a/analysis/distributions.py +++ b/test/analysis/distributions.py @@ -96,7 +96,7 @@ def _last_where(bool_array): if __name__ == '__main__': import matplotlib.pyplot as plt - from stochastic_arrow.analysis.plotting import plot_full_history + from .plotting import plot_full_history (fig, axes) = plt.subplots(constrained_layout = True) diff --git a/analysis/plotting.py b/test/analysis/plotting.py similarity index 100% rename from analysis/plotting.py rename to test/analysis/plotting.py diff --git a/test/test_arrow.py b/test/test_arrow.py index 918e583..ffc00f4 100644 --- a/test/test_arrow.py +++ b/test/test_arrow.py @@ -378,7 +378,7 @@ def check_gillespie_reference(): system() else: import matplotlib.pyplot as plt - from stochastic_arrow.analysis.plotting import plot_full_history + from .analysis.plotting import plot_full_history n_systems = len(systems) @@ -412,9 +412,10 @@ def check_gillespie_reference(): if __name__ == '__main__': parser = argparse.ArgumentParser( - description='Run one of these tests') + description='Run the specified test or some default tests') parser.add_argument('--complexation', action='store_true') - parser.add_argument('--runs', type=int, default=1) + parser.add_argument('--runs', type=int, default=1, + help='an option for complexation') parser.add_argument('--plot', action='store_true') parser.add_argument('--obsidian', action='store_true') parser.add_argument('--memory', action='store_true') From 059538585fe876c9707d454f228dcbcf72f9f777 Mon Sep 17 00:00:00 2001 From: thalassemia Date: Sun, 8 Dec 2024 01:09:08 -0800 Subject: [PATCH 17/18] Remove unnecessary Cython directives --- src/stochastic_arrow/arrow.pxd | 5 +---- src/stochastic_arrow/mersenne.pxd | 3 --- src/stochastic_arrow/obsidian.pxd | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/stochastic_arrow/arrow.pxd b/src/stochastic_arrow/arrow.pxd index 172af76..2d8bce5 100644 --- a/src/stochastic_arrow/arrow.pxd +++ b/src/stochastic_arrow/arrow.pxd @@ -1,5 +1,2 @@ -# cython: language_level=3str -# cython: freethreading_compatible = True - -# This file works around a Cython 3.0.0a1+ error on arrowhead.pyx: +# This file works around a Cython 3.0.0a1 error on arrowhead.pyx: # stochastic_arrow/arrowhead.pyx:14:0: 'arrow.pxd' not found diff --git a/src/stochastic_arrow/mersenne.pxd b/src/stochastic_arrow/mersenne.pxd index 94f4d05..c9e24cb 100644 --- a/src/stochastic_arrow/mersenne.pxd +++ b/src/stochastic_arrow/mersenne.pxd @@ -1,6 +1,3 @@ -# cython: language_level=3str -# cython: freethreading_compatible = True - from libc.stdint cimport uint32_t diff --git a/src/stochastic_arrow/obsidian.pxd b/src/stochastic_arrow/obsidian.pxd index ea5a943..612bfb4 100644 --- a/src/stochastic_arrow/obsidian.pxd +++ b/src/stochastic_arrow/obsidian.pxd @@ -1,6 +1,3 @@ -# cython: language_level=3str -# cython: freethreading_compatible = True - from libc.stdint cimport int64_t, uint32_t from mersenne cimport MTState From 5fc79dbe9ab890fb81120e9444b2e5f91a78c51c Mon Sep 17 00:00:00 2001 From: thalassemia Date: Wed, 11 Dec 2024 16:59:03 -0800 Subject: [PATCH 18/18] Remove TestPyPI CI job --- .github/workflows/release.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d72bd3a..d89c5ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -149,23 +149,3 @@ jobs: merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 - - upload_pypi_test: - needs: [build_wheels, build_sdist] - runs-on: ubuntu-latest - environment: - name: testpypi - url: https://test.pypi.org/p/stochastic-arrow - permissions: - id-token: write - steps: - - uses: actions/download-artifact@v4 - with: - # unpacks all CIBW artifacts into dist/ - pattern: cibw-* - path: dist - merge-multiple: true - - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/