README.md 1.7 KB
Newer Older
Jelle van der Waa's avatar
Jelle van der Waa committed
1
2
3
#  pyalpm - python bindings for the libalpm library

[![Build Status](https://travis-ci.org/archlinux/pyalpm.svg?branch=master)](https://travis-ci.com/archlinux/pyalpm) [![Documentation Status](https://readthedocs.org/projects/pyalpm/badge/?version=latest)](https://pyalpm.readthedocs.io/en/latest/?badge=latest)
Rémy Oudompheng's avatar
Rémy Oudompheng committed
4
5
6
7
8

pyalpm is a C extension for Python 3 that give access to the
libalpm API for package management, which is used, for example
in the Arch Linux distribution.

Jelle van der Waa's avatar
Jelle van der Waa committed
9
# Requirements
Rémy Oudompheng's avatar
Rémy Oudompheng committed
10
11
12

* Python 3 or later

Jelle van der Waa's avatar
Jelle van der Waa committed
13
* libalpm 13
14
15
16

* python-setuptools

17
* python-pkgconfig
18

19
20
* python-sphinx (optional, to build the docs)

Jelle van der Waa's avatar
Jelle van der Waa committed
21
22
23
24
25
26
27
28
# Building

Building is as easy as running make

	make

Building the docs:

Santiago Torres's avatar
Santiago Torres committed
29
	make -C doc html
30

Jelle van der Waa's avatar
Jelle van der Waa committed
31
32
33
# Testing

Required test dependency:
34
35

* python-pytest
Jelle van der Waa's avatar
Jelle van der Waa committed
36
* gcovr (optional, generating C coverage) 
37

Jelle van der Waa's avatar
Jelle van der Waa committed
38
Unit tests can be run with:
39

Jelle van der Waa's avatar
Jelle van der Waa committed
40
41
42
43
44
45
46
47
48
	make test

Coverage for Python code can be generated as following:

	make open-coverage

Coverage for the CPython code can be generated as following:

	make open-ext-coverage
49

50
51
52
53
54
55
56
57
58
59
60
# Releasing

1. Bump version in setup.py
2. commit
3. git tag

## Uploading to PyPI

1. python3 setup.py sdist
2. twine upload -s dist/* --verbose

61
62
63
# Pacman development compatibility

The master branch tracks the most recent pacman release and thus libalpm
64
release, the [next](https://gitlab.archlinux.org/archlinux/pyalpm/-/tree/next) branch
Jelle van der Waa's avatar
Jelle van der Waa committed
65
follows [pacman's master branch](https://gitlab.archlinux.org/pacman/pacman.git).
66

67
Building against pacman-git is as simple as:
68

Jelle van der Waa's avatar
Jelle van der Waa committed
69
	git clone https://gitlab.archlinux.org/pacman/pacman.git
70
71
72
	mkdir build
	cd build && meson .. && ninja
	PKG_CONFIG_PATH=/path/to/pacman/build/meson-uninstalled make build
73
74
75

Running tests against pacman-git:

76
	LD_LIBRARY_PATH=/path/to/pacman/build/ make test