I have a package with a structure that would (simplified) look like:
mypackage/
__init__.py
setup.py
module1.py
module2.py
mysubpackage/
__init__.py
mysubmodule1.py
mysubmodule2.py
I'm using a configuration for setup.py like this:
from setuptools import setup, find_packages
setup(
name = "mypackage",
version = "0.1",
author = "Foo",
author_email = "[email protected]",
description = ("My description"),
packages=find_packages(),
)
The default where argument for find_packages() is '.', but it doesn't include my top-level modules (module1.py nor module2.py). However, all child submodules and subpackages are added when running python setup.py build.
How could I get top-level Python modules added too, without moving setup.py one level higher?
setup.py? It should be outside the package. - jonrsharpesetup.pyshould be moved up one level higher and all other scripts / packages / modules need to be installed by configuringsetup.pycorrectly. That should be it. - Simeon Vissermypackagein fact is a django app, and I'd like to have setup.py inside the app to commit it with the app's source and to avoid having it inside a django project of mine. - Caumonssetup.pyshould always be at a higher directory level than your Python package. Your app's "source" should be the Python package itself, plus any support files likesetup.pyor aREADMEthat would exist outside the Python package. Have a look at packaging.python.org/en/latest/distributing.html - Iguananaut