slaypni / fastdtw

A Python implementation of FastDTW
MIT License
774 stars 122 forks source link

Add pyproject.toml so cython and numpy are always pre-installed #34

Closed Guillemdb closed 3 years ago

Guillemdb commented 4 years ago

Signed-off-by: Guillem Duran guillem@sourced.tech

Guillemdb commented 4 years ago

Hi! I've been using fastdtw for a while, thank you very much for creating such a great tool.

Unfortunately, the unpredictable behavior of the Cython extensions during setup(being installed only if numpy is installed before fastdw) caused me a lot of trouble.

In this pull request I propose a fix to always install the Cython extensions and simplify the setup.py file. Adding a pyproject.toml file will allow to ensure that the required packages are installed before running setup.py, and offer a consistent and predictable installation behavior.

slaypni commented 4 years ago

@Guillemdb Thank you for sending the PR. Please let me ask some questions.

Is just adding pyproject.toml enough to ensure numpy is installed before entering setup.py when running pip install fastdtw? Are there any other required steps such as using specific build command instead of python setup.py sdist? Are there some requirements such as pip version?

Thanks.

Guillemdb commented 4 years ago

Is just adding pyproject.toml enough to ensure numpy is installed before entering setup.py when running pip install fastdtw?

According tot PEP 518 it should be enough.

Are there any other required steps such as using specific build command instead of python setup.py sdist?

I have personally been using it with pip install (using git+https, and pip install -e .). It automatically detects the pyproject.toml file, and installs the required dependencies. All the other pip options remain the same, and no special command is required to include the pyproject.toml file.

I have not tried using python setup.py, but that is an installation procedure that is not recommended at all.

Are there some requirements such as pip version?

The minimum required pip version is pip 10.