{ "info": { "author": "Antony Lee", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: System :: Software Distribution" ], "description": "PyPI2PKGBUILD\n=============\n\nConvert PyPI packages to Arch Linux packages, inspired from pip2arch_.\n\n.. _pip2arch: https://github.com/bluepeppers/pip2arch\n\nHandles packages of all sizes, from the simplest (pure Python, no dependencies)\nto the most complex (C-level dependencies, external C libraries, etc., e.g.\nmost of the scientific Python stack, or GUI toolkits such as PyGObject and\nwxPython) [#]_.\n\n.. [#] ... with a bit of help.\n\n.. contents:: :local:\n\nDependencies and installation\n-----------------------------\n\n``pypi2pkgbuild.py`` depends on the Arch Linux packages namcap_, pkgfile_, and\npython-pip_ [#]_.\n\n.. _namcap: https://wiki.archlinux.org/index.php/Namcap\n.. _pkgfile: https://wiki.archlinux.org/index.php/Pkgfile\n.. _python-pip: https://wiki.archlinux.org/index.php/Python#Package_management\n\n.. [#] Officially, only the latest releases of pacman and pip are supported.\n In practice, the hard requirements that I am aware of are pacman\u22655.1\n (which changed the behavior of ``makepkg --printsrcinfo``) and pip\u226510\n (which changed the default format of ``pip --list``).\n\nThe script can be installed with ``pip install [--user] .``, or can also be run\ndirectly.\n\nOne can even run ``pypi2pkgbuild.py`` on itself to create a proper Arch package\n(``pypi2pkgbuild.py git+https://github.com/anntzer/pypi2pkgbuild``).\n\nA minimal test suite (checking that ``pypi2pkgbuild.py`` can indeed package\nitself) can by run with ``pytest`` (``pytest -s`` to keep the output to the\nterminal).\n\nUsage\n-----\n\n``pypi2pkgbuild.py PYPINAME`` creates a PKGBUILD for the latest version of the\ngiven PyPI package and the current version of the Python interpreter (Python 3\nonly). Prereleases are considered if the ``--pre`` flag is passed. Because\nPyPI's dependency information is somewhat unreliable, it installs the package\nin a venv to figure out the dependencies. Note that thanks to ``pip``'s wheel\ncache, the build is later reused; i.e. the procedure entails very little extra\nwork.\n\nA ``-git`` package can be built with ``pypi2pkbguild.py git+https://...``.\n\nThe package is then built and verified with ``namcap``.\n\nThe goal is to make this tool as automated as possible: if all the information\nto build a package is (reasonably) accessible, this tool should be able to\nbuild it.\n\nIn order to provide additional information to ``makepkg``, edit\n``PKGBUILD_EXTRAS`` (which can also be done with the ``--pkgbuild-extras``\nflag). This file is sourced at the *end* of ``PKGBUILD``. For ease of\npatching, the ``build``, ``package``, and, where applicable, ``pkgver``\nfunctions are defined by forwarding to ``_build``, ``_package``, and\n``_pkgver``. A ``_check`` function is also available, but not used (due to the\nlack of standard testing CLI). Some useful examples of ``PKGBUILD_EXTRAS`` are\nlisted in the ``pkgbuild-extras`` folder.\n\nUsage notes\n```````````\n\n- It is suggested to create an alias with standard options set, e.g.\n\n.. code-block:: sh\n\n alias pypi2pkgbuild.py='PKGEXT=.pkg.tar pypi2pkgbuild.py -g cython -b /tmp/pypi2pkgbuild/ -f'\n\n- By default, the ``pkgrel`` of (standard) packages is set to ``00``. This\n allows automatic upgrading into official packages (and AUR ones, if an AUR\n helper is used) whenever the repositories are updated. Additionally, the use\n of ``00`` rather than ``0`` serves as a (weak) marker that the package was\n automatically generated by this tool. In order to prevent such an upgrade,\n one can use the ``--pkgrel`` flag to set ``pkgrel`` to, e.g., ``99``.\n\n- If one wishes to completely bypass AUR Python packages while maintaining the\n use of an AUR helper for non-Python packages, one can define a shell function\n that excludes ``pypi2pkgbuild.py``-generated packages that do not appear in\n the official repositories, e.g., for ``pacaur``:\n\n .. code-block:: sh\n\n pacaur() {\n if [[ \"$1\" = \"-Syu\" ]]; then\n # Update, in case some packages moved in or out of the official repos.\n sudo pacman -Sy\n # Upgrade everything except python packages with pkgver=00 or 99.\n PKGEXT=.pkg.tar command pacaur -Su --ignore \\\n \"$(pacman -Qm | grep '^python-.*-\\(00\\|99\\)$' | cut -d' ' -f1 | paste -sd,)\"\n else\n command pacaur \"$@\"\n fi\n }\n\n This function will not bypass Python packages explicitly installed from the\n AUR, as the user may have done so to bypass some incorrect packaging by\n ``pypi2pkgbuild.py``. It is recommended to use the ``-i`` flag to calls\n to ``pypi2pkgbuild.py`` (e.g. in an alias) to exclude packages that are\n mishandled by ``pypi2pkgbuild.py`` (see `mispackaged packages`_). The ``-i``\n flag can be passed multiple times; passing an empty argument to it will clear\n the ignore list defined so far.\n\n .. _mispackaged packages: TODO.rst#mispackaged-packages\n\n- In order to package a locally available git repository, use\n\n .. code-block:: sh\n\n $ pypi2pkgbuild.py git+file://$absolute_path_to_repo # (e.g. file:///home/...)\n\n In order to package a locally available sdist or wheel, use\n\n .. code-block:: sh\n\n $ pypi2pkgbuild.py file://$absolute_path_to_file # (e.g. file:///home/...)\n\n Note that in both cases *absolute* paths are necessary.\n\n Building packages from local repos or wheels needs to be done in topological\n order of the dependencies (so that ``pypi2pkgbuild.py`` can find that\n the dependencies are actually present), or by passing the ``-d`` flag\n (\"do not build dependencies\"); if it is used, the Arch package may\n not use the correct dependency names (if they are not of the form\n ``python-pep503-normalized-name``).\n\n- By default, ``pypi2pkgbuild.py`` ignores ``pip`` config files such as\n ``~/.config/pip/pip.conf``. An explicitly set ``PIP_CONFIG_FILE`` will be\n respected, but may cause ``pypi2pkgbuild.py`` to fail as some ``pip`` calls\n will be unexpectedly modified.\n\n Likewise, user-site packages are ignored unless ``PYTHONNOUSERSITE`` is\n explicitly set to an empty value.\n\nBuild-time dependencies of packages\n-----------------------------------\n\n``pypi2pkgbuild.py`` attempts to guess whether ``Cython`` and ``SWIG`` are\nbuild-time dependencies by checking for the presence of ``.pyx`` and ``.i``\nfiles, respectively. If this is not desired, set the ``--guess-makedepends``\noption accordingly.\n\n``pypi2pkgbuild.py`` guesses whether ``numpy`` is a build-time dependency by\nattempting a build without ``numpy``, then, in case of failure, a build with\n``numpy``.\n\nAdditional Python build-time dependencies (i.e., ``setup_requires``) can be\nspecified (as PyPI names) using the ``--setup-requires`` flag, or just as\nnormal entries using ``--pkgbuild-extras`` (they will be installed into the\nbuild virtualenv).\n\nAdditional non-Python build-time dependencies can be set as ``makedepends``\nusing ``--pkgbuild-extras``; they will be installed *before*\n``pypi2pkgbuild.py`` attempts to build a wheel for the package.\n\nVendored packages\n-----------------\n\nSome Arch packages (e.g. ``ipython``) include a number of smaller PyPI\npackages.\n\nBecause it is not possible to assign a meaningful version automatically,\n``pypi2pkgbuild.py`` instead creates an independent Arch package for each of\nthe PyPI packages (with two dashes in the name, to prevent name conflicts) and\na master package that depends on all of them. The ``pkgrel`` of the master\npackage is set to ``$official_pkgrel.99``, so that the package appears more\nrecent than the current official version but older than any future official\nversion. All these packages ``conflict`` with all versions of the official\npackage (except the newly created package), so upgrading should work fine when\nthe official package is actually updated.\n\nHowever, dependencies are still expressed using the master package (to avoid\nbreakage on upgrade into an official package), so internal dependencies will\nappear be circular.\n\nAll the packages are placed in a subfolder named ``meta:$pkgname``, so one can\neasily install everything by ``cd``'ing there and running\n\n.. code-block:: sh\n\n $ sudo pacman -U --asdeps **/*.xz\n $ sudo pacman -D --asexplicit $pkgname/$pkgname.tar.xz\n\nHandling Python upgrades\n------------------------\n\nWhen the Python minor version (``x`` in ``3.x``) is upgraded, it is necessary\nto regenerate all self-built packages. This can be done e.g. with\n\n.. code-block:: sh\n\n $ pypi2pkgbuild.py $(\n ls /usr/lib/python3.$oldver/site-packages |\n grep -Po '.*(?=-.*.dist-info)'\n )\n\nComparison with other tools\n---------------------------\n\nComparison with pip2arch\n````````````````````````\n\n``pypi2pkgbuild.py`` includes many improvements over ``pip2arch``:\n\n- Supports wheels (the default is to prefer ``any``-platform wheels, then\n ``sdist``\\s, then ``manylinux1`` wheels, but this can be changed using\n ``--pkgtypes``).\n- Resolves Python dependencies via installation in a temporary virtualenv, and\n also creates PKGBUILDs for those that are not available as official packages.\n- Resolves binary dependencies via ``namcap`` and adds them to the ``depends``\n array if they are installed (thus, it is suggested to first install\n them as ``--asdeps`` and then let the generated PKGBUILD pick them up as\n dependencies). Note that some packages are distributed with a copy of the\n required libraries; in this case, ``pypi2pkgbuild.py``\u2019s behavior will depend\n on whether the package defaults to using the system-wide library or its own\n copy.\n- Automatically tries to fetch a missing license file from Github, if\n applicable.\n- Automatically builds the package (with options given in ``--makepkg=...``)\n and run ``namcap``.\n- Automatically builds all outdated dependencies via ``-u``.\n\nComparison with fpm\n```````````````````\n\nAnother tool for converting PyPI packages to Arch Linux packages is the generic\nconverter fpm_; however, it seems to be incompatible with recent versions of\n``pip``.\n\n.. _fpm: https://github.com/jordansissel/fpm\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/anntzer/pypi2pkgbuild", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pypi2pkgbuild", "package_url": "https://pypi.org/project/pypi2pkgbuild/", "platform": "", "project_url": "https://pypi.org/project/pypi2pkgbuild/", "project_urls": { "Homepage": "https://github.com/anntzer/pypi2pkgbuild" }, "release_url": "https://pypi.org/project/pypi2pkgbuild/0.2/", "requires_dist": [ "pip (>=10)", "setuptools", "wheel" ], "requires_python": ">=3.6", "summary": "A PyPI to PKGBUILD converter.", "version": "0.2" }, "last_serial": 4217871, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e156ff45f44aeb8c8075ccd80eda8bde", "sha256": "9b29e7192746732cfa6a446bed048a3f73c004d06332379bcc6c49c638ba0225" }, "downloads": -1, "filename": "pypi2pkgbuild-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e156ff45f44aeb8c8075ccd80eda8bde", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 23268, "upload_time": "2017-04-12T08:09:26", "url": "https://files.pythonhosted.org/packages/c6/e3/57d9b15ff4d697da87dce2b8adb27d735e54bb3fe2076d0041abd527286a/pypi2pkgbuild-0.1-py3-none-any.whl" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "5a2e99d0f613fff7723ee16929a3c031", "sha256": "01eea9b773d2d8504157ed5a33024cf3f1cf33d58bb416f4705efd5774ea879a" }, "downloads": -1, "filename": "pypi2pkgbuild-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5a2e99d0f613fff7723ee16929a3c031", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 22991, "upload_time": "2018-08-29T06:42:38", "url": "https://files.pythonhosted.org/packages/04/3d/64a31fdc05c775fbbc0fa36066c6271cfa58367ac4e2493b208393747c22/pypi2pkgbuild-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2fe22c32c784b441c48bbb205bc9a3e9", "sha256": "3387180d2864f09e67429eeaa41d3b9fba95ec1dd5badaae54a550003db70f98" }, "downloads": -1, "filename": "pypi2pkgbuild-0.2.tar.gz", "has_sig": false, "md5_digest": "2fe22c32c784b441c48bbb205bc9a3e9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 57102, "upload_time": "2018-08-29T06:42:40", "url": "https://files.pythonhosted.org/packages/6d/e9/f3352cd3f27f66a6de2b5fd6878adf10c0b52eee72bdfaef73f33b1b26d9/pypi2pkgbuild-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5a2e99d0f613fff7723ee16929a3c031", "sha256": "01eea9b773d2d8504157ed5a33024cf3f1cf33d58bb416f4705efd5774ea879a" }, "downloads": -1, "filename": "pypi2pkgbuild-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5a2e99d0f613fff7723ee16929a3c031", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 22991, "upload_time": "2018-08-29T06:42:38", "url": "https://files.pythonhosted.org/packages/04/3d/64a31fdc05c775fbbc0fa36066c6271cfa58367ac4e2493b208393747c22/pypi2pkgbuild-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2fe22c32c784b441c48bbb205bc9a3e9", "sha256": "3387180d2864f09e67429eeaa41d3b9fba95ec1dd5badaae54a550003db70f98" }, "downloads": -1, "filename": "pypi2pkgbuild-0.2.tar.gz", "has_sig": false, "md5_digest": "2fe22c32c784b441c48bbb205bc9a3e9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 57102, "upload_time": "2018-08-29T06:42:40", "url": "https://files.pythonhosted.org/packages/6d/e9/f3352cd3f27f66a6de2b5fd6878adf10c0b52eee72bdfaef73f33b1b26d9/pypi2pkgbuild-0.2.tar.gz" } ] }