summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinicius Monego <monego@posteo.net>2025-06-28 12:47:33 -0300
committerVinicius Monego <monego@posteo.net>2025-06-29 00:04:45 -0300
commitc76b30aaae3316f429ded81db8cc9324e70ea1ed (patch)
treebe2be6141acc49a510702ee3039df150f5f231f3
parent4069add1a062aad1f6b69b9b98fb5d02e524cd32 (diff)
gnu: python-docker: Enable tests.
* gnu/packages/docker.scm (python-docker)[source]: Fetch from GitHub. [arguments]: Remove '#:tests? #f'. Skip integration tests in '#:test-flags'. Add phase 'pretend-version' before 'build'. [native-inputs]: Add python-pytest. Change-Id: Ia54e53d94ea3d402c9af7970095c69a18c0d44b3
-rw-r--r--gnu/packages/docker.scm27
1 files changed, 20 insertions, 7 deletions
diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm
index 4f1e6b1cfa..4f6c5410ad 100644
--- a/gnu/packages/docker.scm
+++ b/gnu/packages/docker.scm
@@ -70,15 +70,28 @@
(version "7.1.0")
(source
(origin
- (method url-fetch)
- (uri (pypi-uri "docker" version))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/docker/docker-py")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
- (base32
- "0v7s8q2j0khqcd32h50whgi9jlpanhrbh696m6w6r4pqwgk7135d"))))
+ (base32 "1dd4p0xfv6vja4mgzwn2yfyna7vi7bc1pr5f59jg9yd4nxj96kmj"))))
(build-system pyproject-build-system)
- ;; TODO: Tests require a running Docker daemon.
- (arguments '(#:tests? #f))
- (native-inputs (list python-hatch-vcs python-hatchling))
+ (arguments
+ (list
+ ;; Integration tests need a running Docker daemon.
+ #:test-flags #~(list "--ignore" "tests/integration")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'pretend-version
+ ;; The version string is usually derived via setuptools-scm,
+ ;; but without the git metadata available, the version string
+ ;; is set to '0.0.0'.
+ (lambda _
+ (setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
+ #$(package-version this-package)))))))
+ (native-inputs (list python-hatch-vcs python-hatchling python-pytest))
(inputs
(list python-requests python-urllib3))
(propagated-inputs