Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print path of output from python setup.py sdist

Is there way to get the path of the tar file that setup.py sdist built? I know where it is, but I'm looking to script it without having to ls dist/ etc. I'm ok to override the command too if theres a variable that distutils assigns it too, or a function that will return it.

like image 496
estobbart Avatar asked Apr 06 '16 21:04

estobbart


People also ask

What is python setup py Sdist?

In the simplest case, python setup. py sdist. (assuming you haven't specified any sdist options in the setup script or config file), sdist creates the archive of the default format for the current platform. The default format is a gzip'ed tar file ( .

What is Sdist and Bdist?

sdist is a "source distribution". bdist is a "binary distribution". For a pure Python project, those things are pretty close. If your project includes any extension modules, though, the sdist includes the source for those extension modules and use of the sdist will require a compiler.

What is setup CFG python?

The setup. cfg is an ini file, containing option defaults for setup.py commands. You can pretty much specify every keyword we used in the setup.py file in the new setup. cfg file and simply use the setup.py file as the command line interface.

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.


1 Answers

It looks like you can do:

python setup.py sdist --formats=gztar
FNAME=dist/`python setup.py --fullname`.tar.gz
echo $FNAME

Using the formats parameter to ensure that the file is going to be tar.gz Have checked this script on a setup.py with setup from setuptools. Should work with distutils too. You can override the dist folder, have a look at:

python setup.py sdist --help
like image 106
MultiSkill Avatar answered Oct 09 '22 08:10

MultiSkill