unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Python package that uses setuptools_scm is builded with version 0.0.0
@ 2024-06-01 19:49 Polyedre
  2024-06-03  1:09 ` Alexis Simon
  0 siblings, 1 reply; 3+ messages in thread
From: Polyedre @ 2024-06-01 19:49 UTC (permalink / raw)
  To: help-guix

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-19 13:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-01 19:49 Python package that uses setuptools_scm is builded with version 0.0.0 Polyedre
2024-06-03  1:09 ` Alexis Simon
2024-10-19 13:12   ` Maxim Cournoyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).