{"id":15059262,"url":"https://github.com/opensuse/py2pack","last_synced_at":"2025-04-12T19:47:24.717Z","repository":{"id":648377,"uuid":"1144624","full_name":"openSUSE/py2pack","owner":"openSUSE","description":"Generate distribution packages from PyPI","archived":false,"fork":false,"pushed_at":"2025-01-27T07:22:00.000Z","size":486,"stargazers_count":69,"open_issues_count":24,"forks_count":40,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-12T19:47:21.671Z","etag":null,"topics":["debian","fedora","opensuse","packaging","rpm","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openSUSE.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-12-06T21:58:39.000Z","updated_at":"2025-03-02T13:49:53.000Z","dependencies_parsed_at":"2024-05-18T13:37:50.144Z","dependency_job_id":"9c148efd-dce8-4ae0-ab49-530544fe5f14","html_url":"https://github.com/openSUSE/py2pack","commit_stats":{"total_commits":434,"total_committers":41,"mean_commits":"10.585365853658537","dds":0.7419354838709677,"last_synced_commit":"959a7544233a2efc25d0818185ade5a97bbcdf66"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openSUSE%2Fpy2pack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openSUSE%2Fpy2pack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openSUSE%2Fpy2pack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openSUSE%2Fpy2pack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openSUSE","download_url":"https://codeload.github.com/openSUSE/py2pack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625497,"owners_count":21135513,"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","fedora","opensuse","packaging","rpm","ubuntu"],"created_at":"2024-09-24T22:40:11.316Z","updated_at":"2025-04-12T19:47:24.694Z","avatar_url":"https://github.com/openSUSE.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Py2pack: Generate distribution packages from PyPI\n=================================================\n\n.. image:: https://github.com/openSUSE/py2pack/actions/workflows/tox.yml/badge.svg\n        :target: https://github.com/openSUSE/py2pack/actions/workflows/tox.yml\n        :alt: Unit tests\n\nThis script allows to generate RPM spec or DEB dsc files from Python modules.\nIt allows to list Python modules or search for them on the Python Package Index\n(PyPI). Conveniently, it can fetch tarballs and changelogs making it an\nuniversal tool to package Python modules.\n\n\nInstallation\n------------\n\nTo install py2pack from the `Python Package Index`_, simply:\n\n.. code-block:: bash\n\n    $ python3 -mpip install py2pack\n\nYou can also check your distro of choice if they provide packages.\nFor openSUSE Tumbleweed and Leap 15.X, you can\n\n.. code-block:: bash\n\n    $ sudo zypper install python3-py2pack\n\n\nUsage\n-----\n\nLets suppose you want to package zope.interface_ and you don't know how it is named\nexactly. First of all, you can search for it and download the source tarball if\nyou found the correct module:\n\n.. code-block:: bash\n\n    $ py2pack search zope.interface\n    searching for module zope.interface...\n    found zope.interface-3.6.1\n    $ py2pack fetch zope.interface\n    downloading package zope.interface-3.6.1...\n    from http://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.1.tar.gz\n\n\nAs a next step you may want to generate a package recipe for your distribution.\nFor RPM_-based distributions (let's use openSUSE_ as an example), you want to\ngenerate a spec file (named 'python-zope.interface.spec'):\n\n.. code-block:: bash\n\n    $ py2pack generate zope.interface -t opensuse.spec -f python-zope.interface.spec\n\nThe source tarball and the package recipe is all you need to generate the RPM_\n(or DEB_) file.\nThis final step may depend on which distribution you use. Again,\nfor openSUSE_ (and by using the `Open Build Service`_), the complete recipe is:\n\n.. code-block:: bash\n\n    $ osc mkpac python-zope.interface\n    $ cd python-zope.interface\n    $ py2pack fetch zope.interface\n    $ py2pack generate zope.interface -f python-zope.interface.spec\n    $ osc build\n    ...\n\nDepending on the module, you may have to adapt the resulting spec file slightly.\nTo get further help about py2pack usage, issue the following command:\n\n.. code-block:: bash\n\n    $ py2pack help\n\n\nHacking and contributing\n------------------------\n\nYou can test py2pack from your git checkout by executing the py2pack module.\n\nEdit `py2pack/version.py` file changing the version number. Adding +1 to the revision\nnumber and optionally appending .dev1 is enough and makes sure that you can\ndistinguish your hackish version from an installed one.\n\nFrom the py2pack directory, install the py2pack module locally.\n\n.. code-block:: bash\n\n    $ pip install -e .\n\nNow you can run your hackish py2pack version. It is usually located in\n$HOME/.local/bin/py2pack\n\n.. code-block:: bash\n\n    $ py2pack\n\nFork `the repository`_ on Github to start making your changes to the **master**\nbranch (or branch off of it). Don't forget to write a test for fixed issues or\nimplemented features whenever appropriate. You can invoke the testsuite from\nthe repository root directory via `tox`_:\n\n.. code-block:: bash\n\n    $ tox\n\nTo run a single test class via `tox`_, use i.e.:\n\n.. code-block:: bash\n\n    $ tox -epy38 test.test_py2pack:Py2packTestCase\n\n\nYou can also run `pytest`_ directly:\n\n.. code-block:: bash\n\n    $ pytest\n\nIt assumes you have the test dependencies installed (available on PYTHONPATH)\non your system.\n\n:copyright: (c) 2013 Sascha Peilicke.\n:license: Apache-2.0, see LICENSE for more details.\n\n\n.. _argparse: http://pypi.python.org/pypi/argparse\n.. _Jinja2: http://pypi.python.org/pypi/Jinja2\n.. _zope.interface: http://pypi.python.org/pypi/zope.interface/\n.. _openSUSE: http://www.opensuse.org/en/\n.. _RPM: http://en.wikipedia.org/wiki/RPM_Package_Manager\n.. _DEB: http://en.wikipedia.org/wiki/Deb_(file_format)\n.. _`Python Package Index`: https://pypi.org/\n.. _`Open Build Service`: https://build.opensuse.org/package/show/devel:languages:python/python-py2pack\n.. _`the repository`: https://github.com/openSUSE/py2pack\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: http://testrun.org/tox\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensuse%2Fpy2pack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensuse%2Fpy2pack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensuse%2Fpy2pack/lists"}