guix-devel
[Top][All Lists]
Advanced

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

Re: Questions regarding Python packaging


From: Tanguy LE CARROUR
Subject: Re: Questions regarding Python packaging
Date: Tue, 26 Jan 2021 08:21:22 +0100
User-agent: astroid/0.15.0 (https://github.com/astroidmail/astroid)

Excerpts from Tanguy LE CARROUR's message of January 22, 2021 9:38 am:
> Excerpts from Tanguy LE CARROUR's message of January 6, 2021 4:32 pm:
>> Excerpts from Lars-Dominik Braun's message of January 5, 2021 11:25 am:
>>>> So, I've tried packaging `python-keyring` with those two…
>>>> 
>>>> `pep517` keeps on trying to download dependencies, which won't work.
>>>> 
>>>> `build` crashes with "ZIP does not support timestamps before 1980",
>>>> which, I guess is related to the fact that everything in the store is
>>>> timestamped to January 1st 1970.
>>> have you been looking into a python-build-system using `build`[1]? I’ve
>>> had the same issue with egg versions set to 0.0.0 and think in the long
>>> run moving to a PEP 517-style build is the way forward.
>> 
>> I agree! Unfortunately, I haven't had much time (so far) to work on it! :-(
>> 
>> I'll revive the thread as soon as I've made progress…
> 
> Done! :-)
> I've eventually succeeded in ("properly") packaging a software managed
> with Poetry. And I've learned quite a lot on the way!

Just for the sake of having it documented somewhere, here is the
relevant part of the `guix.scm` file:

```
(define-public nowty
  (package
    (name "nowty")
    (version (string-append %pyproject-version "+" %git-commit))
    (source (local-file %source-dir #:recursive? #t))
    (build-system python-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
        (replace 'build
         (lambda* (#:key #:allow-other-keys)
           (substitute* "pyproject.toml"
            (((string-append "version = \"" ,%pyproject-version "\"" ))
             (string-append "version = \"" ,version "\"")))))
        (replace 'install
         (lambda* (#:key outputs #:allow-other-keys)
          (let ((out (assoc-ref outputs "out")))
           (invoke "python" "-m" "pip" "install"
                   "--no-dependencies" "--no-build-isolation" "--prefix" out 
"."))))
        (replace 'check
         (lambda* (#:key inputs outputs #:allow-other-keys)
          (add-installed-pythonpath inputs outputs)
          (invoke "python" "-m" "invoke" "test.unit"))))))
    (native-inputs
     `(("python-invoke" ,python-invoke-patched)
       ("python-mamba" ,python-mamba)
       ("python-poetry-core" ,python-poetry-core)
       ("python-robber" ,python-robber)
       ("python-termcolor" ,python-termcolor)))
    (propagated-inputs
     `(("python-mpd2" ,python-mpd2)
       ("python-typer" ,python-typer)))
    (synopsis "Music notification daemon for MPD")
    (description "A music notification daemon that monitors songs being played 
by MPD
and displays notifications with the song's details.")
    (home-page "http://projects.bioneland.org/nowty";)
    (license license:gpl3+)))
```

-- 
Tanguy



reply via email to

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