diff --git a/.circleci/config.yml b/.circleci/config.yml index e4c71dde1..c65127b5b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,10 +50,10 @@ jobs: name: Get Python running command: | python -m pip install --user --upgrade --progress-bar off pip + python -m pip install --user -e . python -m pip install --user --upgrade --progress-bar off -r requirements.txt python -m pip install --user --upgrade --progress-bar off -r docs/requirements.txt python -m pip install --user --upgrade --progress-bar off ipython "https://api.github.com/repos/sphinx-gallery/sphinx-gallery/zipball/master" memory_profiler - python -m pip install --user -e . - save_cache: key: pip-cache @@ -183,4 +183,4 @@ workflows: branches: ignore: /.*/ tags: - only: /[0-9]+(\.[0-9]+)*$/ \ No newline at end of file + only: /[0-9]+(\.[0-9]+)*$/ diff --git a/README.md b/README.md index 20e060620..ad72a3c1f 100644 --- a/README.md +++ b/README.md @@ -82,13 +82,6 @@ The library has been tested on Linux, MacOSX and Windows. It requires a C++ comp #### Pip installation -Note that due to a limitation of pip, `cython` and `numpy` need to be installed -prior to installing POT. This can be done easily with - -```console -pip install numpy cython -``` - You can install the toolbox through PyPI with: ```console diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..bb61cd8d2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel", "numpy>=1.16", "cython>=0.23"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 0f2ef92e4..19caadf2c 100644 --- a/setup.py +++ b/setup.py @@ -5,12 +5,9 @@ import subprocess import sys -from setuptools import find_packages, setup -from setuptools.extension import Extension +from setuptools import find_packages, setup, Extension import numpy -from Cython.Build import cythonize - # dirty but working __version__ = re.search( @@ -34,7 +31,8 @@ if sys.platform.startswith('darwin'): compile_args.append("-stdlib=libc++") sdk_path = subprocess.check_output(['xcrun', '--show-sdk-path']) - os.environ['CFLAGS'] = '-isysroot "{}"'.format(sdk_path.rstrip().decode("utf-8")) + os.environ['CFLAGS'] = '-isysroot "{}"'.format( + sdk_path.rstrip().decode("utf-8")) setup( name='POT', @@ -46,19 +44,22 @@ author_email='remi.flamary@gmail.com, ncourty@gmail.com', url='https://github.com/PythonOT/POT', packages=find_packages(), - ext_modules=cythonize(Extension( - name="ot.lp.emd_wrap", - sources=["ot/lp/emd_wrap.pyx", "ot/lp/EMD_wrapper.cpp"], # cython/c++ src files - language="c++", - include_dirs=[numpy.get_include(), os.path.join(ROOT, 'ot/lp')], - extra_compile_args=compile_args, - )), + ext_modules=[ + Extension( + name="ot.lp.emd_wrap", + sources=["ot/lp/emd_wrap.pyx", + "ot/lp/EMD_wrapper.cpp"], # cython/c++ src files + language="c++", + include_dirs=[numpy.get_include()], + extra_compile_args=compile_args, + ) + ], platforms=['linux', 'macosx', 'windows'], - download_url='https://github.com/PythonOT/POT/archive/{}.tar.gz'.format(__version__), + download_url='https://github.com/PythonOT/POT/archive/{}.tar.gz'.format( + __version__), license='MIT', scripts=[], data_files=[], - setup_requires=["numpy>=1.16", "cython>=0.23"], install_requires=["numpy>=1.16", "scipy>=1.0"], classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -85,5 +86,4 @@ 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', - ] -) + ])