python-cmd2 / cmd2

cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python
https://cmd2.readthedocs.io/en/stable/
MIT License
612 stars 114 forks source link

Exclude docs and a few other things from the PyPI package #857

Closed tleonhardt closed 4 years ago

tleonhardt commented 4 years ago

I took a quick look at what is actually in our latest PyPI package:

CHANGELOG.md         CONTRIBUTING.md      PKG-INFO             azure-pipelines.yml  cmd2.png             setup.cfg            tests/
CODEOWNERS           LICENSE              Pipfile              cmd2/                docs/                setup.py*            tox.ini
CODE_OF_CONDUCT.md   MANIFEST.in          README.md*           cmd2.egg-info/       examples/            tasks.py

Things which probably shouldn't be there include:

These should be excludable by modifying the MANIFEST.in file and adding lines like:

recursive-exclude docs
deargle commented 4 years ago

I was just looking at this with psiturk last night. I ended up just listing what I wanted to be included: the source directory (psiturk), and a few files from the root dir.

https://github.com/NYUCCL/psiTurk/blob/459c09c189406a414ba1c9e57b10511462f00b74/MANIFEST.in

recursive-include psiturk *
include requirements.txt
include LICENSE

edit: disclaimer -- I have no idea what I'm doing

tleonhardt commented 4 years ago

@deargle Yeah we had the same approach where we were manually including certain things and I tested that a couple years ago and it worked as intended.

But somewhere in the interim the behavior changed and a bunch of other stuff was getting put in our PyPI tarball. I'm not sure if we changed something that altered the behavior or the change is in setuptools or what.

I added some explicit exclude and recursive-exclude statements to our MANIFEST.in and it seems to do the trick.