diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 0a85579..0cf115e 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -88,7 +88,7 @@ jobs: ls -l dist - name: Publish package - uses: pypa/gh-action-pypi-publish@v1.8 + uses: pypa/gh-action-pypi-publish@v1.8.11 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/setup.py b/setup.py index 464fd08..9dc00e4 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,12 @@ +import platform import numpy as np from setuptools import Extension, setup +if platform.system() == "Windows": + platform_flags = ["/Ox", "/fp:fast"] +else: + platform_flags = ["-O3", "-ffast-math", "-march=native"] + balltree = Extension( name="balltree.balltree", sources=[ @@ -17,9 +23,7 @@ include_dirs=["include", np.get_include()], extra_compile_args=[ "-Wall", - "-O3", - "-ffast-math", - "-march=native", + *platform_flags, "-DSET_PYERR_STRING", # required to propagate C errors to python ], )