aboutsummaryrefslogtreecommitdiff
path: root/gpip/update.scm
blob: 42f701a4a37eae5452f4a83972392c6464a17184 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
(define-module (gpip update)
  #:use-module (ice-9 vlist)
  #:use-module (guix monads)
  #:use-module ((gnu packages python)
                #:select (python-2.7 python-wrapper))
  #:use-module (pypi sdist)
  #:use-module (pypi sdist-store)
  #:use-module (pypi sdist-store import-master)
  #:use-module (pypi api)
  #:use-module (pypi logging)
  #:use-module (pypi package)
  #:use-module (gpip sdists)
  #:use-module (gpip package-fixes)
  #:export (update))

(define (write-intermediate-result store)
  ((write-store) store))

(define %sdist-store-monad %state-monad)

(define api-root "https://pypi.python.org/pypi/")

(define* (get-store-with name version #:key (python python-wrapper))
  (lambda (store)
    (let
      ((new-state
         (create-sdist-and-missing-dependencies
           api-root
           store
           get-fixed-package
           python
           name
           version
           write-intermediate-result)))
      (values
        new-state new-state))))

(define (write-store)
  (lambda (store)
    (begin
      (create-sdists-module
        store
        '(gpip sdists)
        "../guix-python-intergration-project/gpip/sdists.scm")
      store)))

(define (update)
  (setup-logging)
  (let*
    ((sdists
      (catch #t
             (lambda () (begin
                          (use-modules (gpip sdists))
                          sdists))
             (lambda (key . parameters)
                     (begin
                       (error "error loading sdists")
                       (display "error loading sdists, using empty store\n")
                       (display key)(display " ")(display parameters)
                       '())))))
    (with-monad %state-monad
      (run-with-state
        (mbegin %state-monad
          (get-store-with "setuptools" "23.0.0")
          (get-store-with "simplejson" "3.8.1")
          (get-store-with "requests" "2.9.1")
          (get-store-with "pbr" "0.11.1")
          (get-store-with "Jinja2" "2.8")
          (get-store-with "lxml" "3.5.0")
          (get-store-with "cffi" "1.5.0")
          (get-store-with "coverage" "4.0.3")
          (get-store-with "mock" "1.3.0")
          (get-store-with "statsd" "3.1")
          (get-store-with "pillow" "3.2.0")
          (get-store-with "cryptography" "1.4")
          (get-store-with "setuptools" "23.0.0" #:python python-2.7)
          (get-store-with "django-jsonfield" "0.9.13" #:python python-2.7)
          (get-store-with "anyjson" "0.3.3" #:python python-2.7)
          (get-store-with "kombu" "3.0.30" #:python python-2.7)
          (get-store-with "sentry" "8.5.1" #:python python-2.7)
          (write-store))
        (add-sdists (make-sdist-store) sdists)))
    (shutdown-logging)))