pypa / pipfile

Other
3.24k stars 145 forks source link

Import / include settings from other files by reference #85

Closed brianmhunt closed 7 years ago

brianmhunt commented 7 years ago

Putting common settings into a separate file and including them by reference can simplify config files, aid in clarity, and improve reusability.

A potential format might be e.g.

# Include everything
[[include]]
source = "../UseEverything"

# Include only specific parts
[[include]]
source = "../OnlyRequires"
parts = ['requires']

# Link from the Internet
[[include]]
source = "https://example.com/someInternetSettings"
sha256 = "edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb"
kennethreitz commented 7 years ago

no

brianmhunt commented 7 years ago

This is an issue of increasing interest because the tools needed to manage configurations are stressing under the needs of increasingly complex development layouts. It may be a valuable contribution to know the reasoning for rejecting this in the Python ecosystem.

Noting parallel discussion in node's package.json.

pradyunsg commented 7 years ago

I think @kennethreitz's position would be similar to node's - this is better handled by standalone tools that would generate the Pipfile if you really want to have a complex layout.

Further, I'd add, I doubt there's gonna be a large number of projects that have a non-trivial layout and don't use some build tool already. Adding a "generate a standard Pipfile from my fancy extended format" step wouldn't be too hard .

A minimal Pipfile format would be nicer to start with. It's possible to flesh it out later if needed (not vice versa). Also: Simple is better than complex.

brianmhunt commented 7 years ago

An interesting comparison, in the Docker context, is described here Builder pattern vs. Multi-stage builds in Docker by Alex Ellis

It was compelling in the Docker case for reasons beyond just configuration, and was implemented as Docker MultiStage Builds

The discussion is here:

Docker configs go to product/published image sizes and caching efficiency.

That said, it helps in configuration management as well, and as an example of a configuration file that imports dependencies instead of requiring complex and fragile builder routines.

---- EDIT ----

Also noting that Google App Engine's app.yaml has an includes directive.