[PATCH] gnu: Add python-conda

  • Done
  • quality assurance status badge
Details
4 participants
  • Frederick Muriithi
  • Marius Bakke
  • Pjotr Prins
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Frederick Muriithi
Severity
normal
F
F
Frederick Muriithi wrote on 10 Jul 2017 09:29
(address . guix-patches@gnu.org)
CALjrZwYaq9=tb3ni7bmhLDxA+9BKpFGLGTO6qeBQy7wADdvyTg@mail.gmail.com
This package is dependent on python-ruamel.yaml that was submitted in bug #27558

--
Frederick M. Muriithi
From b8fbe1fe612dad6ad00d8c024a6b9dca12080e65 Mon Sep 17 00:00:00 2001
From: Muriithi Frederick Muriuki <fredmanglis@gmail.com>
Date: Mon, 10 Jul 2017 10:25:37 +0300
Subject: [PATCH] gnu: Add python-conda

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

Toggle diff (48 lines)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index d110a1cb3..f0e87fb53 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -15549,3 +15549,41 @@ pure Python module.")
(define-public python2-rencode
(package-with-python2 python-rencode))
+
+(define-public python-conda
+ (package
+ (name "python-conda")
+ (version "4.3.16")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "conda" version))
+ (sha256
+ (base32
+ "0lsr52a6x268ixfif36p6r64zkhsdjri0g8gcylkpsix6hhzh7m9"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* _xs
+ (zero? (system* "py.test")))))))
+ (native-inputs
+ `(("python-ruamel.yaml" ,python-ruamel.yaml)
+ ("python-requests" ,python-requests)
+ ("python-pycosat" ,python-pycosat)
+ ("python-pytest" ,python-pytest)
+ ("python-responses" ,python-responses)))
+ (home-page "https://github.com/conda/conda")
+ (synopsis
+ "Cross-platform, OS-agnostic, system-level binary package manager")
+ (description
+ "Conda is a cross-platform, Python-agnostic binary package manager. It is
+the package manager used by Anaconda installations, but it may be used for other
+systems as well. Conda makes environments first-class citizens, making it easy
+to create independent environments even for C libraries. Conda is written
+entirely in Python, and is BSD licensed open source.")
+ (license license:bsd-3)))
+
+(define-public python2-conda
+ (package-with-python2 python-conda))
--
2.13.2
M
M
Marius Bakke wrote on 11 Jul 2017 21:32
871spmlqgf.fsf@fastmail.com
Frederick Muriithi <fredmanglis@gmail.com> writes:

Toggle quote (2 lines)
> * gnu/package/python.scm (python-conda, python2-conda): New variables.

Yay! Since this is a package manager, I think it should go in
'package-management.scm'.

[...]

Toggle quote (18 lines)
> +(define-public python-conda
> + (package
> + (name "python-conda")
> + (version "4.3.16")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "conda" version))
> + (sha256
> + (base32
> + "0lsr52a6x268ixfif36p6r64zkhsdjri0g8gcylkpsix6hhzh7m9"))))
> + (build-system python-build-system)
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (replace 'check
> + (lambda* _xs

"(lambda _" here is sufficient.

Toggle quote (8 lines)
> + (zero? (system* "py.test")))))))
> + (native-inputs
> + `(("python-ruamel.yaml" ,python-ruamel.yaml)
> + ("python-requests" ,python-requests)
> + ("python-pycosat" ,python-pycosat)
> + ("python-pytest" ,python-pytest)
> + ("python-responses" ,python-responses)))

Wait, didn't we package some other dependencies too? Just curious :-)

Toggle quote (10 lines)
> + (synopsis
> + "Cross-platform, OS-agnostic, system-level binary package manager")
> + (description
> + "Conda is a cross-platform, Python-agnostic binary package manager. It is
> +the package manager used by Anaconda installations, but it may be used for other
> +systems as well. Conda makes environments first-class citizens, making it easy
> +to create independent environments even for C libraries. Conda is written
> +entirely in Python, and is BSD licensed open source.")

You can cut the part after the comma. Everything in Guix is free
software, so there is no need to mention it :-)

Can you send updated patches please? Thanks for packaging these!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlllJ9AACgkQoqBt8qM6
VPqoXQgA1ADSHy08Q+vf5eaMHTlmhhHt6pqtZ6h3Zo8nT3+OK2kt5Uyxkzam/QC+
7Sol8L/g/php2/V+sSbrw3u0kj2+8nwJCVJrWtj5/0twG461qfmvxf7HJ5rjoqQr
9Pog8zrOtW7vO4ok8z5MnIUb1Lu4Azc+GuEM1ZbIrHiqG1+4Ja32r9lc0fD0oRRw
TcyVH/q1UePTjfHyenHs2YnwRSd74hU1ZPIVGkQ+pobljWnwo3dzp2G/12h/qSgs
g3tbD6e1M3RveIYl+ZBjblittYVH0cqIkkE4P4Y9axrnjsRF+k4n/F/VC6Aj2BrL
AHfxHJJgkeCITIarvy3AUqFcMz/a8g==
=cF1T
-----END PGP SIGNATURE-----

F
F
Frederick Muriithi wrote on 12 Jul 2017 17:35
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 27637@debbugs.gnu.org)
CALjrZwYm8kHq_+9rhHWdek1uNZ19-4-LjWFP1RVMv7pb3RPAEQ@mail.gmail.com
Toggle quote (2 lines)
> Wait, didn't we package some other dependencies too? Just curious :-)

Turns out that the newer version of conda no longer needs some of the
dependencies it needed before.
M
M
Muriithi Frederick Muriuki wrote on 13 Jul 2017 03:47
[PATCH 1/2] gnu: Add python-conda
(address . 27637@debbugs.gnu.org)(address . mbakke@fastmail.com)
20170713014726.21093-1-fredmanglis@gmail.com
* gnu/packages/package-management.scm (python-conda, python2-conda) New
* variables.
---
gnu/packages/package-management.scm | 40 ++++++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index af91ec1d7..121a915fb 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -25,7 +25,7 @@
#:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
- #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0))
+ #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0 bsd-3))
#:use-module (gnu packages)
#:use-module (gnu packages guile)
#:use-module (gnu packages file)
@@ -516,3 +516,41 @@ different. It recursively unpacks archives of many kinds and transforms
various binary formats into more human readable forms to compare them. It can
compare two tarballs, ISO images, or PDFs just as easily.")
(license gpl3+)))
+
+(define-public python-conda
+ (package
+ (name "python-conda")
+ (version "4.3.16")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "conda" version))
+ (sha256
+ (base32
+ "0lsr52a6x268ixfif36p6r64zkhsdjri0g8gcylkpsix6hhzh7m9"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* _
+ (zero? (system* "py.test")))))))
+ (native-inputs
+ `(("python-ruamel.yaml" ,python-ruamel.yaml)
+ ("python-requests" ,python-requests)
+ ("python-pycosat" ,python-pycosat)
+ ("python-pytest" ,python-pytest)
+ ("python-responses" ,python-responses)))
+ (home-page "https://github.com/conda/conda")
+ (synopsis
+ "Cross-platform, OS-agnostic, system-level binary package manager")
+ (description
+ "Conda is a cross-platform, Python-agnostic binary package manager. It is
+the package manager used by Anaconda installations, but it may be used for other
+systems as well. Conda makes environments first-class citizens, making it easy
+to create independent environments even for C libraries. Conda is written
+entirely in Python, and is BSD licensed open source.")
+ (license bsd-3)))
+
+(define-public python2-conda
+ (package-with-python2 python-conda))
--
2.13.2
M
M
Muriithi Frederick Muriuki wrote on 13 Jul 2017 03:47
[PATCH 2/2] gnu: Add conda
(address . 27637@debbugs.gnu.org)(address . mbakke@fastmail.com)
20170713014726.21093-2-fredmanglis@gmail.com
* gnu/packages/package-management.scm (conda): New variable.
---
gnu/packages/package-management.scm | 86 +++++++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+)

Toggle diff (96 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 121a915fb..7fb245d41 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -554,3 +554,89 @@ entirely in Python, and is BSD licensed open source.")
(define-public python2-conda
(package-with-python2 python-conda))
+
+(define-public conda
+ ;; python-conda is the python library form, to be included in python programs,
+ ;; while conda, here, is the executable form that can be run from the cli
+ (package
+ (inherit python-conda)
+ (name "conda")
+ (version "4.3.16")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/conda/conda/archive/"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
+ (arguments
+ `(#:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build
+ 'create-version-file
+ (lambda* _
+ (let ((version-file (open-output-file "conda/.version")))
+ (display ,version version-file)
+ (close-output-port version-file)
+ #t)))
+ (replace 'build
+ (lambda* (#:key use-setuptools? #:allow-other-keys)
+ (apply system* "python" "utils/setup-testing.py" "bdist" '())))
+ (add-before 'check
+ 'remove-failing-tests
+ (lambda* _
+ ;; these tests try to access /homeless-shelter or
+ ;; require internet/network access
+ (delete-file "tests/test_cli.py")
+ (delete-file "tests/test_create.py")
+ (delete-file "tests/test_export.py")
+ (delete-file "tests/test_connection.py")
+ (delete-file "tests/test_fetch.py")
+ (delete-file "tests/test_info.py")
+ (delete-file "tests/test_install.py")
+ (delete-file "tests/test_plan.py")
+ (delete-file "tests/test_history.py")
+ (delete-file "tests/test_priority.py")
+ (delete-file "tests/conda_env/test_env.py")
+ (delete-file "tests/conda_env/test_cli.py")
+ (delete-file "tests/core/test_repodata.py")
+ (delete-file "tests/conda_env/test_create.py")
+ (delete-file "tests/conda_env/specs/test_binstar.py")
+ (delete-file "tests/conda_env/utils/test_uploader.py")
+ (delete-file "tests/conda_env/specs/test_notebook.py")
+ (delete-file "tests/conda_env/utils/test_notebooks.py")
+ (delete-file "tests/core/test_index.py")
+ (delete-file "tests/gateways/disk/test_delete.py")))
+ (replace 'check
+ (lambda* _
+ (zero? (system* "py.test"))))
+ (replace 'install
+ (lambda* (#:key outputs target (configure-flags '())
+ use-setup-tools? #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (main-dir (getcwd))
+ (build-dir (string-append main-dir "/build"))
+ (dist-dir (string-append main-dir "/dist"))
+ (dir-stream (opendir dist-dir))
+ (tar-file (let get-file ((stream dir-stream))
+ (let ((the-file ""))
+ (do ((file (readdir stream) (readdir stream)))
+ ((eof-object? file))
+ (if (not (or (equal? file ".")
+ (equal? file "..")))
+ (set! the-file file)))
+ the-file))))
+ (closedir dir-stream)
+ (chdir dist-dir)
+ ;; tar seems to be ignoring the -C option and at this point
+ ;; the path in the variable `out` does not seem to exist, hence
+ ;; the need for the hack-y code that follows.
+ (mkdir "tmp")
+ (chdir "tmp")
+ (system* "tar" "-xvzf" (string-append "../" tar-file)
+ "--strip-components=4")
+ (chdir "../")
+ (system* "cp" "-fvR" "tmp/" out)
+ (chdir main-dir)))))))))
--
2.13.2
M
M
Marius Bakke wrote on 16 Jul 2017 23:09
87bmok6qd6.fsf@fastmail.com
Muriithi Frederick Muriuki <fredmanglis@gmail.com> writes:

Toggle quote (2 lines)
> * gnu/packages/package-management.scm (conda): New variable.

Thanks!

Toggle quote (4 lines)
> +(define-public conda
> + ;; python-conda is the python library form, to be included in python programs,
> + ;; while conda, here, is the executable form that can be run from the cli

The previous patch also creates "$out/bin/conda". Does that executable
not work? Why do we need both packages?

Toggle quote (15 lines)
> + (package
> + (inherit python-conda)
> + (name "conda")
> + (version "4.3.16")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (string-append "https://github.com/conda/conda/archive/"
> + version ".tar.gz"))
> + (sha256
> + (base32
> + "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
> + (arguments
> + `(#:tests? #f

There are a few phases that messes with the tests, yet they are
disabled. Why?

Toggle quote (18 lines)
> + #:phases
> + (modify-phases %standard-phases
> + (add-before 'build
> + 'create-version-file
> + (lambda* _
> + (let ((version-file (open-output-file "conda/.version")))
> + (display ,version version-file)
> + (close-output-port version-file)
> + #t)))
> + (replace 'build
> + (lambda* (#:key use-setuptools? #:allow-other-keys)
> + (apply system* "python" "utils/setup-testing.py" "bdist" '())))
> + (add-before 'check
> + 'remove-failing-tests
> + (lambda* _
> + ;; these tests try to access /homeless-shelter or
> + ;; require internet/network access

Often tests using /homeless-shelter just needs the HOME variable set to
some other (writable) directory (typically /tmp).

Toggle quote (52 lines)
> + (delete-file "tests/test_cli.py")
> + (delete-file "tests/test_create.py")
> + (delete-file "tests/test_export.py")
> + (delete-file "tests/test_connection.py")
> + (delete-file "tests/test_fetch.py")
> + (delete-file "tests/test_info.py")
> + (delete-file "tests/test_install.py")
> + (delete-file "tests/test_plan.py")
> + (delete-file "tests/test_history.py")
> + (delete-file "tests/test_priority.py")
> + (delete-file "tests/conda_env/test_env.py")
> + (delete-file "tests/conda_env/test_cli.py")
> + (delete-file "tests/core/test_repodata.py")
> + (delete-file "tests/conda_env/test_create.py")
> + (delete-file "tests/conda_env/specs/test_binstar.py")
> + (delete-file "tests/conda_env/utils/test_uploader.py")
> + (delete-file "tests/conda_env/specs/test_notebook.py")
> + (delete-file "tests/conda_env/utils/test_notebooks.py")
> + (delete-file "tests/core/test_index.py")
> + (delete-file "tests/gateways/disk/test_delete.py")))
> + (replace 'check
> + (lambda* _
> + (zero? (system* "py.test"))))
> + (replace 'install
> + (lambda* (#:key outputs target (configure-flags '())
> + use-setup-tools? #:allow-other-keys)
> + (let* ((out (assoc-ref outputs "out"))
> + (main-dir (getcwd))
> + (build-dir (string-append main-dir "/build"))
> + (dist-dir (string-append main-dir "/dist"))
> + (dir-stream (opendir dist-dir))
> + (tar-file (let get-file ((stream dir-stream))
> + (let ((the-file ""))
> + (do ((file (readdir stream) (readdir stream)))
> + ((eof-object? file))
> + (if (not (or (equal? file ".")
> + (equal? file "..")))
> + (set! the-file file)))
> + the-file))))
> + (closedir dir-stream)
> + (chdir dist-dir)
> + ;; tar seems to be ignoring the -C option and at this point
> + ;; the path in the variable `out` does not seem to exist, hence
> + ;; the need for the hack-y code that follows.
> + (mkdir "tmp")
> + (chdir "tmp")
> + (system* "tar" "-xvzf" (string-append "../" tar-file)
> + "--strip-components=4")
> + (chdir "../")
> + (system* "cp" "-fvR" "tmp/" out)
> + (chdir main-dir)))))))))

Wooow. What happens with the default 'python setup.py install'?

Unless there exists a good reason to both have a "conda" package and a
'python-conda', I think we should consolidate these two. The previous
patch (from PyPi) did not have tests either, so I suppose we should use
this release (but we should really figure out why setup.py is broken).
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAllr1gUACgkQoqBt8qM6
VPreLQf/Xw52ffE02Pb8LKWz7IgzNimwvWogB6UdyzrVLRuL3ZmsDl4Ff3CEls6e
t0rgSWTgiN5iJEcyR0CUWhLvxoN5Q+Z/gj1U6WzP7U3ikI6KXcJ0dAHyRgtEAALY
gcSjoq3LooGcHDlBV+pZd+Hb50CZrpRq/fu4esHrC5UaiykbyP8L7r6wAsZoBZmZ
rilJTUVtujc72R7zEOpAUanPr3HNuq7IL1r4RR+7oX8SYEaESTt9gRMmkFBkjsTe
1LdSFHrY0GwRfGagxCCvbEv6tAmQIdyPS/iLPMPwN+Yukiq0xu242Ex9renjAJd3
jpEgefSQjL7tvRt5CHVfJoOA1MfkEA==
=EOUH
-----END PGP SIGNATURE-----

F
F
Frederick Muriithi wrote on 17 Jul 2017 08:17
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 27637@debbugs.gnu.org)
CALjrZwbPodOWFzrPEKWko6oGEOWSD-ma4de8vqjD5rYz2ByRsA@mail.gmail.com
Toggle quote (4 lines)
> The previous patch also creates "$out/bin/conda". Does that executable
> not work? Why do we need both packages?
>

Conda has two forms:

* a python library form, that can be included in python programs, and
* an executable form that can be run on the cli

I defined python-conda to provide the library form, whereas conda was
to provide the executable form.

Toggle quote (3 lines)
> There are a few phases that messes with the tests, yet they are
> disabled. Why?

My bad. I will reactivate them. Must have left that in by mistake. My apologies.

Toggle quote (4 lines)
> Often tests using /homeless-shelter just needs the HOME variable set to
> some other (writable) directory (typically /tmp).
>

Thanks. I did not know that. I need to note it down for future newbies.

Toggle quote (3 lines)
> Wooow. What happens with the default 'python setup.py install'?
>

The default setup.py builds the python library form, whereas the
utils/setup-testing.py builds the executable version

Toggle quote (5 lines)
> Unless there exists a good reason to both have a "conda" package and a
> 'python-conda', I think we should consolidate these two. The previous
> patch (from PyPi) did not have tests either, so I suppose we should use
> this release (but we should really figure out why setup.py is broken).

I don't think setup.py is broken, I think the conda team built it that
way, so that one is explicit on what they want to do, at least that is
what I could gather from my reading on it. I will redefine the
packages to make it cleaner, and simply use the release/url that has
the tests to define both.

I will be sending the patch soon.

--
Frederick M. Muriithi
M
M
Marius Bakke wrote on 18 Jul 2017 01:04
(name . Frederick Muriithi)(address . fredmanglis@gmail.com)(address . 27637@debbugs.gnu.org)
87pocy64xb.fsf@fastmail.com
Frederick Muriithi <fredmanglis@gmail.com> writes:

Toggle quote (12 lines)
>> The previous patch also creates "$out/bin/conda". Does that executable
>> not work? Why do we need both packages?
>>
>
> Conda has two forms:
>
> * a python library form, that can be included in python programs, and
> * an executable form that can be run on the cli
>
> I defined python-conda to provide the library form, whereas conda was
> to provide the executable form.

My question was more whether it made sense to provide two different
packages, if they both have the same files. Does the `conda` executable
from 'python-conda' work differently? Maybe we should rename or remove
it to avoid conflicts?

Toggle quote (5 lines)
>> There are a few phases that messes with the tests, yet they are
>> disabled. Why?
>
> My bad. I will reactivate them. Must have left that in by mistake. My apologies.

Great, thanks!

Toggle quote (6 lines)
>> Wooow. What happens with the default 'python setup.py install'?
>>
>
> The default setup.py builds the python library form, whereas the
> utils/setup-testing.py builds the executable version

Ahh okay. Having read both scripts it looks like 'setup.py' only
installs "conda.cli.pip_warning:main" instead of the real thing. Sorry
for the confusion!

Toggle quote (11 lines)
>> Unless there exists a good reason to both have a "conda" package and a
>> 'python-conda', I think we should consolidate these two. The previous
>> patch (from PyPi) did not have tests either, so I suppose we should use
>> this release (but we should really figure out why setup.py is broken).
>
> I don't think setup.py is broken, I think the conda team built it that
> way, so that one is explicit on what they want to do, at least that is
> what I could gather from my reading on it. I will redefine the
> packages to make it cleaner, and simply use the release/url that has
> the tests to define both.

Sounds good. I still think it's worth investigating if this "official"
(quotes since it's still explicitly unsupported) build method also can
be used as a library so we can avoid maintaining three variants of
nearly the same package. Let us know what you find :-)

Thanks!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlltQpAACgkQoqBt8qM6
VPo/aAgAsvibtH9Bj/cYPZ4gpwdVjjfo1ll2/OAsBauHYn8bk+aG8XV4t/YIX5JC
WwGDGnPUd7aFvH4Ol87c+HOoYDzpgKNkaDIf8mJ0F5+lCO7yWYYZT0Lzan2wysCg
ns/4FlwNvsIDUnjkcQVQfbg4ICUYfwBwUo4GSttQxIwTwauyQxbMijizjGx3WWqX
UsO4u+fpYwB8SplO2tx3o1oOSSQ69DxYKnC7pnF/scXaIdxp092a511PpE57Tlwg
MAkNWhSdCRRNMBpp+EPrLP1Hz/8Keo1oBIrI45YBh/O6xXc8WszTeDQ+TczDZDqR
vTbQQwNv5LCAWFi5jFGn6qg18/wm8A==
=NEZb
-----END PGP SIGNATURE-----

F
F
Frederick Muriithi wrote on 18 Jul 2017 09:53
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 27637@debbugs.gnu.org)
CALjrZwZih6v8A62D3m39g0X7b=wHMdVPSwH9jY8XbQZQrpjx2w@mail.gmail.com
On 18 Jul 2017 2:04 a.m., "Marius Bakke" <mbakke@fastmail.com> wrote:

Frederick Muriithi <fredmanglis@gmail.com> writes:

Toggle quote (12 lines)
>> The previous patch also creates "$out/bin/conda". Does that executable
>> not work? Why do we need both packages?
>>
>
> Conda has two forms:
>
> * a python library form, that can be included in python programs, and
> * an executable form that can be run on the cli
>
> I defined python-conda to provide the library form, whereas conda was
> to provide the executable form.

My question was more whether it made sense to provide two different
packages, if they both have the same files. Does the `conda` executable
from 'python-conda' work differently? Maybe we should rename or remove
it to avoid conflicts?

Toggle quote (4 lines)
>> There are a few phases that messes with the tests, yet they are
>> disabled. Why?
>
> My bad. I will reactivate them. Must have left that in by mistake. My
apologies.

Great, thanks!

Toggle quote (6 lines)
>> Wooow. What happens with the default 'python setup.py install'?
>>
>
> The default setup.py builds the python library form, whereas the
> utils/setup-testing.py builds the executable version

Ahh okay. Having read both scripts it looks like 'setup.py' only
installs "conda.cli.pip_warning:main" instead of the real thing. Sorry
for the confusion!

Toggle quote (11 lines)
>> Unless there exists a good reason to both have a "conda" package and a
>> 'python-conda', I think we should consolidate these two. The previous
>> patch (from PyPi) did not have tests either, so I suppose we should use
>> this release (but we should really figure out why setup.py is broken).
>
> I don't think setup.py is broken, I think the conda team built it that
> way, so that one is explicit on what they want to do, at least that is
> what I could gather from my reading on it. I will redefine the
> packages to make it cleaner, and simply use the release/url that has
> the tests to define both.

Sounds good. I still think it's worth investigating if this "official"
(quotes since it's still explicitly unsupported) build method also can
be used as a library so we can avoid maintaining three variants of
nearly the same package. Let us know what you find :-)

Thanks!


Well, we can drop python-conda (the library form) if necessary. My main
focus is conda as an application/executable, but thought to provide both
for completeness.

The patches will be coming in soon, fixing most of the Marius noted.
Attachment: file
M
M
Muriithi Frederick Muriuki wrote on 18 Jul 2017 10:37
[PATCH 1/5] gnu: Add python-pytz
(address . 27637@debbugs.gnu.org)(address . mbakke@fastmail.com)
20170718083709.5062-1-fredmanglis@gmail.com
* gnu/packages/package-management.scm (python-pytz, python2-pytz): New
* variables.
* Add expat license.
---
gnu/packages/package-management.scm | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)

Toggle diff (44 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index d2e30781b..e8a401f1c 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -25,7 +25,7 @@
#:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
- #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0))
+ #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0 expat))
#:use-module (gnu packages)
#:use-module (gnu packages guile)
#:use-module (gnu packages file)
@@ -516,3 +516,28 @@ different. It recursively unpacks archives of many kinds and transforms
various binary formats into more human readable forms to compare them. It can
compare two tarballs, ISO images, or PDFs just as easily.")
(license gpl3+)))
+
+(define-public python-pytz
+ (package
+ (name "python-pytz")
+ (version "2017.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "pytz" version ".zip"))
+ (sha256
+ (base32
+ "12cmd3j46d2gcw08bspvp6s9icfcvx88zjz52n1bli9dyvl5dh7m"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("unzip" ,unzip)))
+ (home-page "http://pythonhosted.org/pytz")
+ (synopsis "World timezone definitions, modern and historical")
+ (description "This library brings the Olson tz database into Python. It
+allows accurate and cross platform timezone calculations using Python 2.4 or
+higher. It also solves the issue of ambiguous times at the end of daylight
+saving time. Almost all of the Olson timezones are supported.")
+ (license expat)))
+
+(define-public python2-pytz
+ (package-with-python2 python-pytz))
--
2.13.2
M
M
Muriithi Frederick Muriuki wrote on 18 Jul 2017 10:37
[PATCH 2/5] gnu: Add python-clyent
(address . 27637@debbugs.gnu.org)(address . mbakke@fastmail.com)
20170718083709.5062-2-fredmanglis@gmail.com
* gnu/packages/package-management.scm (python-clyent, python2-clyent):
* New variables.
* Add bsd-3 license.
---
gnu/packages/package-management.scm | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index e8a401f1c..0c0b780ad 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -25,7 +25,7 @@
#:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
- #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0 expat))
+ #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0 expat bsd-3))
#:use-module (gnu packages)
#:use-module (gnu packages guile)
#:use-module (gnu packages file)
@@ -541,3 +541,26 @@ saving time. Almost all of the Olson timezones are supported.")
(define-public python2-pytz
(package-with-python2 python-pytz))
+
+(define-public python-clyent
+ (package
+ (name "python-clyent")
+ (version "1.2.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "clyent" version))
+ (sha256
+ (base32
+ "1r9987qmy1pz3hq54160bapqsywpq14waw4w9x3ly8hmq7kpgfbj"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-mock" ,python-mock)))
+ (home-page "https://github.com/binstar/clyent")
+ (synopsis "Command line client Library for windows and posix")
+ (description "Clyent is a python command line utiliy library for
+@code{binstar}, @code{binstar-build} and @code{chalmers}.")
+ (license bsd-3)))
+
+(define-public python2-clyent
+ (package-with-python2 python-clyent))
--
2.13.2
M
M
Muriithi Frederick Muriuki wrote on 18 Jul 2017 10:37
[PATCH 3/5] gnu: Add python-anaconda-client
(address . 27637@debbugs.gnu.org)(address . mbakke@fastmail.com)
20170718083709.5062-3-fredmanglis@gmail.com
* gnu/packages/package-management.scm (python-anaconda-client,
* python2-anaconda-client): New variables.
---
gnu/packages/package-management.scm | 54 +++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (64 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 0c0b780ad..a16a49bd0 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -564,3 +564,57 @@ saving time. Almost all of the Olson timezones are supported.")
(define-public python2-clyent
(package-with-python2 python-clyent))
+
+(define-public python-anaconda-client
+ (package
+ (name "python-anaconda-client")
+ (version "1.6.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/Anaconda-Platform/anaconda-client/archive/"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1wv4wi6k5jz7rlwfgvgfdizv77x3cr1wa2aj0k1595g7fbhkjhz2"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-pyyaml" ,python-pyyaml)
+ ("python-requests" ,python-requests)
+ ("python-clyent" ,python-clyent)))
+ (native-inputs
+ `(("python-pytz" ,python-pytz)
+ ("python-dateutil" ,python-dateutil)
+ ("python-mock" ,python-mock)
+ ("python-coverage" ,python-coverage)
+ ("python-pillow" ,python-pillow)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'check
+ 'set-up-home
+ (lambda* _
+ (setenv "HOME" "/tmp")))
+ (add-before 'check
+ 'remove-network-tests
+ (lambda* _
+ ;; Remove tests requiring a network connection
+ (delete-file "binstar_client/tests/test_upload.py")
+ (delete-file "binstar_client/tests/test_authorizations.py")
+ (delete-file "binstar_client/tests/test_login.py")
+ (delete-file "binstar_client/tests/test_whoami.py")
+ (delete-file "binstar_client/utils/notebook/tests/test_data_uri.py")
+ (delete-file "binstar_client/utils/notebook/tests/test_base.py")
+ (delete-file "binstar_client/utils/notebook/tests/test_downloader.py")
+ (delete-file "binstar_client/inspect_package/tests/test_conda.py"))))))
+ (home-page "https://github.com/Anaconda-Platform/anaconda-client")
+ (synopsis "Anaconda Cloud command line client library")
+ (description
+ "Anaconda Cloud command line client library provides an interface to
+Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
+environments.")
+ (license bsd-3)))
+
+(define-public python2-anaconda-client
+ (package-with-python2 python-anaconda-client))
--
2.13.2
M
M
Muriithi Frederick Muriuki wrote on 18 Jul 2017 10:37
[PATCH 4/5] gnu: Add python-conda
(address . 27637@debbugs.gnu.org)(address . mbakke@fastmail.com)
20170718083709.5062-4-fredmanglis@gmail.com
* gnu/packages/package-management.scm (python-conda, python2-conda): New
* variables.
* Add module (gnu packages serialization).
---
gnu/packages/package-management.scm | 75 +++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)

Toggle diff (92 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index a16a49bd0..3f106a65e 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -52,6 +52,7 @@
#:use-module (gnu packages tls)
#:use-module (gnu packages ssh)
#:use-module (gnu packages vim)
+ #:use-module (gnu packages serialization)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match))
@@ -618,3 +619,77 @@ environments.")
(define-public python2-anaconda-client
(package-with-python2 python-anaconda-client))
+
+(define-public python-conda
+ (package
+ (name "python-conda")
+ (version "4.3.16")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/conda/conda/archive/"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-ruamel.yaml" ,python-ruamel.yaml)
+ ("python-requests" ,python-requests)
+ ("python-pycosat" ,python-pycosat)
+ ("python-pytest" ,python-pytest)
+ ("python-responses" ,python-responses)
+ ("python-pyyaml" ,python-pyyaml)
+ ("python-anaconda-client" ,python-anaconda-client)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build
+ 'create-version-file
+ (lambda* _
+ (let ((version-file (open-output-file "conda/.version")))
+ (display ,version version-file)
+ (close-output-port version-file)
+ #t)))
+ (add-before 'check
+ 'remove-failing-tests
+ (lambda* _
+ ;; these tests require internet/network access
+ (delete-file "tests/test_cli.py")
+ (delete-file "tests/test_create.py")
+ (delete-file "tests/test_export.py")
+ (delete-file "tests/test_fetch.py")
+ (delete-file "tests/test_history.py")
+ (delete-file "tests/test_info.py")
+ (delete-file "tests/test_install.py")
+ (delete-file "tests/test_priority.py")
+ (delete-file "tests/conda_env/test_cli.py")
+ (delete-file "tests/conda_env/test_create.py")
+ (delete-file "tests/conda_env/specs/test_notebook.py")
+ (delete-file "tests/conda_env/utils/test_notebooks.py")
+ (delete-file "tests/core/test_index.py")
+ (delete-file "tests/core/test_repodata.py")
+ ;; This last test creates a file, then deletes it an
+ ;; tests that the file was deleted. For some reason
+ ;; it fails when building with guix, but does not when
+ ;; you run it in the directory left when you build with
+ ;; the --keep-failed option
+ (delete-file "tests/gateways/disk/test_delete.py")))
+ (replace 'check
+ (lambda* _
+ (and
+ (setenv "HOME" "/tmp")
+ (zero? (system* "py.test"))))))))
+ (home-page "https://github.com/conda/conda")
+ (synopsis
+ "Cross-platform, OS-agnostic, system-level binary package manager")
+ (description
+ "Conda is a cross-platform, Python-agnostic binary package manager. It is
+the package manager used by Anaconda installations, but it may be used for other
+systems as well. Conda makes environments first-class citizens, making it easy
+to create independent environments even for C libraries. Conda is written
+entirely in Python, and is BSD licensed open source.")
+ (license bsd-3)))
+
+(define-public python2-conda
+ (package-with-python2 python-conda))
--
2.13.2
M
M
Muriithi Frederick Muriuki wrote on 18 Jul 2017 10:37
[PATCH 5/5] gnu: Add conda
(address . 27637@debbugs.gnu.org)(address . mbakke@fastmail.com)
20170718083709.5062-5-fredmanglis@gmail.com
* gnu/packages/package-management.scm (conda): New variable.
---
gnu/packages/package-management.scm | 84 +++++++++++++++++++++++++++++++++++++
1 file changed, 84 insertions(+)

Toggle diff (94 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 3f106a65e..b30b8aff0 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -693,3 +693,87 @@ entirely in Python, and is BSD licensed open source.")
(define-public python2-conda
(package-with-python2 python-conda))
+
+(define-public conda
+ (package
+ (inherit python-conda)
+ (name "conda")
+ (version "4.3.16")
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build
+ 'create-version-file
+ (lambda* _
+ (let ((version-file (open-output-file "conda/.version")))
+ (display ,version version-file)
+ (close-output-port version-file)
+ #t)))
+ (replace 'build
+ (lambda* _
+ ;; the util/setup-testing.py is used to build conda in
+ ;; application form, rather than the default, library form.
+ ;; With this, we are able to run commands like `conda --help`
+ ;; directly on the command line
+ (zero? (system* "python" "utils/setup-testing.py" "bdist"))))
+ (add-before 'check
+ 'remove-failing-tests
+ (lambda* _
+ ;; these tests require internet/network access
+ (delete-file "tests/test_cli.py")
+ (delete-file "tests/test_create.py")
+ (delete-file "tests/test_export.py")
+ (delete-file "tests/test_fetch.py")
+ (delete-file "tests/test_history.py")
+ (delete-file "tests/test_info.py")
+ (delete-file "tests/test_install.py")
+ (delete-file "tests/test_priority.py")
+ (delete-file "tests/conda_env/test_cli.py")
+ (delete-file "tests/conda_env/test_create.py")
+ (delete-file "tests/conda_env/specs/test_notebook.py")
+ (delete-file "tests/conda_env/utils/test_notebooks.py")
+ (delete-file "tests/core/test_index.py")
+ (delete-file "tests/core/test_repodata.py")
+ ;; This last test creates a file, then deletes it an
+ ;; tests that the file was deleted. For some reason
+ ;; it fails when building with guix, but does not when
+ ;; you run it in the directory left when you build with
+ ;; the --keep-failed option
+ (delete-file "tests/gateways/disk/test_delete.py")))
+ (replace 'check
+ (lambda* _
+ (and
+ (setenv "HOME" "/tmp")
+ (zero? (system* "py.test")))))
+ (replace 'install
+ (lambda* (#:key outputs target (configure-flags '())
+ use-setup-tools? #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (main-dir (getcwd))
+ (build-dir (string-append main-dir "/build"))
+ (dist-dir (string-append main-dir "/dist"))
+ (dir-stream (opendir dist-dir))
+ (tar-file (let get-file ((stream dir-stream))
+ (let ((the-file ""))
+ (do ((file (readdir stream)
+ (readdir stream)))
+ ((eof-object? file))
+ (if (not (or
+ (equal? file ".")
+ (equal? file "..")))
+ (set! the-file file)))
+ the-file))))
+ (closedir dir-stream)
+ (chdir dist-dir)
+ ;; tar seems to be ignoring the -C option and at
+ ;; this point the path in the variable `out` does
+ ;; not seem to exist, hence the need for the hacky
+ ;; code that follows.
+ (mkdir "tmp")
+ (chdir "tmp")
+ (system* "tar" "-xvzf"
+ (string-append "../" tar-file)
+ "--strip-components=4")
+ (chdir "../")
+ (system* "cp" "-fvR" "tmp/" out)
+ (chdir main-dir)))))))))
--
2.13.2
P
P
Pjotr Prins wrote on 21 Jul 2017 07:44
Re: [bug#27637] [PATCH 1/5] gnu: Add python-pytz
(name . Muriithi Frederick Muriuki)(address . fredmanglis@gmail.com)(address . 27637@debbugs.gnu.org)
20170721054418.GA16795@thebird.nl
Definition LGTM. License is dual expat and ZPL (Zope). May want to add
that.

Part of the conda packaging effort. Please push if it is OK.

On Tue, Jul 18, 2017 at 11:37:05AM +0300, Muriithi Frederick Muriuki wrote:
Toggle quote (56 lines)
> * gnu/packages/package-management.scm (python-pytz, python2-pytz): New
> * variables.
> * Add expat license.
> ---
> gnu/packages/package-management.scm | 27 ++++++++++++++++++++++++++-
> 1 file changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
> index d2e30781b..e8a401f1c 100644
> --- a/gnu/packages/package-management.scm
> +++ b/gnu/packages/package-management.scm
> @@ -25,7 +25,7 @@
> #:use-module (guix utils)
> #:use-module (guix build-system gnu)
> #:use-module (guix build-system python)
> - #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0))
> + #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0 expat))
> #:use-module (gnu packages)
> #:use-module (gnu packages guile)
> #:use-module (gnu packages file)
> @@ -516,3 +516,28 @@ different. It recursively unpacks archives of many kinds and transforms
> various binary formats into more human readable forms to compare them. It can
> compare two tarballs, ISO images, or PDFs just as easily.")
> (license gpl3+)))
> +
> +(define-public python-pytz
> + (package
> + (name "python-pytz")
> + (version "2017.2")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "pytz" version ".zip"))
> + (sha256
> + (base32
> + "12cmd3j46d2gcw08bspvp6s9icfcvx88zjz52n1bli9dyvl5dh7m"))))
> + (build-system python-build-system)
> + (native-inputs
> + `(("unzip" ,unzip)))
> + (home-page "http://pythonhosted.org/pytz")
> + (synopsis "World timezone definitions, modern and historical")
> + (description "This library brings the Olson tz database into Python. It
> +allows accurate and cross platform timezone calculations using Python 2.4 or
> +higher. It also solves the issue of ambiguous times at the end of daylight
> +saving time. Almost all of the Olson timezones are supported.")
> + (license expat)))
> +
> +(define-public python2-pytz
> + (package-with-python2 python-pytz))
> --
> 2.13.2
>
>
>
>

--
P
P
Pjotr Prins wrote on 21 Jul 2017 07:45
Re: [bug#27637] [PATCH 2/5] gnu: Add python-clyent
(name . Muriithi Frederick Muriuki)(address . fredmanglis@gmail.com)(address . 27637@debbugs.gnu.org)
20170721054515.GB16795@thebird.nl
LGTM. Part of the Conda packaging effort.

Please push.

On Tue, Jul 18, 2017 at 11:37:06AM +0300, Muriithi Frederick Muriuki wrote:
Toggle quote (54 lines)
> * gnu/packages/package-management.scm (python-clyent, python2-clyent):
> * New variables.
> * Add bsd-3 license.
> ---
> gnu/packages/package-management.scm | 25 ++++++++++++++++++++++++-
> 1 file changed, 24 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
> index e8a401f1c..0c0b780ad 100644
> --- a/gnu/packages/package-management.scm
> +++ b/gnu/packages/package-management.scm
> @@ -25,7 +25,7 @@
> #:use-module (guix utils)
> #:use-module (guix build-system gnu)
> #:use-module (guix build-system python)
> - #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0 expat))
> + #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0 expat bsd-3))
> #:use-module (gnu packages)
> #:use-module (gnu packages guile)
> #:use-module (gnu packages file)
> @@ -541,3 +541,26 @@ saving time. Almost all of the Olson timezones are supported.")
>
> (define-public python2-pytz
> (package-with-python2 python-pytz))
> +
> +(define-public python-clyent
> + (package
> + (name "python-clyent")
> + (version "1.2.1")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "clyent" version))
> + (sha256
> + (base32
> + "1r9987qmy1pz3hq54160bapqsywpq14waw4w9x3ly8hmq7kpgfbj"))))
> + (build-system python-build-system)
> + (native-inputs
> + `(("python-mock" ,python-mock)))
> + (home-page "https://github.com/binstar/clyent")
> + (synopsis "Command line client Library for windows and posix")
> + (description "Clyent is a python command line utiliy library for
> +@code{binstar}, @code{binstar-build} and @code{chalmers}.")
> + (license bsd-3)))
> +
> +(define-public python2-clyent
> + (package-with-python2 python-clyent))
> --
> 2.13.2
>
>
>
>

--
P
P
Pjotr Prins wrote on 21 Jul 2017 07:45
Re: [bug#27637] [PATCH 3/5] gnu: Add python-anaconda-client
(name . Muriithi Frederick Muriuki)(address . fredmanglis@gmail.com)(address . 27637@debbugs.gnu.org)
20170721054559.GC16795@thebird.nl
LGTM

On Tue, Jul 18, 2017 at 11:37:07AM +0300, Muriithi Frederick Muriuki wrote:
Toggle quote (75 lines)
> * gnu/packages/package-management.scm (python-anaconda-client,
> * python2-anaconda-client): New variables.
> ---
> gnu/packages/package-management.scm | 54 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
>
> diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
> index 0c0b780ad..a16a49bd0 100644
> --- a/gnu/packages/package-management.scm
> +++ b/gnu/packages/package-management.scm
> @@ -564,3 +564,57 @@ saving time. Almost all of the Olson timezones are supported.")
>
> (define-public python2-clyent
> (package-with-python2 python-clyent))
> +
> +(define-public python-anaconda-client
> + (package
> + (name "python-anaconda-client")
> + (version "1.6.3")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (string-append
> + "https://github.com/Anaconda-Platform/anaconda-client/archive/"
> + version ".tar.gz"))
> + (sha256
> + (base32
> + "1wv4wi6k5jz7rlwfgvgfdizv77x3cr1wa2aj0k1595g7fbhkjhz2"))))
> + (build-system python-build-system)
> + (propagated-inputs
> + `(("python-pyyaml" ,python-pyyaml)
> + ("python-requests" ,python-requests)
> + ("python-clyent" ,python-clyent)))
> + (native-inputs
> + `(("python-pytz" ,python-pytz)
> + ("python-dateutil" ,python-dateutil)
> + ("python-mock" ,python-mock)
> + ("python-coverage" ,python-coverage)
> + ("python-pillow" ,python-pillow)))
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (add-before 'check
> + 'set-up-home
> + (lambda* _
> + (setenv "HOME" "/tmp")))
> + (add-before 'check
> + 'remove-network-tests
> + (lambda* _
> + ;; Remove tests requiring a network connection
> + (delete-file "binstar_client/tests/test_upload.py")
> + (delete-file "binstar_client/tests/test_authorizations.py")
> + (delete-file "binstar_client/tests/test_login.py")
> + (delete-file "binstar_client/tests/test_whoami.py")
> + (delete-file "binstar_client/utils/notebook/tests/test_data_uri.py")
> + (delete-file "binstar_client/utils/notebook/tests/test_base.py")
> + (delete-file "binstar_client/utils/notebook/tests/test_downloader.py")
> + (delete-file "binstar_client/inspect_package/tests/test_conda.py"))))))
> + (home-page "https://github.com/Anaconda-Platform/anaconda-client")
> + (synopsis "Anaconda Cloud command line client library")
> + (description
> + "Anaconda Cloud command line client library provides an interface to
> +Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
> +environments.")
> + (license bsd-3)))
> +
> +(define-public python2-anaconda-client
> + (package-with-python2 python-anaconda-client))
> --
> 2.13.2
>
>
>
>

--
P
P
Pjotr Prins wrote on 21 Jul 2017 07:46
Re: [bug#27637] [PATCH 4/5] gnu: Add python-conda
(name . Muriithi Frederick Muriuki)(address . fredmanglis@gmail.com)(address . 27637@debbugs.gnu.org)
20170721054654.GD16795@thebird.nl
LGTM.

On Tue, Jul 18, 2017 at 11:37:08AM +0300, Muriithi Frederick Muriuki wrote:
Toggle quote (104 lines)
> * gnu/packages/package-management.scm (python-conda, python2-conda): New
> * variables.
> * Add module (gnu packages serialization).
> ---
> gnu/packages/package-management.scm | 75 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 75 insertions(+)
>
> diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
> index a16a49bd0..3f106a65e 100644
> --- a/gnu/packages/package-management.scm
> +++ b/gnu/packages/package-management.scm
> @@ -52,6 +52,7 @@
> #:use-module (gnu packages tls)
> #:use-module (gnu packages ssh)
> #:use-module (gnu packages vim)
> + #:use-module (gnu packages serialization)
> #:use-module (srfi srfi-1)
> #:use-module (ice-9 match))
>
> @@ -618,3 +619,77 @@ environments.")
>
> (define-public python2-anaconda-client
> (package-with-python2 python-anaconda-client))
> +
> +(define-public python-conda
> + (package
> + (name "python-conda")
> + (version "4.3.16")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (string-append "https://github.com/conda/conda/archive/"
> + version ".tar.gz"))
> + (sha256
> + (base32
> + "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
> + (build-system python-build-system)
> + (native-inputs
> + `(("python-ruamel.yaml" ,python-ruamel.yaml)
> + ("python-requests" ,python-requests)
> + ("python-pycosat" ,python-pycosat)
> + ("python-pytest" ,python-pytest)
> + ("python-responses" ,python-responses)
> + ("python-pyyaml" ,python-pyyaml)
> + ("python-anaconda-client" ,python-anaconda-client)))
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (add-before 'build
> + 'create-version-file
> + (lambda* _
> + (let ((version-file (open-output-file "conda/.version")))
> + (display ,version version-file)
> + (close-output-port version-file)
> + #t)))
> + (add-before 'check
> + 'remove-failing-tests
> + (lambda* _
> + ;; these tests require internet/network access
> + (delete-file "tests/test_cli.py")
> + (delete-file "tests/test_create.py")
> + (delete-file "tests/test_export.py")
> + (delete-file "tests/test_fetch.py")
> + (delete-file "tests/test_history.py")
> + (delete-file "tests/test_info.py")
> + (delete-file "tests/test_install.py")
> + (delete-file "tests/test_priority.py")
> + (delete-file "tests/conda_env/test_cli.py")
> + (delete-file "tests/conda_env/test_create.py")
> + (delete-file "tests/conda_env/specs/test_notebook.py")
> + (delete-file "tests/conda_env/utils/test_notebooks.py")
> + (delete-file "tests/core/test_index.py")
> + (delete-file "tests/core/test_repodata.py")
> + ;; This last test creates a file, then deletes it an
> + ;; tests that the file was deleted. For some reason
> + ;; it fails when building with guix, but does not when
> + ;; you run it in the directory left when you build with
> + ;; the --keep-failed option
> + (delete-file "tests/gateways/disk/test_delete.py")))
> + (replace 'check
> + (lambda* _
> + (and
> + (setenv "HOME" "/tmp")
> + (zero? (system* "py.test"))))))))
> + (home-page "https://github.com/conda/conda")
> + (synopsis
> + "Cross-platform, OS-agnostic, system-level binary package manager")
> + (description
> + "Conda is a cross-platform, Python-agnostic binary package manager. It is
> +the package manager used by Anaconda installations, but it may be used for other
> +systems as well. Conda makes environments first-class citizens, making it easy
> +to create independent environments even for C libraries. Conda is written
> +entirely in Python, and is BSD licensed open source.")
> + (license bsd-3)))
> +
> +(define-public python2-conda
> + (package-with-python2 python-conda))
> --
> 2.13.2
>
>
>
>

--
P
P
Pjotr Prins wrote on 21 Jul 2017 07:48
Re: [bug#27637] [PATCH 5/5] gnu: Add conda
(name . Muriithi Frederick Muriuki)(address . fredmanglis@gmail.com)(address . 27637@debbugs.gnu.org)
20170721054858.GE16795@thebird.nl
Thanks Fred.

Can someone take a look at the tar issue?

If there are no objections, please push.

On Tue, Jul 18, 2017 at 11:37:09AM +0300, Muriithi Frederick Muriuki wrote:
Toggle quote (104 lines)
> * gnu/packages/package-management.scm (conda): New variable.
> ---
> gnu/packages/package-management.scm | 84 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 84 insertions(+)
>
> diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
> index 3f106a65e..b30b8aff0 100644
> --- a/gnu/packages/package-management.scm
> +++ b/gnu/packages/package-management.scm
> @@ -693,3 +693,87 @@ entirely in Python, and is BSD licensed open source.")
>
> (define-public python2-conda
> (package-with-python2 python-conda))
> +
> +(define-public conda
> + (package
> + (inherit python-conda)
> + (name "conda")
> + (version "4.3.16")
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (add-before 'build
> + 'create-version-file
> + (lambda* _
> + (let ((version-file (open-output-file "conda/.version")))
> + (display ,version version-file)
> + (close-output-port version-file)
> + #t)))
> + (replace 'build
> + (lambda* _
> + ;; the util/setup-testing.py is used to build conda in
> + ;; application form, rather than the default, library form.
> + ;; With this, we are able to run commands like `conda --help`
> + ;; directly on the command line
> + (zero? (system* "python" "utils/setup-testing.py" "bdist"))))
> + (add-before 'check
> + 'remove-failing-tests
> + (lambda* _
> + ;; these tests require internet/network access
> + (delete-file "tests/test_cli.py")
> + (delete-file "tests/test_create.py")
> + (delete-file "tests/test_export.py")
> + (delete-file "tests/test_fetch.py")
> + (delete-file "tests/test_history.py")
> + (delete-file "tests/test_info.py")
> + (delete-file "tests/test_install.py")
> + (delete-file "tests/test_priority.py")
> + (delete-file "tests/conda_env/test_cli.py")
> + (delete-file "tests/conda_env/test_create.py")
> + (delete-file "tests/conda_env/specs/test_notebook.py")
> + (delete-file "tests/conda_env/utils/test_notebooks.py")
> + (delete-file "tests/core/test_index.py")
> + (delete-file "tests/core/test_repodata.py")
> + ;; This last test creates a file, then deletes it an
> + ;; tests that the file was deleted. For some reason
> + ;; it fails when building with guix, but does not when
> + ;; you run it in the directory left when you build with
> + ;; the --keep-failed option
> + (delete-file "tests/gateways/disk/test_delete.py")))
> + (replace 'check
> + (lambda* _
> + (and
> + (setenv "HOME" "/tmp")
> + (zero? (system* "py.test")))))
> + (replace 'install
> + (lambda* (#:key outputs target (configure-flags '())
> + use-setup-tools? #:allow-other-keys)
> + (let* ((out (assoc-ref outputs "out"))
> + (main-dir (getcwd))
> + (build-dir (string-append main-dir "/build"))
> + (dist-dir (string-append main-dir "/dist"))
> + (dir-stream (opendir dist-dir))
> + (tar-file (let get-file ((stream dir-stream))
> + (let ((the-file ""))
> + (do ((file (readdir stream)
> + (readdir stream)))
> + ((eof-object? file))
> + (if (not (or
> + (equal? file ".")
> + (equal? file "..")))
> + (set! the-file file)))
> + the-file))))
> + (closedir dir-stream)
> + (chdir dist-dir)
> + ;; tar seems to be ignoring the -C option and at
> + ;; this point the path in the variable `out` does
> + ;; not seem to exist, hence the need for the hacky
> + ;; code that follows.
> + (mkdir "tmp")
> + (chdir "tmp")
> + (system* "tar" "-xvzf"
> + (string-append "../" tar-file)
> + "--strip-components=4")
> + (chdir "../")
> + (system* "cp" "-fvR" "tmp/" out)
> + (chdir main-dir)))))))))
> --
> 2.13.2
>
>
>
>

--
R
R
Ricardo Wurmus wrote on 22 Jul 2017 10:39
(name . Pjotr Prins)(address . pjotr.public12@thebird.nl)
87inikamru.fsf@elephly.net
Pjotr Prins <pjotr.public12@thebird.nl> writes:

Toggle quote (4 lines)
> Thanks Fred.
>
> Can someone take a look at the tar issue?

The tar thing really looks odd. I’m ready to push the patches leading
up to this one. I still need to experiment a bit to avoid this
complicated install phase.

Thanks, Fred, for working on this!

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
R
R
Ricardo Wurmus wrote on 22 Jul 2017 11:49
(name . Pjotr Prins)(address . pjotr.public12@thebird.nl)
87h8y4ajj3.fsf@elephly.net
Ricardo Wurmus <rekado@elephly.net> writes:

Toggle quote (10 lines)
> Pjotr Prins <pjotr.public12@thebird.nl> writes:
>
>> Thanks Fred.
>>
>> Can someone take a look at the tar issue?
>
> The tar thing really looks odd. I’m ready to push the patches leading
> up to this one. I still need to experiment a bit to avoid this
> complicated install phase.

I fixed this, but conda still has errors; it tries to write to the
store:

Toggle snippet (84 lines)
/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/bin/conda install samtools
Fetching package metadata ...An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

https://github.com/conda/conda/issues



Current conda install:

platform : linux-64
conda version : 4.3.16
conda is private : False
conda-env version : 4.3.16
conda-build version : not installed
python version : 3.5.3.final.0
requests version : 2.13.0
root environment : /gnu/store/yd655bpcqrzch4ai1dhs7v39yhm70mdi-python-3.5.3 (read only)
default environment : /gnu/store/yd655bpcqrzch4ai1dhs7v39yhm70mdi-python-3.5.3
envs directories : /home/rekado/.conda/envs
/gnu/store/yd655bpcqrzch4ai1dhs7v39yhm70mdi-python-3.5.3/envs
package cache : /gnu/store/yd655bpcqrzch4ai1dhs7v39yhm70mdi-python-3.5.3/pkgs
/home/rekado/.conda/pkgs
channel URLs : https://repo.continuum.io/pkgs/free/linux-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/linux-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/linux-64
https://repo.continuum.io/pkgs/pro/noarch
config file : None
offline mode : False
user-agent : conda/4.3.16 requests/2.13.0 CPython/3.5.3 Linux/4.1.42-gnu / glibc/2.25
UID:GID : 1000:1000



`$ /gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/bin/.conda-real install samtools`




Traceback (most recent call last):
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/exceptions.py", line 626, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/cli/main.py", line 134, in _main
exit_code = args.func(args, p)
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/cli/main_install.py", line 80, in execute
install(args, parser, 'install')
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/cli/install.py", line 221, in install
unknown=index_args['unknown'], prefix=prefix)
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/index.py", line 92, in get_index
index = fetch_index(channel_priority_map, use_cache=use_cache)
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/index.py", line 111, in fetch_index
repodatas = collect_all_repodata(use_cache, tasks)
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/repodata.py", line 74, in collect_all_repodata
repodatas = _collect_repodatas_serial(use_cache, tasks)
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/repodata.py", line 463, in _collect_repodatas_serial
for url, schan, pri in tasks]
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/repodata.py", line 463, in <listcomp>
for url, schan, pri in tasks]
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/repodata.py", line 109, in func
res = f(*args, **kwargs)
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/repodata.py", line 409, in fetch_repodata
cache_path = join(cache_dir or create_cache_dir(), cache_fn_url(url))
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/repodata.py", line 497, in create_cache_dir
cache_dir = join(PackageCache.first_writable(context.pkgs_dirs).pkgs_dir, 'cache')
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/package_cache.py", line 169, in first_writable
return cls.all_writable(pkgs_dirs)[0]
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/package_cache.py", line 176, in all_writable
(PackageCache(pd) for pd in pkgs_dirs)))
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/package_cache.py", line 175, in <lambda>
writable_caches = tuple(filter(lambda c: c.is_writable,
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/core/package_cache.py", line 316, in is_writable
self._is_writable = create_package_cache_directory(self.pkgs_dir)
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/gateways/disk/create.py", line 302, in create_package_cache_directory
mkdir_p(pkgs_dir)
File "/gnu/store/pwl68nzl6s3papdx98hx997iij10r3sn-conda-4.3.16/lib/python3.5/site-packages/conda-4.3.16-py3.5.egg/conda/gateways/disk/create.py", line 160, in mkdir_p
makedirs(path)
File "/gnu/store/yd655bpcqrzch4ai1dhs7v39yhm70mdi-python-3.5.3/lib/python3.5/os.py", line 241, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/gnu/store/yd655bpcqrzch4ai1dhs7v39yhm70mdi-python-3.5.3/pkgs'

Wherever it says “/gnu/store/yd655bpcqrzch4ai1dhs7v39yhm70mdi-python-3.5.3/” we should provide sane
defaults.

@Fred: could you please look into this? This may require patching the
conda sources.

I’m marking this bug done now, because Conda is now in the repository.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
Closed
R
R
Ricardo Wurmus wrote on 22 Jul 2017 12:27
(name . Pjotr Prins)(address . pjotr.public12@thebird.nl)
87eft8ahqy.fsf@elephly.net
Ricardo Wurmus <rekado@elephly.net> writes:

Toggle quote (21 lines)
> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> Pjotr Prins <pjotr.public12@thebird.nl> writes:
>>
>>> Thanks Fred.
>>>
>>> Can someone take a look at the tar issue?
>>
>> The tar thing really looks odd. I’m ready to push the patches leading
>> up to this one. I still need to experiment a bit to avoid this
>> complicated install phase.
>
> I fixed this, but conda still has errors; it tries to write to the
> store: […]
>
> Wherever it says “/gnu/store/yd655bpcqrzch4ai1dhs7v39yhm70mdi-python-3.5.3/” we should provide sane
> defaults.
>
> @Fred: could you please look into this? This may require patching the
> conda sources.

Never mind. It bothered me so I fixed it with some additional patching.
Thanks again for your efforts in getting it packaged!
--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
Closed
P
P
Pjotr Prins wrote on 22 Jul 2017 23:07
(name . Ricardo Wurmus)(address . rekado@elephly.net)
20170722210718.GA29565@thebird.nl
Thanks Ricardo!
Closed
?