tommyod / KDEpy

Kernel Density Estimation in Python
https://kdepy.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
584 stars 90 forks source link

Add pyproject.toml: PEP 517, 518, 631 #134

Closed snowdrop4 closed 1 year ago

snowdrop4 commented 1 year ago

Add a pyproject.toml file, compliant with the following PEPs:

PEP 517: Specify the build backend (setuptools).

PEP 518: Specify the build-time dependencies (Cython, and Numpy).

PEP 631: Specify the run-time dependencies.


Background:

There was no pre-built wheel available for my machine, so I was attempting to add the repo as a dependency to be built locally.

PEP 517 and 518 compliance lets KDEpy be automatically and correctly built locally by common Python dependency managers and build systems.

Without the [build-system] section in pyproject.toml, the build-time dependencies would not be added to PATH during the build, which would cause it to fail.

PEP 631 makes sure common Python dependency managers install the right packages for when the built package is used.

KDEpy can now be built with pip3 install ., and pip will automatically install all the dependencies and compile KDEpy in one go. The same is true when KDEpy is added as a dependency to another project's pyproject.toml file. A PEP 517, 518, and 631 dependency manager and build system will be able to automatically build and install everything.

This may or may not sidestep the kinds of issues being reported in #114.

tommyod commented 1 year ago

Thanks a lot!