(define-module (gn packages python-build) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix git-download) #:use-module (guix build-system python) #:use-module (guix build-system pyproject) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages check) #:use-module (gnu packages rust-apps) #:use-module (gnu packages python-xyz) #:use-module (gnu packages python-check) #:use-module (gnu packages python-build)) (define-public python-build (package (name "python-build") (version "1.4.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/pypa/build") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "107hhzjrlj56gshcyalf4laf741swmmaznlz0xcfv8rvpwa81mm2")))) (build-system pyproject-build-system) (native-inputs (list uv python-tox python-pip python-wheel python-tomli python-pytest python-filelock python-colorama python-flit-core python-packaging python-pytest-cov python-setuptools python-virtualenv python-pytest-mock python-pytest-xdist python-pyproject-hooks python-importlib-metadata python-pytest-rerunfailures)) (arguments (list #:phases #~(modify-phases %standard-phases (add-before 'build 'set-env (lambda _ ;; When running tests, things fail because HOME=/homeless-shelter. (setenv "HOME" "/tmp"))) (add-before 'check 'patch-tests (lambda* (#:key inputs #:allow-other-keys) (substitute* "tests/test_env.py" ((", path=sysconfig.get_path\\(\"scripts\"\\)") ""))))) ;; Cheat by deactivating tests for now. #:tests? #f)) (home-page "https://build.pypa.io/") (synopsis "A simple, correct Python packaging build frontend") (description "A simple, correct Python packaging build frontend. build manages pyproject.toml-based builds, invoking build-backend hooks as appropriate to build a distribution package. It is a simple build tool and does not perform any dependency management.") (license license:expat)))