estobbart
estobbart

Reputation: 1145

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.

Upvotes: 5

Views: 1392

Answers (1)

MultiSkill
MultiSkill

Reputation: 416

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

Upvotes: 5

Related Questions