gnu: python-tinycss2: Enable tests.
* gnu/packages/python-web.scm (python-tinycss2)[source]: Fetch from git repository to include tests. [arguments]: Build from source with flit. [native-inputs]: Add python-flit, python-pytest, python-pytest-cov, python-pytest-flake8, and python-pytest-isort.
This commit is contained in:
		
							parent
							
								
									cf1517a1b7
								
							
						
					
					
						commit
						9e7f09cbec
					
				
					 1 changed files with 36 additions and 7 deletions
				
			
		| 
						 | 
					@ -4563,18 +4563,47 @@ library to create slugs from unicode strings while keeping it DRY.")
 | 
				
			||||||
    (version "1.1.0")
 | 
					    (version "1.1.0")
 | 
				
			||||||
    (source
 | 
					    (source
 | 
				
			||||||
     (origin
 | 
					     (origin
 | 
				
			||||||
       (method url-fetch)
 | 
					       (method git-fetch)
 | 
				
			||||||
       (uri (pypi-uri "tinycss2" version))
 | 
					       (uri (git-reference
 | 
				
			||||||
 | 
					             (url "https://github.com/Kozea/tinycss2")
 | 
				
			||||||
 | 
					             (commit (string-append "v" version))
 | 
				
			||||||
 | 
					             (recursive? #true)))
 | 
				
			||||||
 | 
					       (file-name (git-file-name name version))
 | 
				
			||||||
       (sha256
 | 
					       (sha256
 | 
				
			||||||
        (base32 "12p16k8x8ig51gpfcwz3k3kxpxrwwkn41a1avdgvh3nn8hqarp7v"))))
 | 
					        (base32 "0zyc48vbmczpqj7f3f0d7zb3bz29fyj50dg0m6bbwbr5i88kq3sq"))))
 | 
				
			||||||
    (build-system python-build-system)
 | 
					    (build-system python-build-system)
 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     ;; Test data is missing from the PyPI archive, and the build system is
 | 
					     `(#:phases
 | 
				
			||||||
     ;; based on Flit, which wants an unmaintained and unpackaged
 | 
					       (modify-phases %standard-phases
 | 
				
			||||||
     ;; python-pytoml dependency.
 | 
					         (replace 'build
 | 
				
			||||||
     `(#:tests? #f))
 | 
					           (lambda _
 | 
				
			||||||
 | 
					             ;; A ZIP archive should be generated, but it fails with "ZIP does
 | 
				
			||||||
 | 
					             ;; not support timestamps before 1980".  Luckily,
 | 
				
			||||||
 | 
					             ;; SOURCE_DATE_EPOCH is respected, which we set to some time in
 | 
				
			||||||
 | 
					             ;; 1980.
 | 
				
			||||||
 | 
					             (setenv "SOURCE_DATE_EPOCH" "315532800")
 | 
				
			||||||
 | 
					             (invoke "flit" "build")))
 | 
				
			||||||
 | 
					         (replace 'install
 | 
				
			||||||
 | 
					           (lambda* (#:key inputs outputs #:allow-other-keys)
 | 
				
			||||||
 | 
					             (add-installed-pythonpath inputs outputs)
 | 
				
			||||||
 | 
					             (let ((out (assoc-ref outputs "out")))
 | 
				
			||||||
 | 
					               (for-each (lambda (wheel)
 | 
				
			||||||
 | 
					                           (format #true wheel)
 | 
				
			||||||
 | 
					                           (invoke "python" "-m" "pip" "install"
 | 
				
			||||||
 | 
					                                   wheel (string-append "--prefix=" out)))
 | 
				
			||||||
 | 
					                         (find-files "dist" "\\.whl$")))))
 | 
				
			||||||
 | 
					         (replace 'check
 | 
				
			||||||
 | 
					           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
 | 
				
			||||||
 | 
					             (add-installed-pythonpath inputs outputs)
 | 
				
			||||||
 | 
					             (invoke "pytest" "-vv"))))))
 | 
				
			||||||
    (propagated-inputs
 | 
					    (propagated-inputs
 | 
				
			||||||
     `(("python-webencodings" ,python-webencodings)))
 | 
					     `(("python-webencodings" ,python-webencodings)))
 | 
				
			||||||
 | 
					    (native-inputs
 | 
				
			||||||
 | 
					     `(("python-flit" ,python-flit)
 | 
				
			||||||
 | 
					       ("python-pytest" ,python-pytest)
 | 
				
			||||||
 | 
					       ("python-pytest-cov" ,python-pytest-cov)
 | 
				
			||||||
 | 
					       ("python-pytest-flake8" ,python-pytest-flake8)
 | 
				
			||||||
 | 
					       ("python-pytest-isort" ,python-pytest-isort)))
 | 
				
			||||||
    (home-page "https://tinycss2.readthedocs.io/")
 | 
					    (home-page "https://tinycss2.readthedocs.io/")
 | 
				
			||||||
    (synopsis "Low-level CSS parser for Python")
 | 
					    (synopsis "Low-level CSS parser for Python")
 | 
				
			||||||
    (description "@code{tinycss2} can parse strings, return Python objects
 | 
					    (description "@code{tinycss2} can parse strings, return Python objects
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue