#redirect Python/TransitionToDHPython2 ## page was renamed from Python/support2dhp2 = Converting python-support based package to dh_python2 = == Step by step == * Check if you can do the switch (all packages that use the same namespace have to be converted at the same time). * `apt-file search -lix '(packages|pyshared)/foo'` might help finding packages with the same namespace (replace `foo` with your namespace). * In debian/control: * Remove python-support from Build-Depends(-Indep). * Increase minimum required python-all (or python or python-all-dev) package version to `2.6.6-3~`. (read /usr/share/doc/python/changelog.Debian.gz to check if you need newer version) * Remove XB-Python-Version fields. * if you use CDBS: * bump minimum required cdbs version to `0.4.90~` * Remove the `DEB_PYTHON_SYSTEM` line, e.g. `sed -i -e '/DEB_PYTHON_SYSTEM[[:space:]]*[?:]*=[[:space:]]*pysupport/d' debian/rules` * if any of the modules are in a (Debian binary) package whose name isn't "python-*", set DEB_PYTHON2_MODULE_PACKAGES in debian/rules to the space-separated list of (Debian binary) package names you're building. * if you use dh sequencer: * add "python2" to dh's --with * if you use pure debhelper: * `sed -i -e 's/dh_pysupport/dh_python2/' debian/rules` * Remove `debian/pyversions` file and add an equivalent X-Python-Version field in debian/control instead. * (see [[http://www.debian.org/doc/packaging-manuals/python-policy/ch-module_packages.html#s-specifying_versions|policy]] for syntax, example: ">= 2.5") * XS-Python-Version is still supported, but consider replacing it with X-Python-Version (same syntax, except `current` and `all` keywords are gone). * If you don't know `foo`'s minimum required Python version, don't add this field until a bug report informs you that `foo` doesn't work with an older Python version. * If you depend on python-support's "namespace feature", remember to provide namespace (`__init__.py` file) only in one binary package. Create a new binary package, `python-foo-common`, if you cannot use and existing binary package. dh_python2 will include all `__init__.py` files, including empty ones. == Questions? == * Read [[http://alioth.debian.org/scm/loggerhead/pkg-python/python-defaults-debian/annotate/head:/dh_python2.rst|man dh_python2]] * If the question is related to dependencies, read [[http://alioth.debian.org/scm/loggerhead/pkg-python/python-defaults-debian/annotate/head:/pydist/README.PyDist|/usr/share/doc/python-doc/README.PyDist]] * Ask on the official [[irc://irc.debian.org/debian-python|#debian-python]] [[IRC|IRC channel]] * Ask on the official [[http://lists.debian.org/debian-python/|debian-python@lists.debian.org]] [[DebianMailingLists|mailing list]]