Skip to content

Commit

Permalink
follow ChatGPT's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Jun 18, 2024
1 parent 2232607 commit 8f62941
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
13 changes: 11 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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'],
)

Expand All @@ -23,12 +32,12 @@
author_email='[email protected]',
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',
],
)

0 comments on commit 8f62941

Please sign in to comment.