Closed blowekamp closed 7 years ago
@jcfr @thewtex This seems to be needed to get the requirements for source distributions correct. Any thoughts?
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
:
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.
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.
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
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.