aboutsummaryrefslogtreecommitdiff
path: root/README
blob: e850dd6819107ac9f10f97ecdc8889e9dd8093b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
The Guix Python Integration Project
====================================

The goal of this project is to make it easy and enjoyable to use large amounts
of public free software written in Python, together with GNU Guix.

At the moment, only ~100 releases have been imported, but the aim is to
automatically sync from [pypi.org][1].

If this can be done, it could provide a number of benefits. Firstly, the
generated packages can be used, and this should be easier and safer than using
other tools like [pip][2] because Guix makes it possible to manage the entire
dependency tree, and the use of contained build environments restricts access
to the users machine at build time.

Other benefits could include quality assurance, for example, surfacing the
presence of similar files found in different packages, and integration testing
between different package by attempting to build all packages with the latest
versions of their dependencies.

[1]: https://pypi.org/
[2]: https://pypi.python.org/pypi/pip

Getting started
---------------

The easiest thing to do is to try using some of the software already packaged.
This is only a prototype, but you can see it working with the sentry package.

For example, running the following commands should show the help output for the
sentry command in the sentry package (real time error tracking software). Note
that they may take a few minutes to run, even if you have all the packages
built (this is probably due to bugs and poor implementation).

    ./pure-pre-inst-env guix environment --pure --ad-hoc -e "(begin (use-modules (gpip python2-7)) sentry-8.5.1)" -- sentry

    ./pure-pre-inst-env guix environment --pure --ad-hoc -e '(begin (use-modules ((gnu packages python) #:select (python-2.7)) (pypi requirement) (pypi package) (pypi sdist-store) (gpip sdists) (gpip package-fixes)) (requirement->package (package-configuration python-2.7 get-fixed-package) (add-sdists (make-sdist-store) sdists) (requirement (name "sentry") (specifiers "==8.5.1"))))'

The first command uses the (gpip python2-7) module, which is designed to be
included in the GUIX_PACKAGE_PATH. The 2nd command does what the (gpip
python2-7) module does, but just for the specific package (and thus it should
be a bit quicker).

To see what is going on internally, you can look at the graph for the sentry
package.

    ./pure-pre-inst-env guix graph -e "(begin (use-modules (gpip python2-7)) sentry-8.5.1)" | dot -Tpdf -o sentry.pdf

    ./pure-pre-inst-env guix graph -e '(begin (use-modules ((gnu packages python) #:select (python-2.7)) (pypi requirement) (pypi package) (pypi sdist-store) (gpip sdists) (gpip package-fixes)) (requirement->package (package-configuration python-2.7 get-fixed-package) (add-sdists (make-sdist-store) sdists) (requirement (name "sentry") (specifiers "==8.5.1"))))' | dot -Tpdf -o sentry.pdf

The available packages come from the contents of the (gpip sdists) module,
which contains sdist records. At the moment, records are added to this though
the update function in the (gpip update) module, and the calls it makes to the
get-store-with function.

To run this, you can do:

    ./pure-pre-inst-env guile -c '(begin (use-modules (gpip update)) (update))'