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?
Thank you all for your responses.
Finally, I added a directory (not Python package) containing mypackage and the setup.py module. The structure now looks as follows:
myapp/
    setup.py
    mypackage/
        __init__.py
        module1.py
        module2.py
        mysubpackage/
            __init__.py
            mysubmodule1.py
            mysubmodule2.py
Now using find_packages() works as expected. Thanks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With