PY2DSC(1)

πŸ“¦
version 0.10.2 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– PY2DSC πŸ’–

okay bestie, gather round, because today we're talking about py2dsc β€” a little User Command that lives in section 1 of your manual, and it is literally the moment your cute lil Python package gets a whole Debian glow-up. πŸ‘‘βœ¨


✨ NAME ✨

py2dsc β€” creates Debian source package from Python package πŸŽ€

like. that's it. that's the job. it takes your Python thing and makes it a Debian source package. iconic behavior fr fr. πŸ’…


🌸 DESCRIPTION 🌸

the vibe is, you run it like this:

usage: py2dsc [options] distfile

or, if you just wanna know what's up:

usage: py2dsc --help

and in that first one, distfile is a .zip or .tar.gz file built with the sdist command of distutils. so like, you already ran sdist, you got your lil tarball or zip, and now py2dsc takes it from there. πŸ¦‹


🌈 OPTIONS 🌈

here's the whole menu, no skips, no skimming, we eat every single one. πŸ“

  • --dist-dir, -d β€” the directory where the final built distributions get dropped. (default='deb_dist') πŸ“
  • --patch-already-applied, -a β€” the patch was already applied. this is used when py2dsc calls sdist_dsc. 🩹
  • --default-distribution β€” deprecated, bestie. see --suite instead. 🫠
  • --suite, -z β€” the distribution name to use if it's not specified in the .cfg. (default='unstable') 🎯
  • --default-maintainer β€” also deprecated. see --maintainer. 🫠
  • --maintainer, -m β€” the maintainer name and email to use if it's not specified in the .cfg. (default comes from setup.py) πŸ’Œ
  • --debian-version β€” the debian version. (Default: 1) πŸ”’
  • --extra-cfg-file, -x β€” an additional .cfg file, on top of stdeb.cfg if that one's already there. πŸ“„
  • --patch-file, -p β€” a patch file applied before setup.py is called. heads up: this is incompatible with a file specified in the .cfg. ⚠️
  • --patch-level, -l β€” a patch file applied before setup.py is called. and yeah, also incompatible with a file specified in the .cfg. ⚠️
  • --patch-posix, -q β€” apply the patch with --posix mode. 🧩
  • --remove-expanded-source-dir, -r β€” remove the expanded source directory. 🧹
  • --ignore-install-requires, -i β€” ignore the requirements from requires.txt in the egg-info directory. πŸ™ˆ
  • --pycentral-backwards-compatibility β€” this option has no effect, it's here for backwards compatibility, and it may be removed someday. πŸ’€
  • --workaround-548392 β€” also has no effect, also here for backwards compatibility, also may be removed someday. πŸ’€
  • --no-backwards-compatibility β€” same energy: no effect, backwards compatibility only, might get removed someday. πŸ’€
  • --guess-conflicts-provides-replaces β€” if True, attempt to guess Conflicts/Provides/Replaces in debian/control based on apt-cache output. (Default=False). πŸ”
  • --with-python2 β€” if True, build package for python 2. (Default=False). 🐍
  • --with-python3 β€” if True, build package for python 3. (Default=True). 🐍
  • --no-python2-scripts β€” if True, do not install scripts for python 2. (Default=False). 🚫
  • --no-python3-scripts β€” if True, do not install scripts for python 3. (Default=False). 🚫
  • --force-x-python3-version β€” override the default minimum python3:any dependency with the value from the x-python3- version. πŸ’ͺ
  • --allow-virtualenv-install-location β€” allow installing into /some/random/virtualenv-path. πŸŒ€
  • --compat, -c β€” Debian compatibility level. (Default=9) 🧷
  • --with-dh-virtualenv β€” use dh_virtualenv to build the package instead of python_distutils. this is useful to embed an application with all its dependencies and dont touch to the system libraries. πŸ“¦
  • --with-dh-systemd β€” adds the systemd addon that will dh_systemd_enable and dh_systemd_start helpers at the correct time during build. βš™οΈ
  • --sign-results β€” use gpg to sign the resulting .dsc and .changes file. πŸ”
  • --sign-key β€” specify the signing key. πŸ”‘
  • --ignore-source-changes β€” ignore all changes on source when building the source package (adds the -i.* option to dpkg-source). πŸ«₯
okay real talk for one sec: a couple of these are literally no-ops kept around for backwards compatibility (--pycentral-backwards-compatibility, --workaround-548392, --no-backwards-compatibility) and they may be removed someday, so don't build your whole personality around them. also --default-distribution and --default-maintainer are deprecated β€” use --suite and --maintainer instead. and the patch-file/patch-level situation is incompatible with a file specified in the .cfg, so pick a lane bestie. 🫢

aaaand that's the whole page! this was py2dsc version 0.10.2, from August 2025, and yes the footer said exactly that and we are mentioning it because the facts stay facts even when the vibe is a vibe. πŸ’œβœ¨ slay, go build your source package, mwah πŸŽ€

πŸ“¦ where this page comes from