+(define-public python-tinycss2
+ (package
+ (name "python-tinycss2")
+ (version "1.0.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "tinycss2" version))
+ (sha256
+ (base32 "1kw84y09lggji4krkc58jyhsfj31w8npwhznr7lf19d0zbix09v4"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _ (invoke "pytest"))))))
+ (propagated-inputs
+ `(("python-webencodings" ,python-webencodings)))
+ (native-inputs
+ `(("python-pytest-flake8" ,python-pytest-flake8)
+ ("python-pytest-isort" ,python-pytest-isort)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (home-page "https://tinycss2.readthedocs.io/")
+ (synopsis "Low-level CSS parser for Python")
+ (description "@code{tinycss2} can parse strings, return Python objects
+representing tokens and blocks, and generate CSS strings corresponding to
+these objects.
+
+Based on the CSS Syntax Level 3 specification, @code{tinycss2} knows the
+grammar of CSS but doesn’t know specific rules, properties or values supported
+in various CSS modules.")
+ (license license:bsd-3)))
+
+(define-public python-cssselect2
+ (package
+ (name "python-cssselect2")
+ (version "0.2.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "cssselect2" version))
+ (sha256
+ (base32 "0skymzb4ncrm2zdsy80f53vi0arf776lvbp51hzh4ayp1il5lj3h"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda _ (invoke "pytest"))))))
+ (propagated-inputs
+ `(("python-tinycss2" ,python-tinycss2)))
+ (native-inputs
+ `(("python-pytest-cov" ,python-pytest-cov)
+ ("python-pytest-flake8" ,python-pytest-flake8)
+ ("python-pytest-isort" ,python-pytest-isort)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (home-page "https://cssselect2.readthedocs.io/")
+ (synopsis "CSS selectors for Python ElementTree")
+ (description "@code{cssselect2} is a straightforward implementation of
+CSS3 Selectors for markup documents (HTML, XML, etc.) that can be read by
+ElementTree-like parsers (including cElementTree, lxml, html5lib, etc.).
+
+Unlike the Python package @code{cssselect}, it does not translate selectors to
+XPath and therefore does not have all the correctness corner cases that are
+hard or impossible to fix in cssselect.")
+ (license license:bsd-3)))
+
+(define-public gunicorn
+ (package
+ (name "gunicorn")
+ (version "20.0.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "gunicorn" version))
+ (sha256
+ (base32
+ "09n6fc019bgrvph1s5h1lwhn2avcsprw6ncd203qhra3i8mvn10r"))))
+ (outputs '("out" "doc"))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'build 'build-doc
+ (lambda _
+ (invoke "make" "-C" "docs" "PAPER=a4" "html" "info")
+ (delete-file "docs/build/texinfo/Makefile")
+ (delete-file "docs/build/texinfo/Gunicorn.texi")
+ #t))
+ (replace 'check
+ (lambda _
+ (setenv "PYTHONPATH"
+ (string-append ".:" (getenv "PYTHONPATH")))
+ (invoke "pytest")))
+ (add-after 'install 'install-doc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((doc (string-append (assoc-ref outputs "doc")
+ "/share/doc/" ,name "-" ,version))
+ (html (string-append doc "/html"))
+ (info (string-append doc "/info"))
+ (examples (string-append doc "/examples")))
+ (mkdir-p html)
+ (mkdir-p info)
+ (mkdir-p examples)
+ (copy-recursively "docs/build/html" html)
+ (copy-recursively "docs/build/texinfo" info)
+ (copy-recursively "examples" examples)
+ (for-each (lambda (file)
+ (copy-file file (string-append doc "/" file)))
+ '("README.rst" "NOTICE" "LICENSE" "THANKS")))
+ #t)))))
+ (native-inputs
+ `(("binutils" ,binutils) ;; for ctypes.util.find_library()
+ ("python-aiohttp", python-aiohttp)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-cov" ,python-pytest-cov)
+ ("python-sphinx" ,python-sphinx)
+ ("texinfo" ,texinfo)))
+ (home-page "https://gunicorn.org/")
+ (synopsis "Python WSGI HTTP Server for UNIX")
+ (description "Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP
+Server for UNIX. It’s a pre-fork worker model ported from Ruby’s
+Unicorn project. The Gunicorn server is broadly compatible with
+various web frameworks, simply implemented, light on server resources,
+and fairly speedy.")
+ (license license:expat)))
+
+;; break cyclic dependency for python-aiohttp, which depends on gunicorn for
+;; its tests
+(define-public gunicorn-bootstrap
+ (package
+ (inherit gunicorn)
+ (name "gunicorn")
+ (arguments `(#:tests? #f))
+ (properties '((hidden? . #t)))
+ (native-inputs `())))
+
+(define-public python-translation-finder
+ (package
+ (name "python-translation-finder")
+ (version "1.7")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "translation-finder" version))
+ (sha256
+ (base32
+ "1pcy9z8gmb8x41gjhw9x0lkr0d2mv5mdxcs2hwg6q8mxs857j589"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'remove-failing-test
+ (lambda _
+ (delete-file "translation_finder/test_api.py")
+ #t)))))
+ (propagated-inputs
+ `(("python-chardet" ,python-chardet)
+ ("python-pathlib2" ,python-pathlib2)
+ ("python-ruamel.yaml" ,python-ruamel.yaml)
+ ("python-six" ,python-six)))
+ (native-inputs
+ `(("python-codecov" ,python-codecov)
+ ("python-codacy-coverage" ,python-codacy-coverage)
+ ("python-pytest-cov" ,python-pytest-cov)
+ ("python-pytest-runner" ,python-pytest-runner)
+ ("python-twine" ,python-twine)))
+ (home-page "https://weblate.org/")
+ (synopsis "Translation file finder for Weblate")
+ (description "This package provides a function to find translation file in
+the source code of a project. It supports many translation file formats and
+is part of the Weblate translation platform.")
+ (license license:gpl3+)))
+
+(define-public python-gitlab
+ (package
+ (name "python-gitlab")
+ (version "1.15.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "python-gitlab" version))
+ (sha256
+ (base32
+ "0zl6kz8v8cg1bcy2r78b2snb0lpw0b573gdx2x1ps0nhsh75l4j5"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-requests" ,python-requests)
+ ("python-six" ,python-six)))
+ (native-inputs
+ `(("python-httmock" ,python-httmock)
+ ("python-mock" ,python-mock)))
+ (home-page
+ "https://github.com/python-gitlab/python-gitlab")
+ (synopsis "Interact with GitLab API")
+ (description "This package provides an extended library for interacting
+with GitLab instances through their API.")
+ (license license:lgpl3+)))
+
+(define-public python-path-and-address
+ (package
+ (name "python-path-and-address")
+ (version "2.0.1")
+ (source
+ (origin
+ ;; The source distributed on PyPI doesn't include tests.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/joeyespo/path-and-address")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0b0afpsaim06mv3lhbpm8fmawcraggc11jhzr6h72kdj1cqjk5h6"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (add-installed-pythonpath inputs outputs)
+ (invoke "py.test"))))))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (home-page "https://github.com/joeyespo/path-and-address")
+ (synopsis "Functions for command-line server tools used by humans")
+ (description "Path-and-address resolves ambiguities of command-line
+interfaces, inferring which argument is the path, and which is the address.")
+ (license license:expat)))
+
+(define-public grip
+ ;; No release by upstream for quite some time, some bugs fixed since. See:
+ ;; https://github.com/joeyespo/grip/issues/304
+ (let ((commit "27a4d6d87ea1d0ea7f7f120de55baabee3de73e3"))
+ (package
+ (name "grip")
+ (version (git-version "4.5.2" "1" commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/joeyespo/grip")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0kx5hgb3q19i4l18a4vqdq9af390xgpk88lp2ay75qi96k0dc68w"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-docopt" ,python-docopt)
+ ("python-flask" ,python-flask)
+ ("python-markdown" ,python-markdown)
+ ("python-path-and-address" ,python-path-and-address)
+ ("python-pygments" ,python-pygments)
+ ("python-requests" ,python-requests)))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-responses" ,python-responses)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (add-installed-pythonpath inputs outputs)
+ (setenv "PATH" (string-append
+ (getenv "PATH") ":"
+ (assoc-ref %outputs "out") "/bin"))
+ (invoke "py.test" "-m" "not assumption"))))))
+ (home-page "https://github.com/joeyespo/grip")
+ (synopsis "Preview Markdown files using the GitHub API")
+ (description "Grip is a command-line server application written in Python
+that uses the GitHub Markdown API to render a local Markdown file. The styles
+and rendering come directly from GitHub, so you'll know exactly how it will
+appear. Changes you make to the file will be instantly reflected in the browser
+without requiring a page refresh.")
+ (license license:expat))))