From 3da9712e390b2e147743219917339bc5257a15a0 Mon Sep 17 00:00:00 2001 From: whitews Date: Fri, 15 Sep 2023 13:58:25 -0400 Subject: [PATCH 01/26] try oldest-supported-numpy for compatible build ABI --- .github/workflows/wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8cca4d7..ec41960 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -26,7 +26,7 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BEFORE_BUILD: | - pip install numpy==1.21.6 + pip install oldest-supported-numpy pip freeze CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 *-win32 # skip PyPy, musllinux, 32-bit Linux & win32 builds CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* @@ -58,7 +58,7 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_BEFORE_BUILD: pip install numpy==1.21.6 + CIBW_BEFORE_BUILD: pip install oldest-supported-numpy CIBW_SKIP: pp* # skip PyPy CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* # Only Python 3.8 - 3.11 CIBW_ARCHS_MACOS: arm64 # Only arm64 for Apple Silicon builds From 8cb41990f8b5342300f080be9d59a252524e4491 Mon Sep 17 00:00:00 2001 From: whitews Date: Fri, 15 Sep 2023 14:26:55 -0400 Subject: [PATCH 02/26] maybe need to add python-version --- .github/workflows/wheels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ec41960..8aa6389 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -18,6 +18,8 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 + with: + python-version: 3.11 - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.15.0 From 1cb648a172fbe4c8e4816493a7a608fa1fe44a7d Mon Sep 17 00:00:00 2001 From: whitews Date: Fri, 15 Sep 2023 14:29:56 -0400 Subject: [PATCH 03/26] maybe need to add python-version attempt #2 --- .github/workflows/wheels.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8aa6389..5caa024 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -53,6 +53,8 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 + with: + python-version: 3.11 - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.15.0 @@ -82,6 +84,8 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 + with: + python-version: 3.11 - name: Run sdist run: python setup.py sdist From 42280fa6cedf3eefb6f10ae42180aa2cf0b64164 Mon Sep 17 00:00:00 2001 From: whitews Date: Fri, 15 Sep 2023 15:39:40 -0400 Subject: [PATCH 04/26] remove numpy install setup (causing build issues) --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c13173d..bfbbced 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,8 @@ # NumPy is needed to build # This retrieves a version at build time compatible with run time version -dist.Distribution().fetch_build_eggs(['numpy>=1.19']) +# TODO: commented out below, need to replace w/ pyproject.toml +# dist.Distribution().fetch_build_eggs(['oldest-supported-numpy']) # override inspection for import not at top of file # this has to be imported here, after fetching the NumPy egg From defaa211c44192044a54f84e58663cc607784ff7 Mon Sep 17 00:00:00 2001 From: whitews Date: Sat, 16 Sep 2023 17:54:37 -0400 Subject: [PATCH 05/26] fix sdist & remove legacy mac from builds, can cross-compile using macos-12 --- .github/workflows/wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5caa024..733e341 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-2022, macos-10.15] + os: [ubuntu-22.04, windows-2022] steps: - name: Checkout @@ -65,7 +65,7 @@ jobs: CIBW_BEFORE_BUILD: pip install oldest-supported-numpy CIBW_SKIP: pp* # skip PyPy CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* # Only Python 3.8 - 3.11 - CIBW_ARCHS_MACOS: arm64 # Only arm64 for Apple Silicon builds + CIBW_ARCHS_MACOS: x86_64 arm64 - name: Store artifacts uses: actions/upload-artifact@v3 @@ -88,7 +88,7 @@ jobs: python-version: 3.11 - name: Run sdist - run: python setup.py sdist + run: python -m build --sdist - name: Store artifacts uses: actions/upload-artifact@v3 From 8a440b9b37dec4f3a85b4fedb387994e704f9fd7 Mon Sep 17 00:00:00 2001 From: whitews Date: Sat, 16 Sep 2023 17:55:33 -0400 Subject: [PATCH 06/26] add pyproject.toml to fix numpy build dep --- pyproject.toml | 3 +++ setup.py | 15 ++++----------- 2 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..15abcf4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ['setuptools>=61.0', 'oldest-supported-numpy'] +build-backend = 'setuptools.build_meta' diff --git a/setup.py b/setup.py index bfbbced..ba728b5 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,8 @@ """ Setup script for the FlowUtils package """ -from setuptools import setup, Extension, dist +from setuptools import setup, Extension +import numpy as np # NumPy is needed to build C extensions # read in version string VERSION_FILE = 'flowutils/_version.py' @@ -11,15 +12,6 @@ if __version__ is None: raise RuntimeError("__version__ string not found in file %s" % VERSION_FILE) -# NumPy is needed to build -# This retrieves a version at build time compatible with run time version -# TODO: commented out below, need to replace w/ pyproject.toml -# dist.Distribution().fetch_build_eggs(['oldest-supported-numpy']) - -# override inspection for import not at top of file -# this has to be imported here, after fetching the NumPy egg -import numpy as np # noqa: E402 - with open("README.md", "r") as fh: long_description = fh.read() @@ -45,7 +37,7 @@ setup( name='FlowUtils', - version=__version__, + version=__version__, # noqa PyTypeChecker packages=['flowutils'], package_data={'': []}, description='Flow Cytometry Standard Utilities', @@ -58,6 +50,7 @@ ext_modules=[logicle_extension, gating_extension], install_requires=['numpy>=1.20'], classifiers=[ + 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.8', From f4e7bb20a923cfaaeac4bc53d8ec7ad87a54df70 Mon Sep 17 00:00:00 2001 From: whitews Date: Sat, 16 Sep 2023 18:22:36 -0400 Subject: [PATCH 07/26] change RTD theme, add docs reqs --- docs/conf.py | 2 +- docs/requirements.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 docs/requirements.txt diff --git a/docs/conf.py b/docs/conf.py index 5262a3b..e5d425e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -72,7 +72,7 @@ def __getattr__(cls, name): # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'sphinx_rtd_theme' html_theme_options = { # 'logo': 'flowutils.png', diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..ab10d83 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +Sphinx==6.2.1 +autoclasstoc +nbsphinx +sphinx_rtd_theme==1.2.1 \ No newline at end of file From 4918ba27984049b545e3ae2e4c9ac258afea6a93 Mon Sep 17 00:00:00 2001 From: whitews Date: Sat, 16 Sep 2023 18:33:02 -0400 Subject: [PATCH 08/26] fix docs reqs --- docs/requirements.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index ab10d83..46f4034 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1 @@ -Sphinx==6.2.1 -autoclasstoc -nbsphinx sphinx_rtd_theme==1.2.1 \ No newline at end of file From 97984b41d3ed51e5652526496cbae153342aab40 Mon Sep 17 00:00:00 2001 From: whitews Date: Sat, 16 Sep 2023 18:53:13 -0400 Subject: [PATCH 09/26] RTD yaml --- .readthedocs.yaml | 17 +++++++++++++++++ docs/requirements.txt | 1 + 2 files changed, 18 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..52e6f8c --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.10" + +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . + extra_requirements: + - docs + +sphinx: + configuration: docs/conf.py \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 46f4034..06153a5 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,2 @@ +Sphinx==6.2.1 sphinx_rtd_theme==1.2.1 \ No newline at end of file From 6711fa7502844ca0d1d15f5e00ab9b14f9e2b2bd Mon Sep 17 00:00:00 2001 From: whitews Date: Wed, 27 Sep 2023 11:46:13 -0400 Subject: [PATCH 10/26] trying re-usable workflow --- .github/workflows/build-test-base.yml | 41 +++++++++++++++++++++++++++ .github/workflows/tests_master.yml | 38 ++----------------------- 2 files changed, 43 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/build-test-base.yml diff --git a/.github/workflows/build-test-base.yml b/.github/workflows/build-test-base.yml new file mode 100644 index 0000000..14e001b --- /dev/null +++ b/.github/workflows/build-test-base.yml @@ -0,0 +1,41 @@ +name: Build & test + +on: + workflow_call: + +jobs: + test: + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + platform: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{matrix.platform}} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - run: | + pip install --upgrade pip setuptools wheel + pip install coverage + pip install . + + - name: Run tests with coverage + run: | + coverage run --source flowutils --omit="flowutils/tests/*" run_tests.py + coverage xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: coverage.xml + fail_ci_if_error: true + verbose: true diff --git a/.github/workflows/tests_master.yml b/.github/workflows/tests_master.yml index c4cb6e8..9db701a 100644 --- a/.github/workflows/tests_master.yml +++ b/.github/workflows/tests_master.yml @@ -1,4 +1,4 @@ -name: Build & test +name: Build & test {{ github.ref-branch }} on: push: @@ -7,38 +7,4 @@ on: jobs: test: - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - platform: [ubuntu-latest, macos-latest, windows-latest] - - runs-on: ${{matrix.platform}} - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: 'master' - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{matrix.python-version}} - - - run: pip install --upgrade pip setuptools wheel - - run: pip install coverage - - run: pip install numpy>=1.20 - - run: python setup.py build_ext --inplace - - - name: Run tests with coverage - run: | - coverage run --source flowutils --omit="flowutils/tests/*" run_tests.py - coverage xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: coverage.xml - fail_ci_if_error: true - verbose: true - + uses: whitews/flowutils/.github/workflows/build-test-base.yml@master From 23162d1ce09d7dc6b4fc5804eabaca57236acebb Mon Sep 17 00:00:00 2001 From: whitews Date: Wed, 27 Sep 2023 16:12:35 -0400 Subject: [PATCH 11/26] fix workflow name --- .github/workflows/tests_master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_master.yml b/.github/workflows/tests_master.yml index 9db701a..f386357 100644 --- a/.github/workflows/tests_master.yml +++ b/.github/workflows/tests_master.yml @@ -1,4 +1,4 @@ -name: Build & test {{ github.ref-branch }} +name: Build & test (master) on: push: From f376eac081784537edf08582cf4f64bf2a2ae0ba Mon Sep 17 00:00:00 2001 From: whitews Date: Wed, 27 Sep 2023 16:13:01 -0400 Subject: [PATCH 12/26] migrate to 'src' directory structure --- run_tests.py | 2 +- setup.py | 15 ++++++++------- {flowutils => src/flowutils}/__init__.py | 0 {flowutils => src/flowutils}/_version.py | 0 {flowutils => src/flowutils}/compensate.py | 0 {flowutils => src/flowutils}/gating.py | 0 .../flowutils}/gating_c_ext/_gate_helpers.c | 0 .../flowutils}/gating_c_ext/gate_helpers.c | 0 .../flowutils}/gating_c_ext/gate_helpers.h | 0 .../flowutils}/logicle_c_ext/_logicle.c | 0 .../flowutils}/logicle_c_ext/logicle.c | 0 .../flowutils}/logicle_c_ext/logicle.h | 0 {flowutils => src/flowutils}/transforms.py | 0 {flowutils/tests => tests}/__init__.py | 0 {flowutils/tests => tests}/compensation_tests.py | 6 +++--- {flowutils/tests => tests}/gating_tests.py | 8 ++++---- .../test_data/event_data_for_ellipse_test.npy | Bin .../test_data/event_data_for_poly_test.npy | Bin .../test_data/test_comp_event_data.npy | Bin .../test_data/test_comp_matrix.csv | 0 .../test_data/test_comp_matrix_missing_row.csv | 0 .../test_data/truth/Results_Ellipse1.txt | 0 .../test_data/truth/Results_Polygon4.txt | 0 {flowutils/tests => tests}/transform_tests.py | 0 24 files changed, 16 insertions(+), 15 deletions(-) rename {flowutils => src/flowutils}/__init__.py (100%) rename {flowutils => src/flowutils}/_version.py (100%) rename {flowutils => src/flowutils}/compensate.py (100%) rename {flowutils => src/flowutils}/gating.py (100%) rename {flowutils => src/flowutils}/gating_c_ext/_gate_helpers.c (100%) rename {flowutils => src/flowutils}/gating_c_ext/gate_helpers.c (100%) rename {flowutils => src/flowutils}/gating_c_ext/gate_helpers.h (100%) rename {flowutils => src/flowutils}/logicle_c_ext/_logicle.c (100%) rename {flowutils => src/flowutils}/logicle_c_ext/logicle.c (100%) rename {flowutils => src/flowutils}/logicle_c_ext/logicle.h (100%) rename {flowutils => src/flowutils}/transforms.py (100%) rename {flowutils/tests => tests}/__init__.py (100%) rename {flowutils/tests => tests}/compensation_tests.py (96%) rename {flowutils/tests => tests}/gating_tests.py (77%) rename {flowutils/tests => tests}/test_data/event_data_for_ellipse_test.npy (100%) rename {flowutils/tests => tests}/test_data/event_data_for_poly_test.npy (100%) rename {flowutils/tests => tests}/test_data/test_comp_event_data.npy (100%) rename {flowutils/tests => tests}/test_data/test_comp_matrix.csv (100%) rename {flowutils/tests => tests}/test_data/test_comp_matrix_missing_row.csv (100%) rename {flowutils/tests => tests}/test_data/truth/Results_Ellipse1.txt (100%) rename {flowutils/tests => tests}/test_data/truth/Results_Polygon4.txt (100%) rename {flowutils/tests => tests}/transform_tests.py (100%) diff --git a/run_tests.py b/run_tests.py index 26dcd0b..ecb6630 100644 --- a/run_tests.py +++ b/run_tests.py @@ -1,4 +1,4 @@ import unittest -unittest.main('flowutils.tests') +unittest.main('tests') diff --git a/setup.py b/setup.py index ba728b5..3b92579 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import numpy as np # NumPy is needed to build C extensions # read in version string -VERSION_FILE = 'flowutils/_version.py' +VERSION_FILE = 'src/flowutils/_version.py' __version__ = None # to avoid inspection warning and check if __version__ was loaded exec(open(VERSION_FILE).read()) @@ -18,20 +18,20 @@ logicle_extension = Extension( 'flowutils.logicle_c', sources=[ - 'flowutils/logicle_c_ext/_logicle.c', - 'flowutils/logicle_c_ext/logicle.c' + 'src/flowutils/logicle_c_ext/_logicle.c', + 'src/flowutils/logicle_c_ext/logicle.c' ], - include_dirs=[np.get_include(), 'flowutils/logicle_c_ext'], + include_dirs=[np.get_include(), 'src/flowutils/logicle_c_ext'], extra_compile_args=['-std=c99'] ) gating_extension = Extension( 'flowutils.gating_c', sources=[ - 'flowutils/gating_c_ext/_gate_helpers.c', - 'flowutils/gating_c_ext/gate_helpers.c' + 'src/flowutils/gating_c_ext/_gate_helpers.c', + 'src/flowutils/gating_c_ext/gate_helpers.c' ], - include_dirs=[np.get_include(), 'flowutils/gating_c_ext'], + include_dirs=[np.get_include(), 'src/flowutils/gating_c_ext'], extra_compile_args=['-std=c99'] ) @@ -39,6 +39,7 @@ name='FlowUtils', version=__version__, # noqa PyTypeChecker packages=['flowutils'], + package_dir={'': "src"}, package_data={'': []}, description='Flow Cytometry Standard Utilities', long_description=long_description, diff --git a/flowutils/__init__.py b/src/flowutils/__init__.py similarity index 100% rename from flowutils/__init__.py rename to src/flowutils/__init__.py diff --git a/flowutils/_version.py b/src/flowutils/_version.py similarity index 100% rename from flowutils/_version.py rename to src/flowutils/_version.py diff --git a/flowutils/compensate.py b/src/flowutils/compensate.py similarity index 100% rename from flowutils/compensate.py rename to src/flowutils/compensate.py diff --git a/flowutils/gating.py b/src/flowutils/gating.py similarity index 100% rename from flowutils/gating.py rename to src/flowutils/gating.py diff --git a/flowutils/gating_c_ext/_gate_helpers.c b/src/flowutils/gating_c_ext/_gate_helpers.c similarity index 100% rename from flowutils/gating_c_ext/_gate_helpers.c rename to src/flowutils/gating_c_ext/_gate_helpers.c diff --git a/flowutils/gating_c_ext/gate_helpers.c b/src/flowutils/gating_c_ext/gate_helpers.c similarity index 100% rename from flowutils/gating_c_ext/gate_helpers.c rename to src/flowutils/gating_c_ext/gate_helpers.c diff --git a/flowutils/gating_c_ext/gate_helpers.h b/src/flowutils/gating_c_ext/gate_helpers.h similarity index 100% rename from flowutils/gating_c_ext/gate_helpers.h rename to src/flowutils/gating_c_ext/gate_helpers.h diff --git a/flowutils/logicle_c_ext/_logicle.c b/src/flowutils/logicle_c_ext/_logicle.c similarity index 100% rename from flowutils/logicle_c_ext/_logicle.c rename to src/flowutils/logicle_c_ext/_logicle.c diff --git a/flowutils/logicle_c_ext/logicle.c b/src/flowutils/logicle_c_ext/logicle.c similarity index 100% rename from flowutils/logicle_c_ext/logicle.c rename to src/flowutils/logicle_c_ext/logicle.c diff --git a/flowutils/logicle_c_ext/logicle.h b/src/flowutils/logicle_c_ext/logicle.h similarity index 100% rename from flowutils/logicle_c_ext/logicle.h rename to src/flowutils/logicle_c_ext/logicle.h diff --git a/flowutils/transforms.py b/src/flowutils/transforms.py similarity index 100% rename from flowutils/transforms.py rename to src/flowutils/transforms.py diff --git a/flowutils/tests/__init__.py b/tests/__init__.py similarity index 100% rename from flowutils/tests/__init__.py rename to tests/__init__.py diff --git a/flowutils/tests/compensation_tests.py b/tests/compensation_tests.py similarity index 96% rename from flowutils/tests/compensation_tests.py rename to tests/compensation_tests.py index 48fcca5..3bc266d 100644 --- a/flowutils/tests/compensation_tests.py +++ b/tests/compensation_tests.py @@ -39,8 +39,8 @@ 'G560-A' ] -test_data_npy_path = "flowutils/tests/test_data/test_comp_event_data.npy" -test_comp_csv_path = "flowutils/tests/test_data/test_comp_matrix.csv" +test_data_npy_path = "tests/test_data/test_comp_event_data.npy" +test_comp_csv_path = "tests/test_data/test_comp_matrix.csv" test_data_channels = [ 'FSC-A', 'FSC-W', 'SSC-A', 'Ax488-A', 'PE-A', 'PE-TR-A', @@ -108,7 +108,7 @@ def test_parse_compensation_matrix_from_path(self): self.assertIsInstance(matrix_array, np.ndarray) def test_parse_compensation_matrix_missing_row(self): - comp_path = pathlib.Path("flowutils/tests/test_data/test_comp_matrix_missing_row.csv") + comp_path = pathlib.Path("tests/test_data/test_comp_matrix_missing_row.csv") self.assertRaises( ValueError, diff --git a/flowutils/tests/gating_tests.py b/tests/gating_tests.py similarity index 77% rename from flowutils/tests/gating_tests.py rename to tests/gating_tests.py index d59033b..4e75967 100644 --- a/flowutils/tests/gating_tests.py +++ b/tests/gating_tests.py @@ -14,10 +14,10 @@ def test_points_in_ellipse(): coords = [12.99701, 16.22941] distance_square = 1.0 - npy_file_path = "flowutils/tests/test_data/event_data_for_ellipse_test.npy" + npy_file_path = "tests/test_data/event_data_for_ellipse_test.npy" event_data = np.load(npy_file_path) - truth_path = 'flowutils/tests/test_data/truth/Results_Ellipse1.txt' + truth_path = 'tests/test_data/truth/Results_Ellipse1.txt' truth = np.genfromtxt(truth_path, delimiter=',').astype('bool') result = gating.points_in_ellipsoid( @@ -39,10 +39,10 @@ def test_points_in_polygon(): ] ) - npy_file_path = "flowutils/tests/test_data/event_data_for_poly_test.npy" + npy_file_path = "tests/test_data/event_data_for_poly_test.npy" event_data = np.load(npy_file_path) - truth_path = 'flowutils/tests/test_data/truth/Results_Polygon4.txt' + truth_path = 'tests/test_data/truth/Results_Polygon4.txt' truth = np.genfromtxt(truth_path, delimiter=',').astype('bool') result = gating.points_in_polygon(poly_vertices, event_data) diff --git a/flowutils/tests/test_data/event_data_for_ellipse_test.npy b/tests/test_data/event_data_for_ellipse_test.npy similarity index 100% rename from flowutils/tests/test_data/event_data_for_ellipse_test.npy rename to tests/test_data/event_data_for_ellipse_test.npy diff --git a/flowutils/tests/test_data/event_data_for_poly_test.npy b/tests/test_data/event_data_for_poly_test.npy similarity index 100% rename from flowutils/tests/test_data/event_data_for_poly_test.npy rename to tests/test_data/event_data_for_poly_test.npy diff --git a/flowutils/tests/test_data/test_comp_event_data.npy b/tests/test_data/test_comp_event_data.npy similarity index 100% rename from flowutils/tests/test_data/test_comp_event_data.npy rename to tests/test_data/test_comp_event_data.npy diff --git a/flowutils/tests/test_data/test_comp_matrix.csv b/tests/test_data/test_comp_matrix.csv similarity index 100% rename from flowutils/tests/test_data/test_comp_matrix.csv rename to tests/test_data/test_comp_matrix.csv diff --git a/flowutils/tests/test_data/test_comp_matrix_missing_row.csv b/tests/test_data/test_comp_matrix_missing_row.csv similarity index 100% rename from flowutils/tests/test_data/test_comp_matrix_missing_row.csv rename to tests/test_data/test_comp_matrix_missing_row.csv diff --git a/flowutils/tests/test_data/truth/Results_Ellipse1.txt b/tests/test_data/truth/Results_Ellipse1.txt similarity index 100% rename from flowutils/tests/test_data/truth/Results_Ellipse1.txt rename to tests/test_data/truth/Results_Ellipse1.txt diff --git a/flowutils/tests/test_data/truth/Results_Polygon4.txt b/tests/test_data/truth/Results_Polygon4.txt similarity index 100% rename from flowutils/tests/test_data/truth/Results_Polygon4.txt rename to tests/test_data/truth/Results_Polygon4.txt diff --git a/flowutils/tests/transform_tests.py b/tests/transform_tests.py similarity index 100% rename from flowutils/tests/transform_tests.py rename to tests/transform_tests.py From 107c6b49e8b6e31478f7b0fcf248ec469cf996b3 Mon Sep 17 00:00:00 2001 From: whitews Date: Wed, 27 Sep 2023 17:48:02 -0400 Subject: [PATCH 13/26] update test workflow for dev branch --- .github/workflows/tests_develop.yml | 36 +---------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/.github/workflows/tests_develop.yml b/.github/workflows/tests_develop.yml index 13166af..e8d394f 100644 --- a/.github/workflows/tests_develop.yml +++ b/.github/workflows/tests_develop.yml @@ -7,38 +7,4 @@ on: jobs: test: - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - platform: [ubuntu-latest, macos-latest, windows-latest] - - runs-on: ${{matrix.platform}} - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: 'develop' - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{matrix.python-version}} - - - run: pip install --upgrade pip setuptools wheel - - run: pip install coverage - - run: pip install numpy>=1.20 - - run: python setup.py build_ext --inplace - - - name: Run tests with coverage - run: | - coverage run --source flowutils --omit="flowutils/tests/*" run_tests.py - coverage xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: coverage.xml - fail_ci_if_error: true - verbose: true - + uses: whitews/flowutils/.github/workflows/build-test-base.yml@develop From 158d789afac704205935c497cf630b36a6fa6473 Mon Sep 17 00:00:00 2001 From: whitews Date: Wed, 27 Sep 2023 18:22:06 -0400 Subject: [PATCH 14/26] fix sdist build --- .github/workflows/wheels.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 733e341..3427533 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -87,6 +87,9 @@ jobs: with: python-version: 3.11 + - name: Install build + run: python -m pip install build + - name: Run sdist run: python -m build --sdist From 97d12047ce43fb3d5f6390146cc987307a91a887 Mon Sep 17 00:00:00 2001 From: whitews Date: Mon, 2 Oct 2023 10:08:41 -0400 Subject: [PATCH 15/26] update manifest --- MANIFEST.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index b78d2fb..b2b969e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,2 @@ include LICENSE -recursive-include flowutils *.h -prune flowutils/tests/ +recursive-include src/flowutils *.h From 037d27d74415ce4385760403ef667d67b9a158da Mon Sep 17 00:00:00 2001 From: whitews Date: Mon, 2 Oct 2023 10:09:20 -0400 Subject: [PATCH 16/26] test python 3.12 --- .github/workflows/build-test-base.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-base.yml b/.github/workflows/build-test-base.yml index 14e001b..a026c82 100644 --- a/.github/workflows/build-test-base.yml +++ b/.github/workflows/build-test-base.yml @@ -7,7 +7,7 @@ jobs: test: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{matrix.platform}} @@ -23,7 +23,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - - run: | + - name: Install packages + run: | pip install --upgrade pip setuptools wheel pip install coverage pip install . From 6aec02e96fef550612ade4dcc2f29ec4c1863d72 Mon Sep 17 00:00:00 2001 From: whitews Date: Mon, 2 Oct 2023 10:16:48 -0400 Subject: [PATCH 17/26] test python 3.12 (via pre-release --- .github/workflows/build-test-base.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test-base.yml b/.github/workflows/build-test-base.yml index a026c82..f55a42d 100644 --- a/.github/workflows/build-test-base.yml +++ b/.github/workflows/build-test-base.yml @@ -22,6 +22,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Install packages run: | From cb82f1379ca9772f154cad58ee9c6452e601d57d Mon Sep 17 00:00:00 2001 From: whitews Date: Mon, 2 Oct 2023 11:04:06 -0400 Subject: [PATCH 18/26] build python 3.12 --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 3427533..e4f64af 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -31,7 +31,7 @@ jobs: pip install oldest-supported-numpy pip freeze CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 *-win32 # skip PyPy, musllinux, 32-bit Linux & win32 builds - CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* + CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* - name: Store artifacts uses: actions/upload-artifact@v3 From 66954cfef40f35ead22ca4860a9bd86607c862e3 Mon Sep 17 00:00:00 2001 From: whitews Date: Mon, 2 Oct 2023 11:11:52 -0400 Subject: [PATCH 19/26] build python 3.12 for mac --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e4f64af..e8e5cff 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -64,7 +64,7 @@ jobs: env: CIBW_BEFORE_BUILD: pip install oldest-supported-numpy CIBW_SKIP: pp* # skip PyPy - CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* # Only Python 3.8 - 3.11 + CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* # Only Python 3.8 - 3.12 CIBW_ARCHS_MACOS: x86_64 arm64 - name: Store artifacts From 37d9763f4b8e8a4894ae13cfdd82fc82ab3bcd1e Mon Sep 17 00:00:00 2001 From: whitews Date: Mon, 2 Oct 2023 11:54:33 -0400 Subject: [PATCH 20/26] add python 3.12 to supported versions --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 3b92579..9d1f70f 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ ext_modules=[logicle_extension, gating_extension], install_requires=['numpy>=1.20'], classifiers=[ + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.9', From 7b0d4aa99e3d3fcb9757eafdb686c3ee539399b0 Mon Sep 17 00:00:00 2001 From: whitews Date: Mon, 2 Oct 2023 11:55:05 -0400 Subject: [PATCH 21/26] no need to omit test sub-dir anymore --- .github/workflows/build-test-base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-base.yml b/.github/workflows/build-test-base.yml index f55a42d..662af82 100644 --- a/.github/workflows/build-test-base.yml +++ b/.github/workflows/build-test-base.yml @@ -32,7 +32,7 @@ jobs: - name: Run tests with coverage run: | - coverage run --source flowutils --omit="flowutils/tests/*" run_tests.py + coverage run --source flowutils run_tests.py coverage xml - name: Upload coverage to Codecov From bd2a9c8aba08391510eb8c25d440bf3713a0051f Mon Sep 17 00:00:00 2001 From: whitews Date: Thu, 5 Oct 2023 10:51:01 -0400 Subject: [PATCH 22/26] attempt to merge wheel builds --- .github/workflows/wheels.yml | 41 +++--------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e8e5cff..d1b1614 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -8,42 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, windows-2022] - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: 'master' - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.15.0 - - - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_BEFORE_BUILD: | - pip install oldest-supported-numpy - pip freeze - CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 *-win32 # skip PyPy, musllinux, 32-bit Linux & win32 builds - CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* - - - name: Store artifacts - uses: actions/upload-artifact@v3 - with: - path: wheelhouse/*.whl - - build_wheels_apple_silicon: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-12] + os: [ubuntu-22.04, windows-2022, macos-12] steps: - name: Checkout @@ -63,9 +28,9 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BEFORE_BUILD: pip install oldest-supported-numpy - CIBW_SKIP: pp* # skip PyPy - CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* # Only Python 3.8 - 3.12 + CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 *-win32 # skip PyPy, musllinux, 32-bit Linux & win32 builds CIBW_ARCHS_MACOS: x86_64 arm64 + CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* - name: Store artifacts uses: actions/upload-artifact@v3 From 96cb79ebc02783acd59ad37adefbbc3f6c2521be Mon Sep 17 00:00:00 2001 From: whitews Date: Thu, 5 Oct 2023 15:09:06 -0400 Subject: [PATCH 23/26] checking if numpy install needs to be specified in CIBW (should be installed during build via pyproject.toml) --- .github/workflows/wheels.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d1b1614..7dacff2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -27,7 +27,6 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_BEFORE_BUILD: pip install oldest-supported-numpy CIBW_SKIP: pp* *-musllinux_* *-manylinux_i686 *-win32 # skip PyPy, musllinux, 32-bit Linux & win32 builds CIBW_ARCHS_MACOS: x86_64 arm64 CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* From 9f4330546499303ab3be787fb2696a2db756ee52 Mon Sep 17 00:00:00 2001 From: whitews Date: Thu, 5 Oct 2023 19:03:58 -0400 Subject: [PATCH 24/26] simulate getting build files for publishing --- .github/workflows/wheels.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7dacff2..4e33c8b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -37,7 +37,7 @@ jobs: path: wheelhouse/*.whl package_source: - name: Package source + name: Package source distribution runs-on: ubuntu-22.04 steps: @@ -60,4 +60,20 @@ jobs: - name: Store artifacts uses: actions/upload-artifact@v3 with: - path: ./dist/*.tar.gz \ No newline at end of file + path: ./dist/*.tar.gz + + retrieve_build_files: + name: Retrieve build files + needs: + - build_wheels + - package_source + runs-on: ubuntu-22.04 + + steps: + - name: Download build files + uses: actions/download-artifact@v3 + with: + path: dist/ + + - name: List files + run: ls -lh dist \ No newline at end of file From ab9ff1ab839abc819582972066c592b34e079103 Mon Sep 17 00:00:00 2001 From: whitews Date: Thu, 5 Oct 2023 19:30:11 -0400 Subject: [PATCH 25/26] try to find build files on GH actions --- .github/workflows/wheels.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 4e33c8b..45bf6e1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -34,6 +34,7 @@ jobs: - name: Store artifacts uses: actions/upload-artifact@v3 with: + name: python-package-distributions path: wheelhouse/*.whl package_source: @@ -60,6 +61,7 @@ jobs: - name: Store artifacts uses: actions/upload-artifact@v3 with: + name: python-package-distributions path: ./dist/*.tar.gz retrieve_build_files: @@ -73,7 +75,10 @@ jobs: - name: Download build files uses: actions/download-artifact@v3 with: + name: python-package-distributions path: dist/ - name: List files - run: ls -lh dist \ No newline at end of file + run: | + pwd + ls -lh dist \ No newline at end of file From d2f388c0959dd86636d303ff94b1f53c66c5a292 Mon Sep 17 00:00:00 2001 From: whitews Date: Thu, 5 Oct 2023 19:58:18 -0400 Subject: [PATCH 26/26] don't list user/group in ls --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 45bf6e1..9f8966f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -81,4 +81,4 @@ jobs: - name: List files run: | pwd - ls -lh dist \ No newline at end of file + ls -hog dist \ No newline at end of file