DH_PYPY(1)

πŸ“¦ version 5.20220403, in ubuntu jammy

πŸ’… DH_PYPY β€” the manual page, bestie edition πŸ’…

okay so this is dh_pypy, from the DH_PYPY(1) manual. she's the girl who calculates PyPy dependencies, adds maintainer scripts to byte compile files, etc. yes "etc." she does a lot. sit down, we're doing this together 🫢


✨ SYNOPSIS ✨

dh_pypy -p PACKAGE [-V [X.Y][-][A.B]] DIR [-X REGEXPR]

that's the whole vibe. short. iconic. no notes.


🌸 DESCRIPTION 🌸

πŸŽ€ QUICK GUIDE FOR MAINTAINERS

bestie. the checklist. do these in order and you're golden:

  • build-depend on pypy and dh-python,
  • add ${pypy:Depends} to Depends
  • build module/application using its standard build system,
  • install files to the standard locations,
  • add pypy to dh's --with option, or:
  • call dh_pypy in the binary-* target,

that's it. that's the list. go slay πŸ’–

🧚 NOTES

πŸ’œ dependencies

so here's the thing. dh_pypy tries to translate Python dependencies from the requires.txt file into Debian dependencies. and like, in many cases this Just Worksβ„’ with zero extra config, because dh_pypy ships with a build-in mapping of Python module names β†’ Debian packages, and that mapping gets periodically regenerated from the Debian archive. it's giving self-updating queen. by default though, the version info in the Python dependencies gets discarded. if you want dh_pypy to generate more strict dependencies (say, to dodge ABI problems), or if the automatic mapping is simply not doing it for your package, then you gotta hand dh_pypy some extra rules for translating Python module β†’ Debian package dependencies.

so say you've got a package pypy-foo that depends on a package pypy-bar. there are two files that might carry those rules:

  1. If the pypy-foo source package ships with a debian/pypy-overrides file, this file is used by dh_pypy during the build of pypy-foo.
  2. If the pypy-bar source package ships with a debian/pypy-bar.pydist file (and uses dh_pypy), this file will be included in the binary package as /usr/share/dh-python/dist/pypy/pypy-bar. During the build of pypy-foo, dh_pypy will then find and use the file.

both files have the exact same format, described in /usr/share/doc/dh-python/README.PyDist. and if literally all you want is to generate versioned dependencies (and you're assuming the pypy-bar package provides the pybar Python module β€” which, fair), then in most cases it's enough to drop this one line:

pybar pypy-bar; PEP386

into either of the files above. periodt. ✨

πŸ¦‹ namespace feature

dh_pypy parses Egg's namespace_packages.txt files (on top of the --namespace command line argument(s)) and drops empty __init__.py files from the binary package. pypycompile will regenerate them at install time, and pypyclean will remove them at uninstall time (if they're no longer used in installed packages). that said, it's still a good idea to provide an __init__.py file in one of the binary packages β€” even if all the other packages use this feature. just do it. πŸ™ˆ

πŸ“ private dirs

by default, dh_pypy scans these private directories for Python files:

  • /usr/share/foo
  • /usr/share/games/foo
  • /usr/lib/foo
  • /usr/lib/games/foo

(where foo is the binary package name, iykyk). if your package ships Python files in some other directory, add another dh_pypy call in debian/rules with the directory name as an argument β€” and feel free to use a different set of options in that call, she's flexible like that. and if you need to change options for a private directory that's checked by default, invoke dh_pypy with the --skip-private option and add another call with a path to this directory and your new options. πŸ’…

πŸ’€ debug packages

in binary packages whose name ends with -dbg, all files in /usr/lib/pypy/dist-packages/ that have extensions different than so or h are removed by default. if you don't want that, use --no-dbg-cleaning to disable the whole feature.

🌈 overriding supported / default PyPy versions

want to override the system's list of supported PyPy versions, or the default one? (like, say, to build a package that includes symlinks for an older version of PyPy, or to compile .py files only for a given interpreter version.) you can do that with the DEBPYPY_SUPPORTED and/or DEBPYPY_DEFAULT env. variables. go off. πŸ‘‘


πŸ‘‘ OPTIONS πŸ‘‘

  • --version β€” show program's version number and exit
  • -h, --help β€” show help message and exit
  • --no-guessing-deps β€” disable guessing dependencies
  • --no-dbg-cleaning β€” do not remove any files from debug packages
  • --no-ext-rename β€” do not add magic tags nor multiarch tuples to extension file names
  • --no-shebang-rewrite β€” do not rewrite shebangs
  • --skip-private β€” don't check private directories
  • -v, --verbose β€” turn verbose mode on
  • -i, --indep β€” act on architecture independent packages
  • -a, --arch β€” act on architecture dependent packages
  • -q, --quiet β€” be quiet
  • -p PACKAGE, --package=PACKAGE β€” act on the package named PACKAGE
  • -N NO_PACKAGE, --no-package=NO_PACKAGE β€” do not act on the specified package
  • -X REGEXPR, --exclude=REGEXPR β€” exclude items that match given REGEXPR. you may use this option multiple times to build up a list of things to exclude. (stack 'em, bestie)
  • --compile-all β€” compile all files from given private directory in postinst/rtupdate, not just the ones provided by the package (i.e. do not pass the --package parameter to py3compile/py3clean)
  • --accept-upstream-versions β€” accept upstream versions while translating Python dependencies into Debian ones
  • --depends=DEPENDS β€” translate given requirements into Debian dependencies and add them to ${pypy:Depends}. use it for missing items in requires.txt
  • --depends-sections=SECTIONS β€” translate requirements from given sections of requres.txt file into Debian dependencies and add them to ${pypy:Depends}.
  • --recommends=RECOMMENDS β€” translate given requirements into Debian dependencies and add them to ${pypy:Recommends}
  • --recommends-sections=SECTIONS β€” translate requirements from given sections of requres.txt file into Debian dependencies and add them to ${pypy:Recommends}.
  • --suggests=SUGGESTS β€” translate given requirements into Debian dependencies and add them to ${pypy:Suggests}
  • --suggests-sections=SECTIONS β€” translate requirements from given sections of requres.txt file into Debian dependencies and add them to ${pypy:Suggests}.
  • --requires=FILENAME β€” translate requirements from given file(s) into Debian dependencies and add them to ${pypy:Depends}
  • --shebang=COMMAND β€” use given command as shebang in scripts
  • --ignore-shebangs β€” do not translate shebangs into Debian dependencies

πŸ’– SEE ALSO πŸ’–


⭐ AUTHOR ⭐

Piotr OΕΌarowski, 2013


and that's the whole page, bestie!! this was DH_PYPY(1), brought to you by the dh-python girlies, and yes the date/version footer is exactly the same one β€” same manual, same source, no cap. now go build something cute πŸ«ΆπŸ’œβœ¨

πŸ“¦ where this page comes from