https://github.com/wenliangcan/pip2pkgbuild
Generate PKGBUILD file for a Python module from PyPi
https://github.com/wenliangcan/pip2pkgbuild
arch-linux packaging pkgbuild python
Last synced: 11 months ago
JSON representation
Generate PKGBUILD file for a Python module from PyPi
- Host: GitHub
- URL: https://github.com/wenliangcan/pip2pkgbuild
- Owner: wenLiangcan
- License: mit
- Created: 2015-09-15T12:32:13.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T22:34:27.000Z (almost 2 years ago)
- Last Synced: 2025-06-21T02:06:31.771Z (about 1 year ago)
- Topics: arch-linux, packaging, pkgbuild, python
- Language: Python
- Homepage: https://pypi.org/project/pip2pkgbuild/
- Size: 48.8 KB
- Stars: 59
- Watchers: 5
- Forks: 12
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.org/project/pip2pkgbuild/)
[](https://pypi.org/project/pip2pkgbuild/)
# About
Re-implementing [`bluepeppers/pip2arch`](https://github.com/bluepeppers/pip2arch>) with some improvements:
- Supports generating `PKGBUILD` contained [multiple packages](https://www.archlinux.org/pacman/PKGBUILD.5.html#_package_splitting).
- Smarter package license detection.
- License file installation (by @brycepg).
- Maintainer information generation (by @brycepg).
- Supports generating PEP517 based installation instructments.
# Installation
Install from `AUR`:
```shell
$ git clone https://aur.archlinux.org/pip2pkgbuild.git
$ # for Python 2:
$ # git clone https://aur.archlinux.org/python2-pip2pkgbuild.git pip2pkgbuild
$ cd pip2pkgbuild
$ makepkg -si
```
Install from `PyPi`:
```shell
$ pip install pip2pkgbuild
```
Install manually:
```shell
$ cp pip2pkgbuild/pip2pkgbuild.py ~/bin/pip2pkgbuild
$ chmod u+x ~/bin/pip2pkgbuild
```
# Usage
```
usage: pip2pkgbuild [-h] [-v MODULE_VERSION] [-p {python,python2,multi}]
[-b PKGBASE] [-n PKGNAME]
[--python2-package-name PY2_PKGNAME]
[-d [DEPENDS [DEPENDS ...]]]
[--python2-depends [DEPENDS [DEPENDS ...]]]
[--python3-depends [DEPENDS [DEPENDS ...]]]
[-m [MKDEPENDS [MKDEPENDS ...]]] [-o] [-V] [-l]
[--name NAME] [--email EMAIL]
module
Generate PKGBUILD file for a Python module from PyPi
positional arguments:
module The Python module name
optional arguments:
-h, --help show this help message and exit
-v MODULE_VERSION, --module-version MODULE_VERSION
Use the specified version of the Python module
-p {python,python2,multi}, --python-version {python,python2,multi}
The Python version on which the PKGBUILD bases
-b PKGBASE, --package-basename PKGBASE
Specifiy the pkgbase value, the first value in the
pkgname array is used by default
-n PKGNAME, --package-name PKGNAME
Specify the pkgname value or the name for the Python 3
based package in a package group
--python2-package-name PY2_PKGNAME
Specify the name for the Python 2 based package in a
package group
-d [DEPENDS [DEPENDS ...]], --depends [DEPENDS [DEPENDS ...]]
Dependencies for the whole PKGBUILD
--python2-depends [DEPENDS [DEPENDS ...]]
Dependencies for the Python 2 based package in a
package group
--python3-depends [DEPENDS [DEPENDS ...]]
Dependencies for the Python 3 based package in a
package group
-m [MKDEPENDS [MKDEPENDS ...]], --make-depends [MKDEPENDS [MKDEPENDS ...]]
Dependencies required while running the makepkg
command
-o, --print-out Print on screen rather than saving to PKGBUILD file
-V, --version show program's version number and exit
-l, --find-license Attempt to find package license to install
--name NAME Your full name for the package maintainer line e.g.
'yourFirstName yourLastName'
--email EMAIL Your email for the package maintainer line
--pep517 Prefer PEP517 based installation method if supporting by the module
```
# Examples
Generate a Python 2 based `PKGBUILD` for `Django` with `pkgname` "django":
```shell
$ pip2pkgbuild django -p python2 -n django
```
Generate `PKGBUILD` for `Flask`, containing both Python 2 and 3 packages with `pkgbase` "flask":
```shell
$ pip2pkgbuild flask -p multi -b flask
```