I would like to create a source distribution package that automatically contains only my Subversion versioned files and then installs those same files.
If I use a setuptools.setup()
call in setup.py that does not contain a setting for packages
or include_package_data
and run python setup.py sdist build
, I get a package that contains only my versioned files, which is exactly what I need. However, when I attempt to install this package, only empty directories are created. None of the files are installed.
If I include packages = setuptools.find_packages()
and run python setup.py sdist build
, I get a package that contains all the files in my source tree instead of only the versioned files. When I install this package, all the files in the package are installed.
The only other parameters I use in setup()
are for metadata (name, version, etc).
How do I create a package that contains only the versioned files in my directory tree and then installs those same files?
Background
I have verified that the package created without settings for packages
and include_package_data
contains the correct files (only versioned files are included).
I think that the basic problem is that the logic that selects files for inclusion in the package is disconnected from the logic that determines which files to install from the package. Thus, the two sets of files (include and install) can be completely different and the install set is not necessarily even a subset of the include set. That is, it's quite possible to create packages containing files that will not get installed and to create packages which will attempt to install files that are not even in the package.
The include set logic runs at build time and the install set logic runs at install time. Factors that determine which files are in the sets include MANIFEST
, MANIFEST.in
, packages
, py_modules
, data_files
, include_package_data
, the files in the source folder tree, the files in the package and versioning metadata and, apparently, attempting to manipulate the install set may or may not also modify the include set.
So, if I don't specify any of MANIFEST
, MANIFEST.in
, packages
, py_modules
, data_files
and include_package_data
, setuptools creates an include set that is based exclusively on finding versioned files in the source folder tree. But this leaves the install set empty. Then, if I include a packages
parameter, setuptools breaks versioned file selection by adding unversioned files to the include set and uses all of these in the install set.
In other words, I'm trying to get the install set to exactly match the include set, without causing setuptools to add unversioned files to the include set.