SimpleITK / SimpleITKPythonPackage

A setup script to generate a Python Wheels
17 stars 11 forks source link

Add explicit setup requirement for scikit-build #32

Closed blowekamp closed 7 years ago

blowekamp commented 7 years ago

Fallback to setuptools when scikit-build is not available to allow the egg_info command to specify the requirements to run setup.py. This allows source distribution to specify that they require scikit-build.

blowekamp commented 7 years ago

@jcfr @thewtex This seems to be needed to get the requirements for source distributions correct. Any thoughts?

thewtex commented 7 years ago

I'm not sure if we can assume that setuptools is present, either (?).

This is, in theory, the purpose of pypackage.toml, but support for that has not been implemented yet.

Here is the approach in the itk setup.py:

https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/7d89fcde557fd3cdf0a26f76a9059682de23e750/setup.py#L4-L11

blowekamp commented 7 years ago

I'll add a similar message when neither is available. However, setuptools is installed by default with the virtualenv tools and getpip.py also install setup tools be default too.

This change will make it easier to build from a source tarball or directly for the git repo.

jcfr commented 7 years ago

I would suggest to streamline doing something like:

try:
    from skbuild import setup
except ImportError:
    print('setuptools and scikit-build are required to build from source.', file=sys.stderr)
    print('Please run:\n', file=sys.stderr)
    print('  python -m pip install setuptools scikit-build', file=sys.stderr)
    sys.exit(1)

We could also add setuptools as a dependency of scikit-build.

blowekamp commented 7 years ago

The motivation for fallingback to setuptools is to support the setup.py egg_info command to produce the list of dependencies for running setup.py. This enables pip to automatically download and install scikitbuild when the common setuptools package is already installed. This can be done from a source ball or directly from the git repo: pip install git+https://github.com/SimpleITK/SimpleITKPythonPackage.git