3 ms·
That's a specific implementation that relies on setuptools. An sdist doesn't have to use setuptools to be an sdist. Wheels can be generated out of thin air, th
by X-Istence 6y ago
That's a specific implementation that relies on setuptools. An sdist doesn't have to use setuptools to be an sdist.
Wheels can be generated out of thin air, there is no requirement that setuptools or any tool is ever involved, if you wanted you could zip up a particular directory structure and it is a wheel.
- awinter-py 6y agoare you saying pure-python detection is possible for standard packaging formats like setuptools and pyproject.toml, but not for sdist generally?
- X-Istence 6y agopyproject.toml specifies how to build a project using a builder. You'd have to execute the builder and let it build the project to know if the wheel it generates is pure python or not. As for setuptools: There's a class that setuptools relies on to do the actual building of the Python project, called distutils.dist.Distribution which has a function named is_pure(): https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Lib/distutils/dist.py#L1011 https://github.com/python/cpython/blob/e42b705188271da108de4... Which makes sure that it doesn't have any known external modules or c libraries. So to do detection of whether an sdist is a pure python, you'd have to execute setuptools and setup.py because of course setup.py isn't just configuration, it's full on Python. So just looking at an sdist statically you can not know if the sdist is a pure python project or not.