3

Did anybody try to create tools that create Python source distributions (sdist) without setup.py? Does Python allow that? Is that at all possible? Or setup.py is an obligatory part of any isntallable Python archive hosted on PyPI? If yes, then where is a PEP for that format?

1 Answer 1

2

A Python package is just a bunch of Python files in a folder, possibly with an __init__.py file as well. It might also have subpackages, which are just packages within packages.

Generally, setup.py is not included in any such package.

3
  • And how can I install such package without setup.py? pip fails with Command python setup.py egg_info failed with error code 1 in /temp/pip-e1wuf9-build Commented Jan 11, 2015 at 7:50
  • 1
    pip does not take Python packages as inputs, it produces them as outputs. It takes distributions as inputs. A distribution will necessarily involve a setup.py file, because that's how pip knows what to do. If you don't want to have a setup.py file, you have to do everything by hand. That includes getting the package into one of the directories listed in sys.path. Once you've done that, the package can be imported.
    – Kevin
    Commented Jan 12, 2015 at 2:30
  • I meant distribution as the one that you pull from PyPI, not package as multi-file Python module. Edited my question. Commented Jan 17, 2015 at 10:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.