X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=guix-env.scm;h=53ecf0601585b3e22de9a57baab40b5f4eb59af4;hb=3a1fb089e874caad8b63457bc9d3aecf5f0ad9b8;hp=d56f8539183604f30266aae51df7493475cef05c;hpb=f86dafe2a01e64183e54d4a98eccb01d007c68e6;p=mediagoblin.git diff --git a/guix-env.scm b/guix-env.scm index d56f8539..53ecf060 100644 --- a/guix-env.scm +++ b/guix-env.scm @@ -1,6 +1,7 @@ ;;; GNU MediaGoblin -- federated, autonomous media hosting ;;; Copyright © 2015, 2016 David Thompson ;;; Copyright © 2016 Christopher Allan Webber +;;; Copyright © 2019 Ben Sturmfels ;;; ;;; This program is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by @@ -19,7 +20,7 @@ ;;; also borrows some code directly from Guix. ;;; ;;; ======================================== -;;; +;;; ;;; With `guix environment' you can use guix as kind of a universal ;;; virtualenv, except a universal virtualenv with magical time traveling ;;; properties and also, not just for Python. @@ -28,27 +29,58 @@ ;;; Then do: ;;; guix environment -l guix-env.scm --pure ;;; -;;; And the first time you use it: +;;; While using --pure is a robust way to ensure that other environment +;;; variables don't cause unexpected behaviour, it may trip up aspects of your +;;; development tools, such as removing reference to $EDITOR. Feel free to +;;; remove the --pure. +;;; +;;; You'll need to run the above command every time you close your terminal or +;;; restart your system, so a handy way to save having to remember is to install +;;; "direnv" an then create a ".envrc" file in your current directory containing +;;; the following and then run "direnv allow" when prompted: +;;; use guix -l guix-env.scm +;;; +;;; To set things up for the first time, you'll also need to run: +;;; git submodule init +;;; git submodule update ;;; ./bootstrap.sh ;;; ./configure --with-python3 --without-virtualenv ;;; make -;;; virtualenv . && ./bin/python setup.py develop --no-deps +;;; python3 -m venv --system-site-packages . && bin/python setup.py develop --no-deps +;;; bin/python -m pip install --force-reinstall PasteScript # workaround +;;; bin/python -m pip install 'werkzeug<1.0.0' # workaround ;;; -;;; ... wait whaaat, what's that last line! I thought you said this +;;; ... wait whaaat, what's that venv line?! I thought you said this ;;; was a reasonable virtualenv replacement! Well it is and it will ;;; be, but there's a catch, and the catch is that Guix doesn't know ;;; about this directory and "setup.py dist" is technically necessary ;;; for certain things to run, so we have a virtualenv with nothing ;;; in it but this project itself. ;;; +;;; The devtools/update_extlib.sh script won't run on Guix due to missing +;;; "/usr/bin/env", so then run: +;;; node node_modules/.bin/bower install +;;; ./devtools/update_extlib.sh +;;; bin/gmg dbupdate +;;; bin/gmg adduser --username admin --password a --email admin@example.com +;;; ./lazyserver.sh <-- won't work +;;; CELERY_ALWAYS_EAGER=true ./bin/paster serve paste.ini --reload +;;; ;;; So anyway, now you can do: ;;; PYTHONPATH="${PYTHONPATH}:$(pwd)" ./runtests.sh +;;; or: +;;; bin/python -m pytest ./mediagoblin/tests --boxed ;;; ;;; Now notably this is goofier looking than running a virtualenv, ;;; but soon I'll do something truly evil (I hope) that will make ;;; the virtualenv and path-hacking stuff unnecessary. ;;; ;;; Have fun! +;;; +;;; Known issues: +;;; - currently fails to upload h264 source video: "GStreamer: missing H.264 decoder" +;; +;; TODO: Add PDF support. (use-modules (ice-9 match) (srfi srfi-1) @@ -61,12 +93,21 @@ (gnu packages) (gnu packages autotools) (gnu packages base) + (gnu packages certs) + (gnu packages check) + (gnu packages databases) (gnu packages python) + (gnu packages python-crypto) + (gnu packages python-web) + (gnu packages python-xyz) + (gnu packages sphinx) (gnu packages gstreamer) (gnu packages glib) (gnu packages rsync) (gnu packages ssh) + (gnu packages time) (gnu packages version-control) + (gnu packages xml) ((guix licenses) #:select (expat zlib) #:prefix license:)) ;; ================================================================= @@ -75,43 +116,28 @@ ;; ourselves to... ;; ================================================================= -(define python-sqlalchemy-0.9.10 - (package - (inherit python-sqlalchemy) - (version "0.9.10") - (source - (origin - (method url-fetch) - (uri (string-append "https://pypi.python.org/packages/source/S/" - "SQLAlchemy/SQLAlchemy-" version ".tar.gz")) - (sha256 - (base32 - "0fqnssf7pxvc7dvd5l83vnqz2wfvpq7y01kcl1537f9nbqnvlp24")))) - - ;; Temporarily skipping tests. It's the stuff that got fixed in - ;; the recent sqlalchemy release we struggled with on-list. The - ;; patch would have to be backported here to 0.9.10. - (arguments - '(#:tests? #f)))) - -(define python-alembic-0.6.6 +(define python-pytest-forked (package - (inherit python-alembic) - (version "0.6.6") - (source - (origin - (method url-fetch) - (uri (pypi-uri "alembic" version)) - (sha256 - (base32 - "0i3nic56blq079vj1iskkmllwjp980vnvvx898d3bm5qa416crcn")))) - (native-inputs - `(("python-nose" ,python-nose) - ,@(package-native-inputs python-alembic))) - (propagated-inputs - `(("python-sqlalchemy" ,python-sqlalchemy-0.9.10) - ("python-mako" ,python-mako) - ("python-editor" ,python-editor))))) + (name "python-pytest-forked") + (version "1.0.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest-forked" version)) + (sha256 + (base32 + "0f4y1jhcg70xhm220pdb8r24n01knhn749aqlr14vmgbsb7allnk")))) + (build-system python-build-system) + (propagated-inputs + `(("python-pytest" ,python-pytest) + ("python-setuptools-scm" ,python-setuptools-scm))) + (home-page + "https://github.com/pytest-dev/pytest-forked") + (synopsis + "run tests in isolated forked subprocesses") + (description + "run tests in isolated forked subprocesses") + (license license:expat))) ;; ================================================================= @@ -127,11 +153,16 @@ (base32 "0p2gj4z351166d1zqmmd8wc9bzb69w0fjm8qq1fs8dw2yhcg2wwv")))) (build-system python-build-system) + (arguments + ;; Complains about missing gunicorn. Not sure where that comes from. + '(#:tests? #f)) (native-inputs - `(("python-pytest" ,python-pytest))) + `(("python-pytest" ,python-pytest) + ("nss-certs" ,nss-certs))) (propagated-inputs `(("python-alembic" ,python-alembic) ("python-pytest-xdist" ,python-pytest-xdist) + ("python-pytest-forked" ,python-pytest-forked) ("python-celery" ,python-celery) ("python-kombu" ,python-kombu) ("python-webtest" ,python-webtest) @@ -141,7 +172,7 @@ ("python-translitcodec" ,python-translitcodec) ("python-babel" ,python-babel) ("python-configobj" ,python-configobj) - ("python-dateutil-2" ,python-dateutil-2) + ("python-dateutil" ,python-dateutil) ("python-itsdangerous" ,python-itsdangerous) ("python-jinja2" ,python-jinja2) ("python-jsonschema" ,python-jsonschema) @@ -159,7 +190,7 @@ ("python-docutils" ,python-docutils) ("python-sqlalchemy" ,python-sqlalchemy) ("python-unidecode" ,python-unidecode) - ("python-werkzeug" ,python-werkzeug) + ;; ("python-werkzeug" ,python-werkzeug) ; Broken due to missing werkzeug.contrib.atom in 1.0.0. ("python-exif-read" ,python-exif-read) ("python-wtforms" ,python-wtforms))) (home-page "http://mediagoblin.org/") @@ -175,8 +206,10 @@ media.") (inputs `(;;; audio/video stuff ("gstreamer" ,gstreamer) + ("gst-libav" ,gst-plugins-base) ("gst-plugins-base" ,gst-plugins-base) ("gst-plugins-good" ,gst-plugins-good) + ("gst-plugins-bad" ,gst-plugins-bad) ("gst-plugins-ugly" ,gst-plugins-ugly) ("gobject-introspection" ,gobject-introspection) ;; useful to have! @@ -185,7 +218,7 @@ media.") ("which" ,which) ("git" ,git) ("automake" ,automake) - ("autoconf" ,(autoconf-wrapper)) + ("autoconf" ,autoconf) ,@(package-inputs mediagoblin))) (propagated-inputs `(("python" ,python)