help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python package that uses setuptools_scm is builded with version 0.0.0


From: Polyedre
Subject: Python package that uses setuptools_scm is builded with version 0.0.0
Date: Sat, 01 Jun 2024 21:49:04 +0200

Hello,

While trying to package maestral[1] for guix, I came across the python
package 'survey'[2]. With the following package description, this
package builds but the version of the resulting python package is 0.0.0.

```scheme
(define-public python-survey
  (package
    (name "python-survey")
    (version "5.3.0")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "survey" version))
       (sha256
        (base32 "1q2b07rq66njyg70fsd0gn6710z1sz9phpy3rd7p7dqxn6rfvi4c"))))
    (build-system pyproject-build-system)
    ;; (propagated-inputs (list python-setuptools-scm))
    (arguments
     `(#:phases (modify-phases %standard-phases
                  (delete 'check))))
    (home-page "https://github.com/Exahilosys/survey";)
    (synopsis "A simple library for creating beautiful interactive prompts.")
    (description
     "This package provides a simple library for creating beautiful interactive
prompts.")
    (license license:expat)))
```

It seems that this package uses setuptools_scm. According to its
documentation, the latter detects the version of the package currently
building directly from "`git` or `hg`" (I guess with the tags?).

As a consequence, this package builds with the version 0.0.0:

```
$ guix shell -f test.scm python -- pip3 freeze
survey==0.0.0
````

It seems that the environment variables SETUPTOOLS_SCM_PRETEND_VERSION
and SETUPTOOLS_SCM_PRETEND_VERSION_FOR_<package>[3] can be used to override
this behavior.

What would be the best way to add an environment variable to te build
process? Just exporting the variable to my shell before calling `guix
build` does not work.

Regards,
Polyedre

[1] https://pypi.org/project/maestral/
[2] https://pypi.org/project/survey/
[3] https://setuptools-scm.readthedocs.io/en/latest/usage/#with-dockerpodman



reply via email to

[Prev in Thread] Current Thread [Next in Thread]