Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I found a Python project with a MANIFEST.in file. I can guess at the meaning of much of it, but I am unclear on the meaning of the line:

graft tools 
like image 440
Michael Felt Avatar asked Jan 15 '17 13:01

Michael Felt


People also ask

What is graft in a MANIFEST?

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.

What is MANIFEST in file python?

A MANIFEST.in file consists of commands, one per line, instructing setuptools to add or remove some set of files from the sdist.

What is Sdist in python?

Source distribution file format tar. gz source distribution (sdist) contains a single top-level directory called {name}-{version} (e.g. foo-1.0 ), containing the source files of the package. The name and version MUST match the metadata stored in the file. This directory must also contain a pyproject.

What is the command used for building a source distribution python setup py?

To build a source distribution, use the command line to navigate to the directory containing setup.py, and run the command python setup.py sdist. Run python setup.py bdist or, for Windows, python setup.py bdist_wininst to build a binary distribution.


1 Answers

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 the MANIFEST.in file and interpret it to generate the MANIFEST file that contains the list of files that will be included in the package.

The manifest template has one command per line, where each command specifies a set of files to include or exclude from the source distribution.

Among the MANIFEST commands, you do have:

graft dir 

include all files under dir

See the Distutils tutorial

The MANIFEST.in file took me a while to understand.
It's the file that distutils uses to collect all the files in your project that will go into the final installer tarball (the file that gets distributed).

like image 58
VonC Avatar answered Sep 20 '22 14:09

VonC