Wednesday, 15 January 2014

Python setuptools sdist: Installing only versioned files -



Python setuptools sdist: Installing only versioned files -

i create source distribution bundle automatically contains subversion versioned files , installs same files.

if utilize setuptools.setup() phone call in setup.py not contain setting packages or include_package_data , run python setup.py sdist build, bundle contains versioned files, need. however, when effort install package, empty directories created. none of files installed.

if include packages = setuptools.find_packages() , run python setup.py sdist build, bundle contains files in source tree instead of versioned files. when install package, files in bundle installed.

the other parameters utilize in setup() metadata (name, version, etc).

how create bundle contains versioned files in directory tree , installs same files?

background

i have verified bundle created without settings packages , include_package_data contains right files (only versioned files included).

i think basic problem logic selects files inclusion in bundle disconnected logic determines files install package. thus, 2 sets of files (include , install) can different , install set not subset of include set. is, it's quite possible create packages containing files not installed , create packages effort install files not in package.

the include set logic runs @ build time , install set logic runs @ install time. factors determine files in sets include manifest, manifest.in, packages, py_modules, data_files, include_package_data, files in source folder tree, files in bundle , versioning metadata and, apparently, attempting manipulate install set may or may not modify include set.

so, if don't specify of manifest, manifest.in, packages, py_modules, data_files , include_package_data, setuptools creates include set based exclusively on finding versioned files in source folder tree. leaves install set empty. then, if include packages parameter, setuptools breaks versioned file selection adding unversioned files include set , uses of these in install set.

in other words, i'm trying install set match include set, without causing setuptools add together unversioned files include set.

i found way create setuptools back upwards this. supply packages list when bundle installed , leave none when bundle built. utilize include_package_data = true info files installed (without it, info files included in bundle not installed).

if 'install' in sys.argv: packages = setuptools.find_packages() else: packages = none setuptools.setup( packages = packages, include_package_data = true, ... )

python setuptools

No comments:

Post a Comment