unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Giacomo Leidi <goodoldpaul@autistici.org>
To: 49834@debbugs.gnu.org
Cc: Giacomo Leidi <goodoldpaul@autistici.org>
Subject: [bug#49834] [PATCH 6/6] gnu: Add dynaconf.
Date: Sat, 28 Aug 2021 13:51:53 +0200	[thread overview]
Message-ID: <20210828115153.5607-6-goodoldpaul@autistici.org> (raw)
In-Reply-To: <20210828115153.5607-1-goodoldpaul@autistici.org>

* gnu/packages/python-xyz.scm (python-colorama-0.4.1): New variable,
(python-dotenv-0.13.0): New variable,
(dynaconf): New variable.
 * gnu/packages/patches/dynaconf-Unvendor-dependencies.patch: New file.
* local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                  |   1 +
 .../dynaconf-Unvendor-dependencies.patch      | 161 ++++++++++++++++++
 gnu/packages/python-xyz.scm                   |  94 ++++++++++
 3 files changed, 256 insertions(+)
 create mode 100644 gnu/packages/patches/dynaconf-Unvendor-dependencies.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 14cd1cc6ad..4e76b5a2b3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -977,6 +977,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/dstat-skip-devices-without-io.patch	\
   %D%/packages/patches/dune-istl-2.7-fix-non-mpi-tests.patch	\
   %D%/packages/patches/dvd+rw-tools-add-include.patch 		\
+  %D%/packages/patches/dynaconf-Unvendor-dependencies.patch 		\
   %D%/packages/patches/ecl-16-format-directive-limit.patch	\
   %D%/packages/patches/ecl-16-ignore-stderr-write-error.patch	\
   %D%/packages/patches/ecl-16-libffi.patch			\
diff --git a/gnu/packages/patches/dynaconf-Unvendor-dependencies.patch b/gnu/packages/patches/dynaconf-Unvendor-dependencies.patch
new file mode 100644
index 0000000000..10b72d5013
--- /dev/null
+++ b/gnu/packages/patches/dynaconf-Unvendor-dependencies.patch
@@ -0,0 +1,161 @@
+From 3558d30d5916ec6a91ce0d9c201ff9a11675d7c3 Mon Sep 17 00:00:00 2001
+From: Giacomo Leidi <goodoldpaul@autistici.org>
+Date: Mon, 2 Aug 2021 19:29:07 +0200
+Subject: [PATCH] Use system dependencies.
+
+Box was not unvendored because it appears to be heavily patched.
+---
+ dynaconf/cli.py                   | 4 ++--
+ dynaconf/default_settings.py      | 2 +-
+ dynaconf/loaders/env_loader.py    | 2 +-
+ dynaconf/loaders/toml_loader.py   | 2 +-
+ dynaconf/loaders/yaml_loader.py   | 2 +-
+ dynaconf/utils/parse_conf.py      | 2 +-
+ dynaconf/vendor/box/converters.py | 6 +++---
+ dynaconf/vendor/box/from_file.py  | 6 +++---
+ tests/test_cli.py                 | 2 +-
+ 9 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/dynaconf/cli.py b/dynaconf/cli.py
+index 2d45e52..7df767a 100644
+--- a/dynaconf/cli.py
++++ b/dynaconf/cli.py
+@@ -20,8 +20,8 @@ from dynaconf.utils.functional import empty
+ from dynaconf.utils.parse_conf import parse_conf_data
+ from dynaconf.validator import ValidationError
+ from dynaconf.validator import Validator
+-from dynaconf.vendor import click
+-from dynaconf.vendor import toml
++import click
++import toml
+ 
+ 
+ CWD = Path.cwd()
+diff --git a/dynaconf/default_settings.py b/dynaconf/default_settings.py
+index 66601b0..9605fc5 100644
+--- a/dynaconf/default_settings.py
++++ b/dynaconf/default_settings.py
+@@ -8,7 +8,7 @@ from dynaconf.utils import upperfy
+ from dynaconf.utils import warn_deprecations
+ from dynaconf.utils.files import find_file
+ from dynaconf.utils.parse_conf import parse_conf_data
+-from dynaconf.vendor.dotenv import load_dotenv
++from dotenv import load_dotenv
+ 
+ 
+ def try_renamed(key, value, older_key, current_key):
+diff --git a/dynaconf/loaders/env_loader.py b/dynaconf/loaders/env_loader.py
+index e7b13bd..b034c8a 100644
+--- a/dynaconf/loaders/env_loader.py
++++ b/dynaconf/loaders/env_loader.py
+@@ -2,7 +2,7 @@ from os import environ
+ 
+ from dynaconf.utils import upperfy
+ from dynaconf.utils.parse_conf import parse_conf_data
+-from dynaconf.vendor.dotenv import cli as dotenv_cli
++from dotenv import cli as dotenv_cli
+ 
+ 
+ IDENTIFIER = "env"
+diff --git a/dynaconf/loaders/toml_loader.py b/dynaconf/loaders/toml_loader.py
+index 07b973f..d81d675 100644
+--- a/dynaconf/loaders/toml_loader.py
++++ b/dynaconf/loaders/toml_loader.py
+@@ -5,7 +5,7 @@ from dynaconf import default_settings
+ from dynaconf.constants import TOML_EXTENSIONS
+ from dynaconf.loaders.base import BaseLoader
+ from dynaconf.utils import object_merge
+-from dynaconf.vendor import toml
++import toml
+ 
+ 
+ def load(obj, env=None, silent=True, key=None, filename=None):
+diff --git a/dynaconf/loaders/yaml_loader.py b/dynaconf/loaders/yaml_loader.py
+index 33c6532..3ef419a 100644
+--- a/dynaconf/loaders/yaml_loader.py
++++ b/dynaconf/loaders/yaml_loader.py
+@@ -7,7 +7,7 @@ from dynaconf.constants import YAML_EXTENSIONS
+ from dynaconf.loaders.base import BaseLoader
+ from dynaconf.utils import object_merge
+ from dynaconf.utils.parse_conf import try_to_encode
+-from dynaconf.vendor.ruamel import yaml
++from ruamel import yaml
+ 
+ # Add support for Dynaconf Lazy values to YAML dumper
+ yaml.SafeDumper.yaml_representers[
+diff --git a/dynaconf/utils/parse_conf.py b/dynaconf/utils/parse_conf.py
+index 5fc8234..6509c35 100644
+--- a/dynaconf/utils/parse_conf.py
++++ b/dynaconf/utils/parse_conf.py
+@@ -8,7 +8,7 @@ from dynaconf.utils import extract_json_objects
+ from dynaconf.utils import multi_replace
+ from dynaconf.utils import recursively_evaluate_lazy_format
+ from dynaconf.utils.boxing import DynaBox
+-from dynaconf.vendor import toml
++import toml
+ 
+ try:
+     from jinja2 import Environment
+diff --git a/dynaconf/vendor/box/converters.py b/dynaconf/vendor/box/converters.py
+index 93cdcfb..c81877a 100644
+--- a/dynaconf/vendor/box/converters.py
++++ b/dynaconf/vendor/box/converters.py
+@@ -7,9 +7,9 @@ _B='utf-8'
+ _A=None
+ import csv,json,sys,warnings
+ from pathlib import Path
+-import dynaconf.vendor.ruamel.yaml as yaml
++import ruamel.yaml as yaml
+ from dynaconf.vendor.box.exceptions import BoxError,BoxWarning
+-from dynaconf.vendor import toml
++import toml
+ BOX_PARAMETERS='default_box','default_box_attr','conversion_box','frozen_box','camel_killer_box','box_safe_prefix','box_duplicates','ordered_box','default_box_none_transform','box_dots','modify_tuples_box','box_intact_types','box_recast'
+ def _exists(filename,create=_E):
+ 	A=filename;B=Path(A)
+@@ -75,4 +75,4 @@ def _to_csv(box_list,filename,encoding=_B,errors=_C):
+ 			for G in A:D.writerow(G)
+ def _from_csv(filename,encoding=_B,errors=_C):
+ 	A=filename;_exists(A)
+-	with open(A,_G,encoding=encoding,errors=errors,newline='')as B:C=csv.DictReader(B);return[A for A in C]
+\ No newline at end of file
++	with open(A,_G,encoding=encoding,errors=errors,newline='')as B:C=csv.DictReader(B);return[A for A in C]
+diff --git a/dynaconf/vendor/box/from_file.py b/dynaconf/vendor/box/from_file.py
+index daa1137..4a2739d 100644
+--- a/dynaconf/vendor/box/from_file.py
++++ b/dynaconf/vendor/box/from_file.py
+@@ -1,8 +1,8 @@
+ from json import JSONDecodeError
+ from pathlib import Path
+ from typing import Union
+-from dynaconf.vendor.toml import TomlDecodeError
+-from dynaconf.vendor.ruamel.yaml import YAMLError
++from toml import TomlDecodeError
++from ruamel.yaml import YAMLError
+ from .exceptions import BoxError
+ from .box import Box
+ from .box_list import BoxList
+@@ -31,4 +31,4 @@ def box_from_file(file,file_type=None,encoding='utf-8',errors='strict'):
+ 	if A.suffix in('.json','.jsn'):return _to_json(B)
+ 	if A.suffix in('.yaml','.yml'):return _to_yaml(B)
+ 	if A.suffix in('.tml','.toml'):return _to_toml(B)
+-	raise BoxError(f"Could not determine file type based off extension, please provide file_type")
+\ No newline at end of file
++	raise BoxError(f"Could not determine file type based off extension, please provide file_type")
+diff --git a/tests/test_cli.py b/tests/test_cli.py
+index 9338851..726b009 100644
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -11,7 +11,7 @@ from dynaconf.cli import main
+ from dynaconf.cli import read_file_in_root_directory
+ from dynaconf.cli import WRITERS
+ from dynaconf.utils.files import read_file
+-from dynaconf.vendor.click.testing import CliRunner
++from click.testing import CliRunner
+ 
+ 
+ runner = CliRunner()
+
+base-commit: 952e713353356ea701196ac5ad204c72fd097e58
+-- 
+2.32.0
+
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index afece6381c..e938d27444 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -137,6 +137,7 @@
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dbm)
+  #:use-module (gnu packages django)
   #:use-module (gnu packages djvu)
   #:use-module (gnu packages docker)
   #:use-module (gnu packages enchant)
@@ -12448,6 +12449,16 @@ text.")
    (home-page "https://pypi.org/project/colorama/")
    (license license:bsd-3)))
 
+(define-public python-colorama-0.4.1
+  (package (inherit python-colorama)
+    (version "0.4.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "colorama" version))
+       (sha256
+        (base32 "0ba247bx5pc60hcpbf3rjsqk0whilg241i9qdfnlcwij5qgdgvh5"))))))
+
 (define-public python2-colorama
   (package-with-python2 python-colorama))
 
@@ -26350,6 +26361,18 @@ graph can be output for rendering by GraphViz or yEd.")
 read key-value pairs from a .env file and set them as environment variables")
     (license license:bsd-3)))
 
+(define-public python-dotenv-0.13.0
+  (package (inherit python-dotenv)
+    (name "python-dotenv")
+    (version "0.13.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-dotenv" version))
+       (sha256
+        (base32
+         "0x5dagmfn31phrbxlwacw3s4w5vibv8fxqc62nqcdvdhjsy0k69v"))))))
+
 (define-public python-box
   (package
     (name "python-box")
@@ -26373,3 +26396,74 @@ read key-value pairs from a .env file and set them as environment variables")
      "This package provides the @code{python-box} Python module.
 It implements advanced Python dictionaries with dot notation access.")
     (license license:expat)))
+
+(define-public dynaconf
+  (package
+    (name "dynaconf")
+    (version "3.1.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/rochacbruno/dynaconf")
+         (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0dafd7hb691g6s3yjfvl5gph5md73n6g9j44kjpbnbbilr5pc85g"))
+       (patches (search-patches "dynaconf-Unvendor-dependencies.patch"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Remove vendored dependencies
+                   (let ((unvendor '("click" "dotenv" "ruamel" "toml")))
+                     (with-directory-excursion "dynaconf/vendor"
+                       (for-each delete-file-recursively unvendor))
+                     (with-directory-excursion "dynaconf/vendor_src"
+                       (for-each delete-file-recursively unvendor)))))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? outputs #:allow-other-keys)
+             (when tests?
+               (setenv "PATH"
+                       (string-append (assoc-ref outputs "out") "/bin:"
+                                      (getenv "PATH")))
+               ;; These tests depend on hvac and a
+               ;; live Vault process.
+               (delete-file "tests/test_vault.py")
+               (invoke "make" "test_only"))
+             #t)))))
+    (propagated-inputs
+     `(("python-click" ,python-click)
+       ("python-dotenv" ,python-dotenv-0.13.0)
+       ("python-ruamel.yaml" ,python-ruamel.yaml)
+       ("python-toml" ,python-toml)))
+    (native-inputs
+     `(("make" ,gnu-make)
+       ("python-codecov" ,python-codecov)
+       ("python-configobj" ,python-configobj)
+       ("python-colorama" ,python-colorama-0.4.1)
+       ("python-django" ,python-django)
+       ("python-flake8" ,python-flake8)
+       ("python-flake8-print" ,python-flake8-print)
+       ("python-flake8-todo" ,python-flake8-todo)
+       ("python-flask" ,python-flask)
+       ("python-future" ,python-future)
+       ("python-pep8-naming" ,python-pep8-naming)
+       ("python-pytest" ,python-pytest-6)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-forked" ,python-pytest-forked)
+       ("python-pytest-mock" ,python-pytest-mock)
+       ("python-pytest-xdist" ,python-pytest-xdist)
+       ("python-radon" ,python-radon)))
+    (home-page
+     "https://github.com/rochacbruno/dynaconf")
+    (synopsis
+     "The dynamic configurator for your Python Project")
+    (description
+     "This package provides @code{dynaconf} the dynamic configurator for
+your Python Project.")
+    (license license:expat)))
-- 
2.33.0





  parent reply	other threads:[~2021-08-28 11:55 UTC|newest]

Thread overview: 30+ 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   ` [bug#49281] Add dynaconf Sarah Morgensen
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   ` Giacomo Leidi [this message]
2021-08-28 22:46 ` [bug#49834] Add dynaconf 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

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=20210828115153.5607-6-goodoldpaul@autistici.org \
    --to=goodoldpaul@autistici.org \
    --cc=49834@debbugs.gnu.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).