unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle.
@ 2016-09-25 20:24 Hartmut Goebel
  2016-09-25 20:24 ` [PATCH 2/2] gnu: Add python-validictory and python2-validictory Hartmut Goebel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hartmut Goebel @ 2016-09-25 20:24 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/python.scm (python-setproctitle, python2-setproctitle):
  New variables.
---
 gnu/packages/python.scm | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 688a5d4..95a2027 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -10939,3 +10939,61 @@ with an associated set of resolve methods that know how to fetch data.")
 provide extendible implementations of common aspects of a cloud so that you can
 focus on building massively scalable web applications.")
     (license license:expat)))
+
+(define-public python-setproctitle
+(package
+  (name "python-setproctitle")
+  (version "1.1.10")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (pypi-uri "setproctitle" version))
+      (sha256
+        (base32
+          "163kplw9dcrw0lffq1bvli5yws3rngpnvrxrzdw89pbphjjvg0v2"))))
+  (build-system python-build-system)
+  (arguments
+   '(#:phases
+     (modify-phases %standard-phases
+        (add-before 'check 'patch-Makefile
+           ;; Stricly this is only required for the python2 variant.
+           ;; But adding a phase in an inherited package seems to be
+           ;; cumbersum. So we patch even for python3.
+           (lambda _ ;* (#:key inputs #:allow-other-keys)
+             (let ((nose (assoc-ref %build-inputs "python2-nose")))
+               (if nose
+                 (substitute* "Makefile"
+                   (("\\$\\(PYTHON\\) [^ ]which nosetests[^ ] ")
+                    (string-append nose "/bin/nosetests "))))
+	       #t)))
+        (replace 'check
+           (lambda _
+             (setenv "PYTHON" (or (which "python3") (which "python")))
+             (setenv "PYCONFIG" (or (which "python3-config") (which "python-config")))
+             (setenv "CC" "gcc")
+             ;; No need to extend PYTHONPATH so the built package will
+             ;; be found, since the Makefile will build anyway
+             (zero? (system* "make" "check"))
+             )))))
+  (native-inputs
+   `(("procps" ,procps))) ; required for tests
+  (home-page
+    "https://github.com/dvarrazzo/py-setproctitle")
+  (synopsis "Setproctitle implementation for Python to customize the process title")
+  (description "The library allows a process to change its title (as
+displayed by system tools such as ps and top).
+
+Changing the title is mostly useful in multi-process systems, for
+example when a master process is forked: changing the children's title
+allows to identify the task each process is busy with.  The technique
+is used by PostgreSQL and the OpenSSH Server for example.")
+  (license license:bsd-3)
+  (properties `((python2-variant . ,(delay python2-setproctitle))))))
+
+(define-public python2-setproctitle
+  (let ((base (package-with-python2 
+               (strip-python2-variant python-setproctitle))))
+    (package
+      (inherit base)
+      (native-inputs `(("python2-nose" ,python2-nose)
+                       ,@(package-native-inputs base))))))
-- 
2.7.4

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

* [PATCH 2/2] gnu: Add python-validictory and python2-validictory.
  2016-09-25 20:24 [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle Hartmut Goebel
@ 2016-09-25 20:24 ` Hartmut Goebel
  2016-09-25 20:38 ` [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle Danny Milosavljevic
  2016-10-19 14:45 ` Efraim Flashner
  2 siblings, 0 replies; 5+ messages in thread
From: Hartmut Goebel @ 2016-09-25 20:24 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/python.scm (python-validictory, python2-validictory):
  New variables.
---
 gnu/packages/python.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 95a2027..3172bb5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -10997,3 +10997,47 @@ is used by PostgreSQL and the OpenSSH Server for example.")
       (inherit base)
       (native-inputs `(("python2-nose" ,python2-nose)
                        ,@(package-native-inputs base))))))
+
+(define-public python-validictory
+  (package
+    (name "python-validictory")
+    (version "1.0.1")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (pypi-uri "validictory" version))
+      (sha256
+       (base32
+        "1zf1g9sw47xzp5f80bd94pb42j9yqv82lcrgcvdwr6nkaphfi37q"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'bootstrap
+           ;; Move the tests out of the package directory to avoid
+           ;; packaging them.
+           (lambda* _
+             (rename-file "validictory/tests" "tests")
+             (delete-file "tests/__init__.py")))
+         (replace 'check
+           (lambda _
+             ;; Extend PYTHONPATH so the built package will be found.
+             (setenv "PYTHONPATH"
+                     (string-append (getcwd) "/build/lib:"
+                                    (getenv "PYTHONPATH")))
+             (zero? (system* "py.test" "-vv" )))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-setuptools" ,python-setuptools)))
+    (home-page
+     "https://github.com/jamesturk/validictory")
+    (synopsis "General purpose Python data validator")
+    (description "It allows validation of arbitrary Python data structures.
+
+The schema format is based on the JSON Schema
+proposal (http://json-schema.org), so combined with json the library is also
+useful as a validator for JSON data.")
+  (license license:expat)))
+
+(define-public python2-validictory
+    (package-with-python2 python-validictory))
-- 
2.7.4

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

* Re: [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle.
  2016-09-25 20:24 [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle Hartmut Goebel
  2016-09-25 20:24 ` [PATCH 2/2] gnu: Add python-validictory and python2-validictory Hartmut Goebel
@ 2016-09-25 20:38 ` Danny Milosavljevic
  2016-10-19 14:45 ` Efraim Flashner
  2 siblings, 0 replies; 5+ messages in thread
From: Danny Milosavljevic @ 2016-09-25 20:38 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

On Sun, 25 Sep 2016 22:24:36 +0200
Hartmut Goebel <h.goebel@crazy-compilers.com> wrote:
...
> +                 (substitute* "Makefile"
> +                   (("\\$\\(PYTHON\\) [^ ]which nosetests[^ ] ")
> +                    (string-append nose "/bin/nosetests "))))
> +	       #t)))
    ^^^^^ tab character is there. Why?

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

* Re: [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle.
  2016-09-25 20:24 [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle Hartmut Goebel
  2016-09-25 20:24 ` [PATCH 2/2] gnu: Add python-validictory and python2-validictory Hartmut Goebel
  2016-09-25 20:38 ` [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle Danny Milosavljevic
@ 2016-10-19 14:45 ` Efraim Flashner
  2016-10-20  7:56   ` Hartmut Goebel
  2 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2016-10-19 14:45 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

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

On Sun, Sep 25, 2016 at 10:24:36PM +0200, Hartmut Goebel wrote:
> * gnu/packages/python.scm (python-setproctitle, python2-setproctitle):
>   New variables.
> ---
>  gnu/packages/python.scm | 58 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 58 insertions(+)
> 
> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index 688a5d4..95a2027 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -10939,3 +10939,61 @@ with an associated set of resolve methods that know how to fetch data.")
>  provide extendible implementations of common aspects of a cloud so that you can
>  focus on building massively scalable web applications.")
>      (license license:expat)))
> +
> +(define-public python-setproctitle
> +(package
> +  (name "python-setproctitle")
> +  (version "1.1.10")
> +  (source
> +    (origin
> +      (method url-fetch)
> +      (uri (pypi-uri "setproctitle" version))
> +      (sha256
> +        (base32
> +          "163kplw9dcrw0lffq1bvli5yws3rngpnvrxrzdw89pbphjjvg0v2"))))
> +  (build-system python-build-system)
> +  (arguments
> +   '(#:phases
> +     (modify-phases %standard-phases
> +        (add-before 'check 'patch-Makefile
> +           ;; Stricly this is only required for the python2 variant.
> +           ;; But adding a phase in an inherited package seems to be
> +           ;; cumbersum. So we patch even for python3.
> +           (lambda _ ;* (#:key inputs #:allow-other-keys)
> +             (let ((nose (assoc-ref %build-inputs "python2-nose")))
> +               (if nose
> +                 (substitute* "Makefile"
> +                   (("\\$\\(PYTHON\\) [^ ]which nosetests[^ ] ")
> +                    (string-append nose "/bin/nosetests "))))
> +	       #t)))
> +        (replace 'check
> +           (lambda _
> +             (setenv "PYTHON" (or (which "python3") (which "python")))

                                 IIRC (or ... here will return true,
                                 which i'm sure is not the point.

> +             (setenv "PYCONFIG" (or (which "python3-config") (which "python-config")))
> +             (setenv "CC" "gcc")
> +             ;; No need to extend PYTHONPATH so the built package will
> +             ;; be found, since the Makefile will build anyway
> +             (zero? (system* "make" "check"))
> +             )))))

These close perentheses should be on the previous line

> +  (native-inputs
> +   `(("procps" ,procps))) ; required for tests
> +  (home-page
> +    "https://github.com/dvarrazzo/py-setproctitle")
> +  (synopsis "Setproctitle implementation for Python to customize the process title")
> +  (description "The library allows a process to change its title (as
> +displayed by system tools such as ps and top).
> +
> +Changing the title is mostly useful in multi-process systems, for
> +example when a master process is forked: changing the children's title
> +allows to identify the task each process is busy with.  The technique
> +is used by PostgreSQL and the OpenSSH Server for example.")
> +  (license license:bsd-3)
> +  (properties `((python2-variant . ,(delay python2-setproctitle))))))
> +
> +(define-public python2-setproctitle
> +  (let ((base (package-with-python2 
> +               (strip-python2-variant python-setproctitle))))
> +    (package
> +      (inherit base)
> +      (native-inputs `(("python2-nose" ,python2-nose)
> +                       ,@(package-native-inputs base))))))
> -- 
> 2.7.4
> 
> 

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle.
  2016-10-19 14:45 ` Efraim Flashner
@ 2016-10-20  7:56   ` Hartmut Goebel
  0 siblings, 0 replies; 5+ messages in thread
From: Hartmut Goebel @ 2016-10-20  7:56 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 694 bytes --]

Am 19.10.2016 um 16:45 schrieb Efraim Flashner:
>> > +             (setenv "PYTHON" (or (which "python3") (which "python")))
>                                  IIRC (or ... here will return true,
>                                  which i'm sure is not the point.

https://www.gnu.org/software/guile/manual/html_node/and-or.html#and-or says:
"The value of the last evaluated expression is returned."

If it wouldn't, the code would not have worked here :-)

Thanks for the review, nevertheless:-)

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

end of thread, other threads:[~2016-10-20  7:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-25 20:24 [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle Hartmut Goebel
2016-09-25 20:24 ` [PATCH 2/2] gnu: Add python-validictory and python2-validictory Hartmut Goebel
2016-09-25 20:38 ` [PATCH 1/2] gnu: Add python-setproctitle and python2-setproctitle Danny Milosavljevic
2016-10-19 14:45 ` Efraim Flashner
2016-10-20  7:56   ` Hartmut Goebel

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