unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#52991] [PATCH] gnu: Add python-astral
@ 2022-01-03 23:22 Disseminate Dissent via Guix-patches via
  2022-01-04  3:08 ` Vinicius Monego
  0 siblings, 1 reply; 4+ messages in thread
From: Disseminate Dissent via Guix-patches via @ 2022-01-03 23:22 UTC (permalink / raw)
  To: 52991

[-- Attachment #1: Type: text/plain, Size: 13 bytes --]

Empty Message

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-python-astral.patch --]
[-- Type: text/x-patch; name=0001-Add-python-astral.patch, Size: 2626 bytes --]

From 267c0883cc7324e7cd85574478892d74534fe21e Mon Sep 17 00:00:00 2001
From: paladhammika <paladhammika@protonmail.com>
Date: Mon, 3 Jan 2022 17:56:22 -0500
Subject: [PATCH] Add python-astral.

---
 gnu/packages/astronomy.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 1f9eca9a44..3daf51dcf7 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Disseminate Dissent <disseminatedissent@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -55,8 +56,10 @@ (define-module (gnu packages astronomy)
   #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-science)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages time)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
   #:use-module (gnu packages wxwidgets)
@@ -704,6 +707,33 @@ (define-public python-astropy
 astronomy and astrophysics.")
     (license license:bsd-3)))
 
+(define-public python-astral
+  (package
+   (name "python-astral")
+   (version "2.2")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (pypi-uri "astral" version))
+     (sha256
+      (base32 "1gkggdibccmdy9glymw3kbrkzm6svvsg0lk56hhy92y4smkrj7g4"))))
+   (build-system python-build-system)
+   ;; FIXME The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
+   (arguments
+    `(#:tests? #f))
+   (propagated-inputs (list python-dataclasses python-pytz))
+   (inputs
+    (list python-pytz
+          python-requests))
+   (native-inputs
+    (list python-setuptools-scm))
+   (home-page "https://github.com/sffjunkie/astral")
+   (synopsis "Calculations for the position of the sun and moon")
+   (description "This is @code{astral} a Python module which calculates times
+ for various positions of the sun: dawn, sunrise, solar noon, sunset, dusk,
+solar elevation, solar azimuth, rahukaalam, and the phases of the moon.")
+   (license license:asl2.0)))
+
 (define-public libnova
   (package
     (name "libnova")
-- 
2.34.0


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

* [bug#52991] [PATCH] gnu: Add python-astral
  2022-01-03 23:22 [bug#52991] [PATCH] gnu: Add python-astral Disseminate Dissent via Guix-patches via
@ 2022-01-04  3:08 ` Vinicius Monego
  2022-01-04 15:50   ` Disseminate Dissent via Guix-patches via
  0 siblings, 1 reply; 4+ messages in thread
From: Vinicius Monego @ 2022-01-04  3:08 UTC (permalink / raw)
  To: Disseminate Dissent, 52991

Hello,

> ;; FIXME The directory '/homeless-shelter/.cache/pip' or its parent
> directory is not owned or is not writable by the current user. The
> cache has been disabled. Check the permissions and owner of that
> directory. If executing pip with sudo, you should use sudo's -H flag.

This can be fixed by overriding the check phase and calling pytest
manually:

>     (arguments
>      `(#:phases
>        (modify-phases %standard-phases
>          (replace 'check
>            (lambda* (#:key inputs outputs tests? #:allow-other-keys)
>              (when tests?
>                (add-installed-pythonpath inputs outputs)
>                (invoke "python" "-m" "pytest")))))))

I also adjusted the inputs as:

>     (native-inputs
>      (list python-freezegun python-setuptools-scm))
>     (propagated-inputs
>      (list python-dataclasses python-pytest python-pytz))

When the package is a module, all runtime inputs should be propagated.
I also removed python-requests since it was not being used.

> +   (description "This is @code{astral} a Python module which
> calculates times
> + for various positions of the sun: dawn, sunrise, solar noon,
> sunset, dusk,
> +solar elevation, solar azimuth, rahukaalam, and the phases of the
> moon.")

I'd reword it starting with "@code{astral} is a Python module ..."

The indentation is also off. If you're using Emacs you can use one of
its indent commands to fix it.

Could you send a v2 with these changes?





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

* [bug#52991] [PATCH] gnu: Add python-astral
  2022-01-04  3:08 ` Vinicius Monego
@ 2022-01-04 15:50   ` Disseminate Dissent via Guix-patches via
  2022-01-08 22:23     ` bug#52991: " Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Disseminate Dissent via Guix-patches via @ 2022-01-04 15:50 UTC (permalink / raw)
  To: Vinicius Monego; +Cc: 52991

[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]

Herein are the v2 changes.

Disseminate,
Peace


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Tuesday, January 4th, 2022 at 3:08 AM, Vinicius Monego <monego@posteo.net> wrote:

> Hello,
>
> > ;; FIXME The directory '/homeless-shelter/.cache/pip' or its parent
> >
> > directory is not owned or is not writable by the current user. The
> >
> > cache has been disabled. Check the permissions and owner of that
> >
> > directory. If executing pip with sudo, you should use sudo's -H flag.
>
> This can be fixed by overriding the check phase and calling pytest
>
> manually:
>
> >     (arguments
> >      `(#:phases
> >        (modify-phases %standard-phases
> >          (replace 'check
> >            (lambda* (#:key inputs outputs tests? #:allow-other-keys)
> >              (when tests?
> >                (add-installed-pythonpath inputs outputs)
> >                (invoke "python" "-m" "pytest")))))))
> >
>
> I also adjusted the inputs as:
>
> >     (native-inputs
> >      (list python-freezegun python-setuptools-scm))
> >     (propagated-inputs
> >      (list python-dataclasses python-pytest python-pytz))
> >
>
> When the package is a module, all runtime inputs should be propagated.
>
> I also removed python-requests since it was not being used.
>
> > -   (description "This is @code{astral} a Python module which
> >
> >     calculates times
> > -   for various positions of the sun: dawn, sunrise, solar noon,
> >
> >     sunset, dusk,
> >
> >     +solar elevation, solar azimuth, rahukaalam, and the phases of the
> >
> >     moon.")
>
> I'd reword it starting with "@code{astral} is a Python module ..."
>
> The indentation is also off. If you're using Emacs you can use one of
>
> its indent commands to fix it.
>
> Could you send a v2 with these changes?

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-Add-python-astral.patch --]
[-- Type: text/x-patch; name=0002-gnu-Add-python-astral.patch, Size: 2228 bytes --]

From edf40f038e037f891bc3aaede0015da064f4c0bb Mon Sep 17 00:00:00 2001
From: paladhammika <paladhammika@protonmail.com>
Date: Tue, 4 Jan 2022 10:42:24 -0500
Subject: [PATCH] gnu: Add python=astral.

---
 gnu/packages/astronomy.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 1f9eca9a44..88966d7ecc 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -57,6 +57,7 @@ (define-module (gnu packages astronomy)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages time)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
   #:use-module (gnu packages wxwidgets)
@@ -704,6 +705,36 @@ (define-public python-astropy
 astronomy and astrophysics.")
     (license license:bsd-3)))
 
+(define-public python-astral
+  (package
+   (name "python-astral")
+   (version "2.2")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (pypi-uri "astral" version))
+     (sha256
+      (base32 "1gkggdibccmdy9glymw3kbrkzm6svvsg0lk56hhy92y4smkrj7g4"))))
+   (build-system python-build-system)
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+                     (replace 'check
+                              (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+                                (when tests?
+                                  (add-installed-pythonpath inputs outputs)
+                                  (invoke "python" "-m" "pytest")))))))
+   (native-inputs
+    (list python-freezegun python-setuptools-scm))
+   (propagated-inputs
+    (list python-dataclasses python-pytest python-pytz))
+   (home-page "https://github.com/sffjunkie/astral")
+   (synopsis "Calculations for the position of the sun and moon")
+   (description "@code{Astral} a Python module which calculates times
+ for various positions of the sun: dawn, sunrise, solar noon, sunset, dusk,
+solar elevation, solar azimuth, rahukaalam, and the phases of the moon.")
+   (license license:asl2.0)))
+
 (define-public libnova
   (package
     (name "libnova")
-- 
2.34.0


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

* bug#52991: [PATCH] gnu: Add python-astral
  2022-01-04 15:50   ` Disseminate Dissent via Guix-patches via
@ 2022-01-08 22:23     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2022-01-08 22:23 UTC (permalink / raw)
  To: Disseminate Dissent; +Cc: 52991-done, Vinicius Monego

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

Hi,

Disseminate Dissent <disseminatedissent@protonmail.com> skribis:

> From edf40f038e037f891bc3aaede0015da064f4c0bb Mon Sep 17 00:00:00 2001
> From: paladhammika <paladhammika@protonmail.com>
> Date: Tue, 4 Jan 2022 10:42:24 -0500
> Subject: [PATCH] gnu: Add python=astral.
>
> ---
>  gnu/packages/astronomy.scm | 31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)

Applied with the minor tweak below plus a commit log.

Thank you, and thanks Vinicius for reviewing!

Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 901 bytes --]

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 88966d7ecc..a7a07fa3a8 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -730,9 +730,9 @@ (define-public python-astral
      (list python-dataclasses python-pytest python-pytz))
     (home-page "https://github.com/sffjunkie/astral")
     (synopsis "Calculations for the position of the sun and moon")
-   (description "@code{Astral} a Python module which calculates times
- for various positions of the sun: dawn, sunrise, solar noon, sunset, dusk,
-solar elevation, solar azimuth, rahukaalam, and the phases of the moon.")
+    (description "Astral is a Python module that calculates times for various
+positions of the sun: dawn, sunrise, solar noon, sunset, dusk, solar
+elevation, solar azimuth, rahukaalam, and the phases of the moon.")
     (license license:asl2.0)))
 
 (define-public libnova

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

end of thread, other threads:[~2022-01-08 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 23:22 [bug#52991] [PATCH] gnu: Add python-astral Disseminate Dissent via Guix-patches via
2022-01-04  3:08 ` Vinicius Monego
2022-01-04 15:50   ` Disseminate Dissent via Guix-patches via
2022-01-08 22:23     ` bug#52991: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).