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.
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 ( .
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.
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.
A MANIFEST.in file consists of commands, one per line, instructing setuptools to add or remove some set of files from the sdist.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With