Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the build reproducible by avoiding nondeterministic kwargs #800

Closed
wants to merge 1 commit into from

Conversation

lamby
Copy link

@lamby lamby commented Aug 19, 2016

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@chris-lamb.co.uk

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@chris-lamb.co.uk>
@codecov-io
Copy link

codecov-io commented Aug 19, 2016

Current coverage is 100% (diff: 100%)

Merging #800 into master will not change coverage

@@           master   #800   diff @@
====================================
  Files          15     15          
  Lines         601    604     +3   
  Methods         0      0          
  Messages        0      0          
  Branches        0      0          
====================================
+ Hits          601    604     +3   
  Misses          0      0          
  Partials        0      0          

Sunburst

Powered by Codecov. Last update 1edd107...0f5a5aa

@hackebrot
Copy link
Member

Hi @lamby! 👋

We do support this via --default-config, but can't do this via the Python API right now.

I've submitted a PR that shifts the check to main.cookiecutter.

Can you please have a look at #801 and let me know if that would work for you?

@hackebrot
Copy link
Member

How's the object() showing up as in the docs?

@lamby
Copy link
Author

lamby commented Aug 20, 2016

On my system, it appears as:

cookiecutter.config.get_user_config(config_file=<object object>)

(I may be using a newer Sphinx that you that strips memory addresses.)

@lamby
Copy link
Author

lamby commented Oct 24, 2016

Ping on this? :)

@lamby
Copy link
Author

lamby commented Nov 28, 2016

Another friendly ping on this? :)

@hackebrot
Copy link
Member

Closing in favor of #861 😄

@hackebrot hackebrot closed this Dec 8, 2016
hackebrot added a commit that referenced this pull request Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants