unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Sarah Morgensen <iskarian@mgsn.dev>
To: Giacomo Leidi <goodoldpaul@autistici.org>
Cc: 49281@debbugs.gnu.org, 49833@debbugs.gnu.org
Subject: [bug#49281] Add dynaconf
Date: Wed, 04 Aug 2021 11:35:30 -0700	[thread overview]
Message-ID: <86fsvp2h3h.fsf_-_@mgsn.dev> (raw)
In-Reply-To: <20210802181359.10695-3-goodoldpaul@autistici.org> (Giacomo Leidi's message of "Mon, 2 Aug 2021 20:13:55 +0200")

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

Hello,

While we don't actually require doing this when pypi packages don't have
tests, on a lark I went ahead and switched the source to upstream and
enabled tests to make sure they passed. It looks like two are failing,
but I'm not sure why. I've attached the patch to enable tests and the
test output.

Giacomo Leidi <goodoldpaul@autistici.org> writes:

> * gnu/packages/python-xyz.scm (python-dotenv): New variable.
> ---
>  gnu/packages/python-xyz.scm | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index cdfc78478c..f415d8b2c8 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -26239,3 +26239,30 @@ enabling you to write CommonMark inside of Docutils & Sphinx projects.")
>  Qhull} for the computation of the convex hull, Delaunay triangulation, and
>  Voronoi diagram.")
>      (license license:expat)))
> +
> +(define-public python-dotenv
> +  (package
> +    (name "python-dotenv")
> +    (version "0.18.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (pypi-uri "python-dotenv" version))
> +       (sha256
> +        (base32
> +         "0b90br3f48ykx5ddfpx2zmsh4vmdqw6s812drcy9pn2q3qyarypg"))))
> +    (build-system python-build-system)
> +    (propagated-inputs
> +     `(("python-click" ,python-click-5)))
> +    (native-inputs
> +     `(("python-mock" ,python-mock)
> +       ("python-pytest" ,python-pytest)
> +       ("python-sh" ,python-sh)))
> +    (home-page
> +     "https://github.com/theskumar/python-dotenv")
       ^ Nitpick: this can go on one line.
> +    (synopsis
> +     "Setup environment variables according to .env files")
       ^ Likewise.
> +    (description
> +     "This package provides the @code{python-dotenv} Python module to
> +read key-value pairs from a .env file and set them as environment variables")
> +    (license license:bsd-3)))


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: python-dotenv-0.18.0-enable-tests.patch --]
[-- Type: text/x-patch, Size: 1493 bytes --]

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f4f3b7fb3f..a5b700f2d3 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26282,16 +26282,31 @@ Voronoi diagram.")
     (version "0.18.0")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "python-dotenv" version))
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/theskumar/python-dotenv")
+         (commit (string-append "v" version))))
        (sha256
         (base32
-         "0b90br3f48ykx5ddfpx2zmsh4vmdqw6s812drcy9pn2q3qyarypg"))))
+         "1jdccd9s7ypsldafiv0mqgh616662fm5a5ppbhphnin44qv7mir1"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+             (when tests?
+               (setenv "PATH"
+                       (string-append (assoc-ref outputs "out") "/bin:"
+                                      (getenv "PATH")))
+               (add-installed-pythonpath inputs outputs)
+               (invoke "py.test" "tests/")))))))
     (propagated-inputs
      `(("python-click" ,python-click-5)))
     (native-inputs
-     `(("python-mock" ,python-mock)
+     `(("python-ipython" ,python-ipython)
+       ("python-mock" ,python-mock)
        ("python-pytest" ,python-pytest)
        ("python-sh" ,python-sh)))
     (home-page

[-- Attachment #3: python-dotenv-0.18.0-tests.log --]
[-- Type: text/plain, Size: 2513 bytes --]

starting phase `check'
============================= test session starts ==============================
platform linux -- Python 3.8.2, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /tmp/guix-build-python-dotenv-0.18.0.drv-0/source, inifile: setup.cfg
plugins: hypothesis-5.4.1
collected 132 items

tests/test_cli.py ..F............F..........                             [ 19%]
tests/test_ipython.py ...                                                [ 21%]
tests/test_main.py ..................................................... [ 62%]
                                                                         [ 62%]
tests/test_parser.py ...........................................         [ 94%]
tests/test_utils.py .                                                    [ 95%]
tests/test_variables.py ......                                           [100%]

=================================== FAILURES ===================================
______________________________ test_list_no_file _______________________________

cli = <click.testing.CliRunner object at 0x7ffff5ed8100>

    def test_list_no_file(cli):
        result = cli.invoke(dotenv.cli.list, [])
    
>       assert (result.exit_code, result.output) == (1, "")
E       AssertionError: assert (-1, '') == (1, '')
E         At index 0 diff: -1 != 1
E         Use -v to get the full diff

tests/test_cli.py:31: AssertionError
__________________________ test_set_non_existent_file __________________________

cli = <click.testing.CliRunner object at 0x7ffff5f53cd0>

    def test_set_non_existent_file(cli):
        result = cli.invoke(dotenv.cli.set, ["a", "b"])
    
>       assert (result.exit_code, result.output) == (1, "")
E       AssertionError: assert (-1, '') == (1, '')
E         At index 0 diff: -1 != 1
E         Use -v to get the full diff

tests/test_cli.py:113: AssertionError
=============================== warnings summary ===============================
tests/test_ipython.py::test_ipython_existing_variable_no_override
tests/test_ipython.py::test_ipython_existing_variable_override
tests/test_ipython.py::test_ipython_new_variable
  /gnu/store/m6wza0kv26bnpfaavw8xs1gw2cls6369-python-ipython-7.9.0/lib/python3.8/site-packages/IPython/paths.py:67: UserWarning: IPython parent '/' is not a writable location, using a temp directory.
    warn("IPython parent '{0}' is not a writable location,"

-- Docs: https://docs.pytest.org/en/latest/warnings.html
================== 2 failed, 130 passed, 3 warnings in 4.49s ===================

[-- Attachment #4: Type: text/plain, Size: 10 bytes --]


--
Sarah

  reply	other threads:[~2021-08-04 18:36 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 18:13 [bug#49834] [PATCH 1/7] gnu: Add python-flake8-debugger Giacomo Leidi
2021-08-02 18:13 ` [bug#49830] [PATCH 2/7] gnu: Add python-flake8-todo Giacomo Leidi
2021-08-02 18:13 ` [bug#49833] [PATCH 3/7] gnu: Add python-dotenv Giacomo Leidi
2021-08-04 18:35   ` Sarah Morgensen [this message]
2021-08-02 18:13 ` [bug#49832] [PATCH 4/7] gnu: Add python-box Giacomo Leidi
2021-08-02 18:13 ` [bug#49829] [PATCH 5/7] gnu: python-ruamel.yaml: Update to 0.17.10 Giacomo Leidi
2021-08-02 18:13 ` [bug#49831] [PATCH 6/7] gnu: Add python-pep8-naming Giacomo Leidi
2021-08-02 18:13 ` [bug#49835] [PATCH 7/7] gnu: Add dynaconf Giacomo Leidi
2021-08-04 19:13   ` [bug#49281] " Sarah Morgensen
2021-08-04 18:26 ` Sarah Morgensen
2021-08-28 11:50   ` [bug#49834] " paul
2021-08-28 11:51 ` [bug#49834] [PATCH 1/6] gnu: Add python-flake8-todo Giacomo Leidi
2021-08-28 11:51   ` [bug#49834] [PATCH 2/6] gnu: Add python-dotenv Giacomo Leidi
2021-08-28 11:51   ` [bug#49834] [PATCH 3/6] gnu: Add python-box Giacomo Leidi
2021-08-28 11:51   ` [bug#49834] [PATCH 4/6] gnu: python-ruamel.yaml: Update to 0.17.10 Giacomo Leidi
2021-08-28 11:51   ` [bug#49834] [PATCH 5/6] gnu: Add python-pep8-naming Giacomo Leidi
2021-08-28 11:51   ` [bug#49834] [PATCH 6/6] gnu: Add dynaconf Giacomo Leidi
2021-08-28 22:46 ` [bug#49834] " Sarah Morgensen
2021-08-29 22:52   ` paul
2021-08-29 22:53 ` [bug#49834] [PATCH 1/4] gnu: Add python-dotenv Giacomo Leidi
2021-08-29 22:53   ` [bug#49834] [PATCH 2/4] gnu: python-ruamel.yaml: Update to 0.17.10 Giacomo Leidi
2021-08-29 22:53   ` [bug#49834] [PATCH 3/4] gnu: Add python-dotenv-0.13.0 Giacomo Leidi
2021-08-29 22:53   ` [bug#49834] [PATCH 4/4] gnu: Add dynaconf Giacomo Leidi
2021-10-07 22:49 ` [bug#49834] [PATCH 1/7] gnu: Add python-flake8-debugger paul
2021-11-19 23:40 ` [bug#49834] gnu: Add dynaconf paul via Guix-patches via
2021-12-01 11:59   ` bug#49834: " Efraim Flashner
2021-11-19 23:41 ` [bug#49834] [PATCH 1/4] gnu: Add python-dotenv Giacomo Leidi via Guix-patches via
2021-11-19 23:41   ` [bug#49834] [PATCH 2/4] gnu: python-ruamel.yaml: Update to 0.17.10 Giacomo Leidi via Guix-patches via
2021-11-19 23:41   ` [bug#49834] [PATCH 3/4] gnu: Add python-dotenv-0.13.0 Giacomo Leidi via Guix-patches via
2021-11-19 23:41   ` [bug#49834] [PATCH 4/4] gnu: Add dynaconf Giacomo Leidi via Guix-patches via
  -- strict thread matches above, loose matches on Subject: below --
2021-06-29 22:38 [bug#49281] " paul
2021-07-23  6:14 ` Sarah Morgensen
2021-08-02 18:13   ` paul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86fsvp2h3h.fsf_-_@mgsn.dev \
    --to=iskarian@mgsn.dev \
    --cc=49281@debbugs.gnu.org \
    --cc=49833@debbugs.gnu.org \
    --cc=goodoldpaul@autistici.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).