{"id":13502144,"url":"https://github.com/paylogic/py2deb","last_synced_at":"2025-04-05T04:09:24.803Z","repository":{"id":27846011,"uuid":"31336243","full_name":"paylogic/py2deb","owner":"paylogic","description":"Python to Debian package converter","archived":false,"fork":false,"pushed_at":"2021-11-11T23:32:25.000Z","size":1008,"stargazers_count":282,"open_issues_count":24,"forks_count":31,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-29T03:09:09.916Z","etag":null,"topics":["debian","debian-packaging","packaging","python"],"latest_commit_sha":null,"homepage":"https://py2deb.readthedocs.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"shreyanshk/smart_furniture","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paylogic.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-25T21:16:30.000Z","updated_at":"2025-03-25T06:20:36.000Z","dependencies_parsed_at":"2022-07-27T11:02:08.503Z","dependency_job_id":null,"html_url":"https://github.com/paylogic/py2deb","commit_stats":null,"previous_names":[],"tags_count":172,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paylogic%2Fpy2deb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paylogic%2Fpy2deb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paylogic%2Fpy2deb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paylogic%2Fpy2deb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paylogic","download_url":"https://codeload.github.com/paylogic/py2deb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284949,"owners_count":20913704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debian","debian-packaging","packaging","python"],"created_at":"2024-07-31T22:02:03.597Z","updated_at":"2025-04-05T04:09:24.780Z","avatar_url":"https://github.com/paylogic.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"py2deb: Python to Debian package converter\n==========================================\n\n.. image:: https://travis-ci.org/paylogic/py2deb.svg?branch=master\n   :target: https://travis-ci.org/paylogic/py2deb\n\n.. image:: https://coveralls.io/repos/paylogic/py2deb/badge.svg?branch=master\n   :target: https://coveralls.io/r/paylogic/py2deb?branch=master\n\nThe Python package py2deb_ converts Python source distributions to Debian\nbinary packages (the ones used for installation). It uses pip-accel_ (based on\npip_) to download, unpack and compile Python packages. Because of this py2deb_\nis compatible with the command line interface of the ``pip install`` command.\nFor example you can specify packages to convert as command line arguments but\nyou can also use `requirement files`_ if you want.\n\nDuring the conversion process dependencies are automatically taken into account\nand converted as well so you don't actually have to use requirement files\nincluding transitive dependencies. In fact you might prefer not explicitly\nlisting your transitive dependencies in requirement files because py2deb_ will\ntranslate the version constraints of Python packages into Debian package\nrelationships.\n\nThe py2deb_ package is currently tested on CPython_ 2.7, 3.5, 3.6, 3.7 and\nPyPy_ 2 and 3. Unfortunately Python 3.8+ is not yet supported (see below). For\nusage instructions please refer to the documentation hosted on `Read The\nDocs`_.\n\n.. contents::\n   :local:\n\nInstallation\n------------\n\nThe py2deb_ package is available on PyPI_, so installation is very simple:\n\n.. code-block:: console\n\n   $ pip install py2deb\n\nThere are some system dependencies which you have to install as well:\n\n.. code-block:: console\n\n   $ sudo apt-get install dpkg-dev fakeroot\n\nOptionally you can also install Lintian_ (which is not a hard dependency but\nmore of a \"nice to have\"):\n\n.. code-block:: console\n\n   $ sudo apt-get install lintian\n\nWhen Lintian is installed it will be run automatically to sanity check\nconverted packages. This slows down the conversion process somewhat but can be\nvery useful, especially when working on py2deb itself. Currently py2deb doesn't\nfail when Lintian reports errors, this is due to the unorthodox ways in which\npy2deb can be used. This may change in the future as py2deb becomes more\nmature.\n\nUsage\n-----\n\nThere are two ways to use the py2deb_ package: As the command line program\n``py2deb`` and as a Python API. For details about the Python API please refer\nto the API documentation hosted on `Read the Docs`_. The command line interface\nis described below.\n\nCommand line\n~~~~~~~~~~~~\n\n.. A DRY solution to avoid duplication of the `py2deb --help' text:\n..\n.. [[[cog\n.. from humanfriendly.usage import inject_usage\n.. inject_usage('py2deb.cli')\n.. ]]]\n\n**Usage:** `py2deb [OPTIONS] ...`\n\nConvert Python packages to Debian packages according to the given\ncommand line options (see below). The command line arguments are the\nsame as accepted by the \"pip install\" command because py2deb invokes\npip during the conversion process. This means you can name the\npackage(s) to convert on the command line but you can also use\n\"requirement files\" if you prefer.\n\nIf you want to pass command line options to pip (e.g. because you want\nto use a custom index URL or a requirements file) then you will need\nto tell py2deb where the options for py2deb stop and the options for\npip begin. In such cases you can use the following syntax:\n\n.. code-block:: sh\n\n  $ py2deb -r /tmp -- -r requirements.txt\n\nSo the \"--\" marker separates the py2deb options from the pip options.\n\n**Supported options:**\n\n.. csv-table::\n   :header: Option, Description\n   :widths: 30, 70\n\n\n   \"``-c``, ``--config=FILENAME``\",\"Load a configuration file. Because the command line arguments are processed\n   in the given order, you have the choice and responsibility to decide if\n   command line options override configuration file options or vice versa.\n   Refer to the documentation for details on the configuration file format.\n   \n   The default configuration files /etc/py2deb.ini and ~/.py2deb.ini are\n   automatically loaded if they exist. This happens before environment\n   variables and command line options are processed.\n   \n   Can also be set using the environment variable ``$PY2DEB_CONFIG``.\"\n   \"``-r``, ``--repository=DIRECTORY``\",\"Change the directory where \\*.deb archives are stored. Defaults to\n   the system wide temporary directory (which is usually /tmp). If\n   this directory doesn't exist py2deb refuses to run.\n   \n   Can also be set using the environment variable ``$PY2DEB_REPOSITORY``.\"\n   \"``--use-system-package=PYTHON_PACKAGE_NAME,DEBIAN_PACKAGE_NAME``\",\"Exclude a Python package (the name before the comma) from conversion and\n   replace references to the Python package with a specific Debian package\n   name. This allows you to use system packages for specific Python\n   requirements.\"\n   ``--name-prefix=PREFIX``,\"Set the name prefix used during the name conversion from Python to\n   Debian packages. Defaults to \"\"python\"\". The name prefix and package\n   names are always delimited by a dash.\n   \n   Can also be set using the environment variable ``$PY2DEB_NAME_PREFIX``.\"\n   ``--no-name-prefix=PYTHON_PACKAGE_NAME``,\"Exclude a Python package from having the name prefix applied\n   during the package name conversion. This is useful to avoid\n   awkward repetitions.\"\n   \"``--rename=PYTHON_PACKAGE_NAME,DEBIAN_PACKAGE_NAME``\",\"Override the package name conversion algorithm for the given pair\n   of package names. Useful if you don't agree with the algorithm :-)\"\n   ``--install-prefix=DIRECTORY``,\"Override the default system wide installation prefix. By setting\n   this to anything other than \"\"/usr\"\" or \"\"/usr/local\"\" you change the\n   way py2deb works. It will build packages with a file system layout\n   similar to a Python virtual environment, except there will not be\n   a Python executable: The packages are meant to be loaded by\n   modifying Python's module search path. Refer to the documentation\n   for details.\n   \n   Can also be set using the environment variable ``$PY2DEB_INSTALL_PREFIX``.\"\n   \"``--install-alternative=LINK,PATH``\",\"Use Debian's \"\"update-alternatives\"\" system to add an executable\n   that's installed in a custom installation prefix (see above) to\n   the system wide executable search path. Refer to the documentation\n   for details.\"\n   ``--python-callback=EXPRESSION``,\"Set a Python callback to be called during the conversion process. Refer to\n   the documentation for details about the use of this feature and the syntax\n   of ``EXPRESSION``.\n   \n   Can also be set using the environment variable ``$PY2DEB_CALLBACK``.\"\n   ``--report-dependencies=FILENAME``,\"Add the Debian relationships needed to depend on the converted\n   package(s) to the given control file. If the control file already\n   contains relationships the additional relationships will be added\n   to the control file; they won't overwrite existing relationships.\"\n   \"``-y``, ``--yes``\",\"Instruct pip-accel to automatically install build time dependencies\n   where possible. Refer to the pip-accel documentation for details.\n   \n   Can also be set using the environment variable ``$PY2DEB_AUTO_INSTALL``.\"\n   \"``-v``, ``--verbose``\",Make more noise :-).\n   \"``-h``, ``--help``\",Show this message and exit.\n\n.. [[[end]]]\n\nFuture improvements\n-------------------\n\nThe following sections list possible improvements to the project:\n\n.. contents::\n   :local:\n\n.. _Python 3.8+ compatibility:\n\nPython 3.8+ compatibility\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe py2deb_ project builds on top of pip-accel_, which was developed between\n2013 and 2015 on top of ``pip \u003e= 7.0, \u003c 7.2``. Since that time pip_ has grown\nenormously: At the time of writing (in August 2020) we're now at pip 20!\n\nNone of the improvements made between pip 7-20 are available in pip-accel and\npy2deb and this has become somewhat of a glaring issue that plenty of users\nhave run into (see `#17`_, `#18`_, `#27`_ and `#31`_).\n\nKnown issues being caused by this include:\n\n- The old pip version prevents Python 3.8+ compatibility.\n\n- The old pip version doesn't know about ``python_requires`` metadata provided\n  by PyPI and this forces users to maintain constraints files themselves, even\n  though this shouldn't be necessary.\n\n- While pip-accel supports installation from wheels, it was never exposed via\n  the Python API and so py2deb lacks support for converting wheels (it\n  currently needs source distributions).\n\nThe current state of affairs is best summarized in `this comment`_. I'm hoping\nto complete the upgrade to newer pip and pip-accel releases in the coming weeks\n(as of this writing in August 2020) but can't commit to a date.\n\n.. _this comment: https://github.com/paylogic/py2deb/issues/18#issuecomment-633848582\n\nInstallation of system wide files\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFind a way to facilitate (explicit / opt-in) installation of system wide files\n(not related to Python per se) based on a Python distribution? This could\nsignificantly reduce the need for \"wrapper packages\" that basically just pull\nin packages converted by py2deb and drop a few configuration files into place.\n\n:Related issues: See issue `#7`_ for a related discussion.\n\nConversion of binary wheels\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nInvestigate the feasability of supporting conversion of binary wheels. Slowly\nbut surely the Python community seems to be gravitating towards (binary) wheels\nand once gravity has shifted we don't want to be left in the dust! 😉\n\nFull PEP-440 compatibility\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nDive into PEP-440_ and see if it can be fully supported? Then `this question on\nReddit`_ can finally get a satisfying answer 🙂.\n\nSimilar projects\n----------------\n\nThere are several projects out there that share similarities with py2deb, for\nexample I know of stdeb_, dh-virtualenv_ and fpm_. The documentation includes a\nfairly `detailed comparison`_ with each of these projects.\n\nContact\n-------\n\nThe latest version of py2deb is available on PyPI_ and GitHub_. The\ndocumentation is hosted on `Read the Docs`_ and includes a changelog_. For\nquestions, bug reports, suggestions, etc. please create an issue on GitHub_.\n\nLicense\n-------\n\nThis software is licensed under the `MIT license`_.\n\n© 2020 Peter Odding, Arjan Verwer and Paylogic International.\n\n.. External references:\n.. _CPython: https://en.wikipedia.org/wiki/CPython\n.. _GitHub: https://github.com/paylogic/py2deb\n.. _Lintian: http://en.wikipedia.org/wiki/Lintian\n.. _MIT license: http://en.wikipedia.org/wiki/MIT_License\n.. _PEP-440: https://www.python.org/dev/peps/pep-0440/\n.. _Pillow: https://python-pillow.github.io/\n.. _PyPI: https://pypi.org/project/py2deb\n.. _PyPy: https://en.wikipedia.org/wiki/PyPy\n.. _Read The Docs: https://py2deb.readthedocs.io\n.. _changelog: https://py2deb.readthedocs.io/en/latest/changelog.html\n.. _deb-pkg-tools: https://pypi.org/project/deb-pkg-tools\n.. _detailed comparison: https://py2deb.readthedocs.io/en/latest/comparisons.html\n.. _dh-virtualenv: https://github.com/spotify/dh-virtualenv\n.. _fpm: https://github.com/jordansissel/fpm\n.. _pip-accel: https://pypi.org/project/pip-accel\n.. _pip: https://pypi.org/project/pip\n.. _py2deb: https://pypi.org/project/py2deb\n.. _python-imaging: https://packages.debian.org/search?keywords=python-imaging\n.. _python-pil: https://packages.debian.org/search?keywords=python-pil\n.. _requirement files: http://www.pip-installer.org/en/latest/cookbook.html#requirements-files\n.. _stdeb: https://pypi.org/project/stdeb\n.. _this question on Reddit: https://www.reddit.com/r/Python/comments/2x7s17/py2deb_python_to_debian_package_converter/coxyyzu\n.. _#7: https://github.com/paylogic/py2deb/issues/7\n.. _#17: https://github.com/paylogic/py2deb/issues/17\n.. _#18: https://github.com/paylogic/py2deb/issues/18\n.. _#27: https://github.com/paylogic/py2deb/issues/27\n.. _#31: https://github.com/paylogic/py2deb/issues/31\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaylogic%2Fpy2deb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaylogic%2Fpy2deb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaylogic%2Fpy2deb/lists"}