What is the graft command in Python’s MANIFEST.in file?

You can see such a file in JoshData/pdfminer/MANIFEST.in or openstack/deb-python-falcon/MANIFEST.in for instance. It is a python project which uses the MANIFEST.in template A MANIFEST.in file can be added in a project to define the list of files to include in the distribution built by the sdist command. When sdist is run, it will look for … Read more

Setting up setup.py for packaging of a single .py file and a single data file without needing to create any folders

If you have a single-file module like this, no folder will be created, your .py file will be moved directly into the directory which contains the other python modules (/usr/lib/pythonX.X/site-packages/, for example). That’s why you have to create a directory: $ . |– happy_birthday/ |– __init__.py |– art.txt |– MANIFEST.in |– README.rst |– setup.py

How can I include package_data without a MANIFEST.in file?

TL;DR: The keys in the package_data dictionaries are packages; the values are lists of globs. ” is not a valid name for any Python package. If you want to have bar.txt be installed next to the __init__.py of package foo, use package_data={‘foo’: [‘bar.txt’]} I have the layout: foo/ __init__.py bar.txt setup.py Now, if foo is … Read more

How can you bundle all your python code into a single zip file?

You can automate most of the work with regular python tools. Let’s start with clean virtualenv. [zart@feena ~]$ mkdir ziplib-demo [zart@feena ~]$ cd ziplib-demo [zart@feena ziplib-demo]$ virtualenv . New python executable in ./bin/python Installing setuptools………….done. Installing pip……………done. Now let’s install set of packages that will go into zipped library. The trick is to force installing … Read more

How to include and install local dependencies in setup.py in Python?

There is a new technique (Since version 19.1) called Direct references. Just pretend like your file is hosted on localhost. from setuptools import setup path_to_my_project = “/home/user/projects/my_package” # Do any sort of fancy resolving of the path here if you need to setup(# … other arguments install_requires=[f”my_package @ file://localhost/{path_to_my_project}#egg=my_package”] )

Is it possible to include subdirectories using dist utils (setup.py) as part of package data?

I believe what you’re looking for is something like this for you setup.py, which will recursively find any packages in the project, also be sure and include __init__.py files to subdirectories for each package you want. from setuptools import setup, find_packages setup(name=”MySoftware”, packages=find_packages() )

Install python packages to correct anaconda environment

It looks like conda automatically adds pip to your conda environment, so after you source your conda environment, i.e.: source activate ~/anaconda/envs/dataset you should be able to install it like this: git clone git://github.com/pudo/dataset.git pip install ./dataset EDIT Here are the exact steps I took: $ conda create -p ~/anaconda/envs/py33 python=3.3 anaconda pip $ source … Read more