Improvements to locating piccolo_conf.py
#1371
Replies: 3 comments
-
|
I like these ideas, especially |
Beta Was this translation helpful? Give feedback.
-
|
Just guessing if looking for it also in CWD could be interesting. Until now, I’ve had it in the root of my project (following a hint in the docs) and it has been working perfectly from the IDE (because it, automatically, adds the project root to the python path. But a few hours ago, I’ve packaged the project, that includes a script to launch it and when I install it in other environment/project and execute it, the conf file isn’t found anymore. I know that I can I set it both adding to the python path or hacking the package main script to setup the piccolo_conf env var… and I will. Just I was expecting it to work automatically in the root of any project / that uses to be the CWD normally. FYC, ciao :) |
Beta Was this translation helpful? Give feedback.
-
|
hi |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue #323 gave me some ideas about improvements to the way Piccolo looks for a
piccolo_conf.pyfile.I'm just documenting them here as ideas - they could be developed in the future if people think they're needed.
1.
PICCOLO_CONFchangesThe
PICCOLO_CONFenvironment variable could accept a comma separated list of paths, in case you wanted Piccolo to look in multiple places.2. Add
--piccolo_confoption to the CLIWhen using the
piccoloCLI, an extra parameter could be added which specifies where to look for thepiccolo_conf.pyfile:3. .piccolo file
The contents would be something like:
The precedence for finding a
piccolo_conf.pyfile would then be as follows:PICCOLO_CONFenvironment variable exists, use this..piccolofile in the current directory, and use that.piccolo_conf.pyBeta Was this translation helpful? Give feedback.
All reactions