python - How do you add additional files to a wheel? -
python - How do you add additional files to a wheel? -
how command files included in wheel? appears manifest.in isn't used python setup.py bdist_wheel.
update:
i wrong difference between installing source tarball vs wheel. source distribution includes files specified in manifest.in, installed bundle has python files. steps needed identify additional files should installed, whether install via source distribution, egg, or wheel. namely, package_data needed additional bundle files, , data_files files outside bundle command line scripts or scheme config files.
i have a project i've been using python setup.py sdist build package, manifest.in command files included , excluded, , pyroma , check-manifest confirm settings.
i converted dual python 2 / 3 code, , added setup.cfg with
[bdist_wheel] universal = 1 i can build wheel python setup.py bdist_wheel, , appears universal wheel desired. however, doesn't include of files specified in manifest.in.
i dug deeper, , know more packaging , wheel. here's learned:
i upload 2 bundle files multigtfs project on pypi:
multigtfs-0.4.2.tar.gz - source tar ball, includes files in manifest.in. multigtfs-0.4.2-py2.py3-none-any.whl - binary distribution in question. i created 2 new virtual environments, both python 2.7.5, , installed each bundle (pip install multigtfs-0.4.2.tar.gz). 2 environments identical. have different .pyc files, "compiled" python files. there log files record different paths on disk. install source tar ball includes folder multigtfs-0.4.2-py27.egg-info, detailing installation, , wheel install has multigtfs-0.4.2.dist-info folder, details of process. however, point of view of code using multigtfs project, there no difference between 2 installation methods.
explicitly, neither has .zip files used test, test suite fail:
$ django-admin startproject demo $ cd demo $ pip install psycopg2 # db driver postgis project $ createdb demo # create postgresql database $ psql -d demo -c "create extension postgis" # create postgis database $ vi demo/settings.py # add together multigtfs installed_apps, # update database set engine django.contrib.gis.db.backends.postgis # update database set name test $ ./manage.py test multigtfs.tests # run tests ... ioerror: [errno 2] no such file or directory: u'/users/john/.virtualenvs/test/lib/python2.7/site-packages/multigtfs/tests/fixtures/test3.zip' specifying additional files using suggestions answers, added additional directives setup.py:
from __future__ import unicode_literals # setup.py requires funky binary strings ... setup( name='multigtfs', packages=find_packages(), package_data={b'multigtfs': ['test/fixtures/*.zip']}, include_package_data=true, ... ) this installs zip files (as readme) folder, , tests run correctly. suggestions!
have tried using package_data in setup.py? manifest.in seems targetted python versions <= 2.6, i'm not sure if higher versions @ it.
after exploring https://github.com/pypa/sampleproject, manifest.in says:
# if using python 2.6 or less, have include bundle data, though # it's declared in setup.py include sample/*.dat which seems imply method outdated. meanwhile, in setup.py declare:
setup( name='sample', ... # if there info files included in packages need # installed, specify them here. if using python 2.6 or less, these # have included in manifest.in well. package_data={ 'sample': ['package_data.dat'], }, ... ) (i'm not sure why chose wildcard in manifest.in , filename in setup.py. refer same file)
which, along beingness simpler, 1 time again seems imply package_data route superior manifest.in method. well, unless have back upwards 2.6 is, in case prayers go out you.
python pip python-wheel
Comments
Post a Comment