Questions tagged [sdist]
40 questions
57
votes
2 answers
What is the difference between an 'sdist' .tar.gz distribution and an python egg?
I am a bit confused. There seem to be two different kind of Python packages, source distributions (setup.py sdist) and egg distributions (setup.py bdist_egg).
Both seem to be just archives with the same data, the python source files. One difference…

Peter Smit
- 27,696
- 33
- 111
- 170
30
votes
3 answers
python setup.py sdist only including .py source from top level module
I have a setup.py:
from setuptools import setup
setup(
...
packages=['mypackage'],
test_suite='mypackage.tests',
...
)
python setup.py sdist creates a file that includes only the source modules from top-level mypackage…

user1561108
- 2,666
- 9
- 44
- 69
15
votes
1 answer
How to distribute files in a Python sdist that are not VCS tracked?
I would like to find the proper way to include files in a python sdist that are not tracked by git.
Context
The .mo files from my project are not tracked by git (like some other .txt files that need to be created at install time).
I have written a…

zezollo
- 4,606
- 5
- 28
- 59
9
votes
1 answer
Using a dynamic version when building a Python package with Setuptools (setup.py)
We have a big legacy project that contains some python code inside, the version of all components in the project is set during runtime by the build system which builds the project. We now need to package the python code with the same version used by…

Noam Helmer
- 5,310
- 1
- 9
- 29
9
votes
4 answers
Output directories for python setup.py sdist bdist_wheel
When doing
python setup.py sdist bdist_wheel
it creates build, dist, packagename.egg-info directories. I'd like to have them out of the current folder.
I tried:
--dist-dir=../dist: works with sdist but packagename.egg-info is still…

Basj
- 41,386
- 99
- 383
- 673
6
votes
1 answer
sdist error: option --manifest-only not recognized
Everytime I use sdist to creat the MANIFEST file with the command:
'python setup.py sdist --manifest-only'
The terminal always outputs this error msg.
error: option --manifest-only not recognized
I don't know why and am looking for help.

higery
- 63
- 4
6
votes
0 answers
Perform a command after pip install
I bundle my package as a sdist zip file , after that i can import my package anywhere using pip install , but i want to run some post install commands automatically after calling pip install.
I cannot use python setup.py install because it is a…

Sajid Manzoor
- 487
- 1
- 5
- 9
6
votes
1 answer
Force `sdist` to create .zip archive even on Linux
I know it is possible to force sdist to produce .zip from command line:
python setup.py sdist --formats=zip
But how to make this option a default for my setup.py?
I'd like to get consistency for running setup.py sdist on both Windows and Linux, and…

anatoly techtonik
- 19,847
- 9
- 124
- 140
4
votes
1 answer
Python: How to make Poetry include a package/module that's not on a subpath?
I have, in a single repo, two Python projects that both depend on a shared utility package. My goal is to package each of the two projects in a software distribution package (i.e. a .tzr.gz file)
I am currently getting this done using setuptools and…

urig
- 16,016
- 26
- 115
- 184
4
votes
2 answers
Possible to create python sdist from different directory?
Want to create python source distribution by running python setup.py sdist from a directory outside of the one I want to package up. Can't seem to find a way to do this. I have a script that generates a setup.py and MANIFEST.in dynamically, and I'd…

chacmool
- 1,357
- 2
- 16
- 21
4
votes
0 answers
"Package directory does not exist" when running setup.py with sdist
I've got a game.py in ex48\ex48\game.py and my setup.py in ex48\docs\setup.py, I have init.py in both ex48\ex48__init.py and ex48\tests__init__.py . Game.py contains the following code:
class lexicon(object):
def __init__(self):
pass
def…

Cdhippen
- 615
- 1
- 10
- 32
4
votes
0 answers
Is there a tool to check Python distribution (sdist) files?
We've had the case where we released a Python source distribution (sdist) file on PyPI, and there was an issue that was only noticed after making the release. Namely for some files, the permissions were set to not allow read by all, and then in some…

Christoph
- 2,790
- 2
- 18
- 23
3
votes
1 answer
Python generate sdist and upload it in a separate step
I am building several Python packages and would like to upload them only if all the packages have been successfully built. I have a separate stage for each Python package, whose sdist is carried to the last stage where all collected sdists should be…

linkyndy
- 17,038
- 20
- 114
- 194
2
votes
1 answer
sdist/bdist_wheel not including pyc in Linux but is included in Windows
I am trying to create a Python distribution where I have to include both the source and the compiled binary. (Yes, I read arguments against/for adding .pyc, but my use case requires the .pyc to be added). Running my steps in Windows, both the source…

MervS
- 5,724
- 3
- 23
- 37
2
votes
1 answer
Running sDist to build a package and install creates empty Build Directory
created a setup file. with the following code where setup.py is
import sys
from distutils.core import setup
setup(
name='SomePackage',
author='dave',
version='0.1.0',
author_email='dave',
packages=['apples',],
…

dfresh22
- 961
- 1
- 15
- 23