DH_PYPY(1)
π 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
pypyanddh-python, - add
${pypy:Depends}toDepends - build module/application using its standard build system,
- install files to the standard locations,
- add
pypytodh's--withoption, or: - call
dh_pypyin thebinary-*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:
- If the
pypy-foosource package ships with adebian/pypy-overridesfile, this file is used bydh_pypyduring the build ofpypy-foo. - If the
pypy-barsource package ships with adebian/pypy-bar.pydistfile (and usesdh_pypy), this file will be included in the binary package as/usr/share/dh-python/dist/pypy/pypy-bar. During the build ofpypy-foo,dh_pypywill 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 inpostinst/rtupdate, not just the ones provided by the package (i.e. do not pass the--packageparameter topy3compile/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 inrequires.txt--depends-sections=SECTIONSβ translate requirements from given sections ofrequres.txtfile 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 ofrequres.txtfile 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 ofrequres.txtfile 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 π
/usr/share/doc/dh-python/README.PyDistpybuild(1)http://deb.li/dhpyβ most recent version of this document
β 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
- ubuntu jammy: dh-python 5.20220403 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms