2

Right now a have my packages variable in setup.py defined like this:

packages=find_packages(include=['zeption'])

But zeption has a folder examples I want to exclude:

zeption/
├── ...
├── setup.py
├── ...
└── zeption
    ├── ...
    ├── examples <----- want to exclude
    ├── ...

How can I do this?

pythad
  • 4,241
  • 2
  • 19
  • 41
  • Possible duplicate of [Python: 'Private' module in a package](https://stackoverflow.com/questions/3602110/python-private-module-in-a-package) – cs95 Jul 14 '17 at 21:36
  • @cᴏʟᴅsᴘᴇᴇᴅ The question is not about private submodules but rather on how to excule a folder when uploading a package to PyPI – pythad Jul 14 '17 at 21:37
  • @pythad: Does `examples` contain an `__init__.py` file? I don't think the directory will be included without one. (Though it could be included due to being treated as package data instead of code.) – jwodder Jul 14 '17 at 21:38
  • 1
    @pythad My mistake. [This](https://stackoverflow.com/questions/35115892/how-to-exclude-a-single-file-from-package-with-setuptools-and-setup-py) may help then. – cs95 Jul 14 '17 at 21:39
  • `find_packages` also takes an `exclude` kwarg – anthony sottile Jul 14 '17 at 21:54

1 Answers1

2

Just specify the exclude kwarg:

packages=find_packages(include=['zeption'], exclude=['zeption.examples', ])
pythad
  • 4,241
  • 2
  • 19
  • 41