[Python-modules-commits] [cookiecutter] 02/12: merge patched into master

Vincent Bernat bernat at moszumanska.debian.org
Tue Oct 25 07:12:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

bernat pushed a commit to branch master
in repository cookiecutter.

commit 6276d5b986ea0817314159eec12ef067e30c5b3d
Merge: 6298a9d cc0a71f
Author: Vincent Bernat <bernat at debian.org>
Date:   Tue Oct 25 08:53:46 2016 +0200

    merge patched into master

 cookiecutter/config.py                             |  7 +-
 cookiecutter/main.py                               |  4 +-
 debian/.git-dpm                                    |  4 +-
 ...ild-reproducible-by-avoiding-nondetermini.patch | 81 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 5 files changed, 92 insertions(+), 5 deletions(-)

diff --cc debian/.git-dpm
index 22f8de6,0000000..786e3cf
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,11 -1,0 +1,11 @@@
 +# see git-dpm(1) from git-dpm package
- cfc9baee3a75ee9a55d074305970be0e222837a2
- cfc9baee3a75ee9a55d074305970be0e222837a2
++cc0a71fcdb9fcda5552eca0a7766c59fdda3ce34
++cc0a71fcdb9fcda5552eca0a7766c59fdda3ce34
 +2cff56151f5e99b0914d57e6202c4ce7abd84935
 +2cff56151f5e99b0914d57e6202c4ce7abd84935
 +cookiecutter_1.4.0.orig.tar.gz
 +b19b6fb4e912400514d2443be245536bc9cabfd5
 +226136
 +debianTag="debian/%e%v"
 +patchedTag="patched/%e%v"
 +upstreamTag="upstream/%e%u"
diff --cc debian/patches/0003-Make-the-build-reproducible-by-avoiding-nondetermini.patch
index 0000000,0000000..e8f5c82
new file mode 100644
--- /dev/null
+++ b/debian/patches/0003-Make-the-build-reproducible-by-avoiding-nondetermini.patch
@@@ -1,0 -1,0 +1,81 @@@
++From cc0a71fcdb9fcda5552eca0a7766c59fdda3ce34 Mon Sep 17 00:00:00 2001
++From: Chris Lamb <chris at chris-lamb.co.uk>
++Date: Sat, 20 Aug 2016 00:08:07 +0100
++Subject: Make the build reproducible by avoiding nondeterministic kwargs
++
++Whilst working on the Reproducible Builds effort [0], I noticed
++that cookiecutter could not be built reproducibly.
++
++As USER_CONFIG_PATH is pased on expanding ~ this varies between different
++systems, meaning that building the documentation on a different machine (or
++with a different $HOME) ends up with a different result:
++
++ - [..] config_file=u'/nonexistent/first-build/.cookiecutterrc' [..]
++ + [..] config_file=u'/nonexistent/second-build/.cookiecutterrc' [..]
++
++I would normally just change this to ``config_file=None`` and set it at
++runtime, but we need to be clever with NOT_PROVIDED to tell the difference
++between the case where we *actually* pass ``None`..
++
++ [0] https://reproducible-builds.org/
++
++Signed-off-by: Chris Lamb <chris at chris-lamb.co.uk>
++---
++ cookiecutter/config.py | 7 ++++++-
++ cookiecutter/main.py   | 4 ++--
++ 2 files changed, 8 insertions(+), 3 deletions(-)
++
++diff --git a/cookiecutter/config.py b/cookiecutter/config.py
++index af9e83c33f99..ff3556b691d3 100755
++--- a/cookiecutter/config.py
+++++ b/cookiecutter/config.py
++@@ -22,6 +22,7 @@ from .exceptions import InvalidConfiguration
++ 
++ logger = logging.getLogger(__name__)
++ 
+++NOT_PROVIDED = object()
++ USER_CONFIG_PATH = os.path.expanduser('~/.cookiecutterrc')
++ 
++ DEFAULT_CONFIG = {
++@@ -68,7 +69,7 @@ def get_config(config_path):
++     return config_dict
++ 
++ 
++-def get_user_config(config_file=USER_CONFIG_PATH):
+++def get_user_config(config_file=NOT_PROVIDED):
++     """Retrieve the config from a file or return the defaults if None is
++     passed. If an environment variable `COOKIECUTTER_CONFIG` is set up, try
++     to load its value. Otherwise fall back to a default file or config.
++@@ -77,6 +78,10 @@ def get_user_config(config_file=USER_CONFIG_PATH):
++     if config_file is None:
++         return copy.copy(DEFAULT_CONFIG)
++ 
+++    # Differentiate between being passed ``None`` and the default.
+++    if config_file is NOT_PROVIDED:
+++        config_file = USER_CONFIG_PATH
+++
++     # Load the given config file
++     if config_file and config_file is not USER_CONFIG_PATH:
++         return get_config(config_file)
++diff --git a/cookiecutter/main.py b/cookiecutter/main.py
++index d8ff7b6c7a7b..d94639854c40 100755
++--- a/cookiecutter/main.py
+++++ b/cookiecutter/main.py
++@@ -16,7 +16,7 @@ import logging
++ import os
++ import re
++ 
++-from .config import get_user_config, USER_CONFIG_PATH
+++from .config import get_user_config, USER_CONFIG_PATH, NOT_PROVIDED
++ from .exceptions import InvalidModeException, RepositoryNotFound
++ from .prompt import prompt_for_config
++ from .generate import generate_context, generate_files
++@@ -71,7 +71,7 @@ def expand_abbreviations(template, config_dict):
++ def cookiecutter(
++         template, checkout=None, no_input=False, extra_context=None,
++         replay=False, overwrite_if_exists=False, output_dir='.',
++-        config_file=USER_CONFIG_PATH):
+++        config_file=NOT_PROVIDED):
++     """
++     API equivalent to using Cookiecutter at the command line.
++ 
diff --cc debian/patches/series
index 1762e4a,0000000..bd1cce5
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,2 -1,0 +1,3 @@@
 +0001-Don-t-test-for-.DS_Store.patch
 +0002-Use-PyYAML-instead-of-poyo.patch
++0003-Make-the-build-reproducible-by-avoiding-nondetermini.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/cookiecutter.git



More information about the Python-modules-commits mailing list