diff options
| author | Hugo Buddelmeijer <hugo@buddelmeijer.nl> | 2025-12-17 23:16:44 +0100 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-12-27 16:30:45 +0000 |
| commit | 9643da0abed6077819579fc60816432bdb3fbaba (patch) | |
| tree | 7db1d04a4fd617fbafeca475f439e1edb048ba03 /gnu | |
| parent | 36d7c88fb449d45c018c791ac69aaf213e940f8d (diff) | |
gnu: python-nbt: Fix build; add tests.
* gnu/packages/game-development.scm (python-nbt-testdata): New variable.
* gnu/packages/game-development.scm (python-nbt): Fix build; add tests.
[source]: Switch to git-fetch.
[build-system]: Switch to pyproject-build-system.
[arguments]<#:phases>: Add 'fake-download phase.
<#:test-flags>: List specific files to test.
[native-inputs]: Add python-pytest and python-setuptools.
Change-Id: I1579b0fe6d3cbe06b279c7b78f4834b6e9b849ba
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
aa
Change-Id: I02b49dca10d5bc39a585b1916434f53b8b96fbd0
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/game-development.scm | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index 7565115465c..6f41e709c46 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -591,17 +591,54 @@ types (revolute, prismatic, wheel, etc.).") (description "This package provides an Anvil file format parser.") (license license:expat)))) +;;~4MiB of test files. +(define python-nbt-testdata + (file-union + "python-nbt-testdata" + (list + (let ((file "Sample_World.tar.gz")) + `(,file + ,(origin + (method url-fetch) + (uri (string-append + "https://github.com/twoolie/NBT/files/13199373/" + file)) + (sha256 + (base32 + "1s58g5zicx8ghdai2qix2aqq0fc675vfajica4h78c397crwjrl9")))))))) + (define-public python-nbt (package (name "python-nbt") (version "1.5.1") - (source (origin - (method url-fetch) - (uri (pypi-uri "NBT" version)) - (sha256 - (base32 - "1i9ncrzy5zcfnxzkh2j31n9ayzxfncckzwa6fkz9vjq5fq9v4fys")))) - (build-system python-build-system) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/twoolie/NBT") + (commit (string-append "version-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1a3mj7c18m1n5iqzwwvvlk7n65kxp3xbmccsqyap36apwpbbxyd9")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + #~(list "tests/regiontests.py" "tests/nbttests.py") + #:phases + #~(modify-phases %standard-phases + (add-before 'check 'fake-download + ;; Fake the download of the test tarball. + (lambda _ + (substitute* + "tests/downloadsample.py" + (("tar_file = .*") + (string-append + "tar_file = '" + #+python-nbt-testdata + "/Sample_World.tar.gz'")))))))) + (native-inputs + (list python-pytest python-setuptools)) (home-page "https://github.com/twoolie/NBT") (synopsis "Named Binary Tag reader and writer") (description |
