aboutsummaryrefslogtreecommitdiff
path: root/gpip/update.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gpip/update.scm')
-rw-r--r--gpip/update.scm83
1 files changed, 83 insertions, 0 deletions
diff --git a/gpip/update.scm b/gpip/update.scm
new file mode 100644
index 0000000..42f701a
--- /dev/null
+++ b/gpip/update.scm
@@ -0,0 +1,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)))