From ff47af46f321587592f4c5e110b4c84e068ce981 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 13:37:14 +0000 Subject: [PATCH 01/13] change the version --- .github/workflows/testing.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 52ad7e1..3828a1b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,12 +11,12 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12"] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v4 + - uses: conda-incubator/setup-miniconda@v4 with: miniforge-variant: Mambaforge activate-environment: mamonca-test From 7fb1485927b4536c489edc8e74cb4637ae1dd496 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 13:38:46 +0000 Subject: [PATCH 02/13] decrease miniconda version --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3828a1b..420d405 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,7 +16,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v4 + - uses: conda-incubator/setup-miniconda@v2 with: miniforge-variant: Mambaforge activate-environment: mamonca-test From cc0edc66ef2b8e6af860d806dbea7885e2cfefaf Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 13:40:43 +0000 Subject: [PATCH 03/13] remove 3.12 --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 420d405..1d9e7f8 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11"] runs-on: ${{ matrix.os }} steps: From e842ab5c8c2eeefab0d4053fd23255f1c0142014 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:04:13 +0000 Subject: [PATCH 04/13] change channel priority to flexible --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1d9e7f8..85c99a4 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12"] runs-on: ${{ matrix.os }} steps: @@ -20,7 +20,7 @@ jobs: with: miniforge-variant: Mambaforge activate-environment: mamonca-test - channel-priority: strict + channel-priority: flexible environment-file: .ci_support/environment.yml python-version: ${{ matrix.python-version }} use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! From 6fb1405c31adc950855a926a6a3bdc58d7206683 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:18:47 +0000 Subject: [PATCH 05/13] bring back channel-priority --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 85c99a4..420d405 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -20,7 +20,7 @@ jobs: with: miniforge-variant: Mambaforge activate-environment: mamonca-test - channel-priority: flexible + channel-priority: strict environment-file: .ci_support/environment.yml python-version: ${{ matrix.python-version }} use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! From b0652102d82b764663a89580107102c8f9a9d867 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:23:18 +0000 Subject: [PATCH 06/13] remove use tar blabla following ChatGPT's comment --- .github/workflows/testing.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 420d405..1ee9406 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,7 +23,6 @@ jobs: channel-priority: strict environment-file: .ci_support/environment.yml python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: run tests From 452f4b3df695a1f7777052be47f6dab8cf5bb8e5 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:27:44 +0000 Subject: [PATCH 07/13] Revert "remove use tar blabla following ChatGPT's comment" This reverts commit b0652102d82b764663a89580107102c8f9a9d867. --- .github/workflows/testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1ee9406..420d405 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,6 +23,7 @@ jobs: channel-priority: strict environment-file: .ci_support/environment.yml python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: run tests From 68cb7123e2775dc651f51fae1942f0b516d376f5 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:34:59 +0000 Subject: [PATCH 08/13] ChatGPT's suggestion --- .github/workflows/testing.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 420d405..0ba5683 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -19,15 +19,16 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: miniforge-variant: Mambaforge - activate-environment: mamonca-test + python-version: ${{ matrix.python-version }} channel-priority: strict environment-file: .ci_support/environment.yml - python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + - name: Install dependencies + run: conda env update --file .ci_support/environment.yml --name base - name: run tests shell: bash -l {0} run: | pip install -e . python -m unittest discover tests/ + From 36b8651bbf7655b2e97c079b22ba4dbbc45223b5 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:37:26 +0000 Subject: [PATCH 09/13] another suggestion of ChatGPT --- .github/workflows/testing.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0ba5683..cd09353 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,15 +16,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v2 + - name: Set up Python + uses: actions/setup-python@v4 with: - miniforge-variant: Mambaforge python-version: ${{ matrix.python-version }} - channel-priority: strict - environment-file: .ci_support/environment.yml - name: Install dependencies - run: conda env update --file .ci_support/environment.yml --name base + run: | + pip install numpy cython scipy - name: run tests shell: bash -l {0} From 22326079392f84b7d1843bb688c6a7eaacc2a937 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:40:30 +0000 Subject: [PATCH 10/13] restore the original one --- .github/workflows/testing.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index cd09353..bfa3d48 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,14 +16,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 + - uses: conda-incubator/setup-miniconda@v2 with: + miniforge-variant: Mambaforge + activate-environment: mamonca-test + channel-priority: strict + environment-file: .ci_support/environment.yml python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install numpy cython scipy + use-only-tar-bz2: true - name: run tests shell: bash -l {0} From 8f62941e0d541014c49305db16b41a18e2792774 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:47:51 +0000 Subject: [PATCH 11/13] follow ChatGPT's suggestion --- .github/workflows/testing.yml | 14 +++++++------- setup.py | 13 +++++++++++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index bfa3d48..1dfbad5 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,18 +16,18 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v2 + - name: Set up Python + uses: actions/setup-python@v4 with: - miniforge-variant: Mambaforge - activate-environment: mamonca-test - channel-priority: strict - environment-file: .ci_support/environment.yml python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true + + - name: Install dependencies + run: | + pip install numpy cython scipy + pip install . - name: run tests shell: bash -l {0} run: | - pip install -e . python -m unittest discover tests/ diff --git a/setup.py b/setup.py index 1d696ad..0e9cee3 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,20 @@ from setuptools.command.build_ext import build_ext from setuptools import setup, Extension +import numpy +# Check if Cython is available +try: + from Cython.Build import cythonize +except ImportError: + def cythonize(module_list): + return module_list +# Define the extension module ext = Extension( 'mamonca', sources=["mamonca/mc.pyx"], language="c++", + include_dirs=[numpy.get_include()], extra_compile_args=['-std=c++11'], ) @@ -23,12 +32,12 @@ author_email='waseda@mpie.de', license='BSD', cmdclass={"build_ext": build_ext}, - ext_modules=[ext], + ext_modules=cythonize([ext]), options={'build': {'build_lib': 'mamonca'}}, setup_requires=[ - # Setuptools 18.0 properly handles Cython extensions. 'setuptools>=18.0', 'cython', 'numpy', ], ) + From 795299179e083301696d1c8637f49b5248065171 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:49:00 +0000 Subject: [PATCH 12/13] Revert "follow ChatGPT's suggestion" This reverts commit 8f62941e0d541014c49305db16b41a18e2792774. --- .github/workflows/testing.yml | 14 +++++++------- setup.py | 13 ++----------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1dfbad5..bfa3d48 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,18 +16,18 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 + - uses: conda-incubator/setup-miniconda@v2 with: + miniforge-variant: Mambaforge + activate-environment: mamonca-test + channel-priority: strict + environment-file: .ci_support/environment.yml python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - pip install numpy cython scipy - pip install . + use-only-tar-bz2: true - name: run tests shell: bash -l {0} run: | + pip install -e . python -m unittest discover tests/ diff --git a/setup.py b/setup.py index 0e9cee3..1d696ad 100644 --- a/setup.py +++ b/setup.py @@ -1,20 +1,11 @@ from setuptools.command.build_ext import build_ext from setuptools import setup, Extension -import numpy -# Check if Cython is available -try: - from Cython.Build import cythonize -except ImportError: - def cythonize(module_list): - return module_list -# Define the extension module ext = Extension( 'mamonca', sources=["mamonca/mc.pyx"], language="c++", - include_dirs=[numpy.get_include()], extra_compile_args=['-std=c++11'], ) @@ -32,12 +23,12 @@ def cythonize(module_list): author_email='waseda@mpie.de', license='BSD', cmdclass={"build_ext": build_ext}, - ext_modules=cythonize([ext]), + ext_modules=[ext], options={'build': {'build_lib': 'mamonca'}}, setup_requires=[ + # Setuptools 18.0 properly handles Cython extensions. 'setuptools>=18.0', 'cython', 'numpy', ], ) - From 2c591d34706eb69eaca3e6013f0cefd0d895124d Mon Sep 17 00:00:00 2001 From: samwaseda Date: Tue, 18 Jun 2024 15:58:05 +0000 Subject: [PATCH 13/13] remove python 3.12 --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index bfa3d48..24da3dc 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11"] runs-on: ${{ matrix.os }} steps: