Comments (2)
When I install the app with
pip install -e .
and I call the cli from from any working directory other than the top directory oft the project, I get a file not found error:
...
If I run the same command from the top level directory of the app, the config.yml file loads.
...Is this expected behaviour? Should I replace the relative default path
etc/config.yml
with an absolute path, for example one generated with the package platformdirs?
Yes, this is the expected behavior. In practice, I use an application's root directory as its working directory, and the template follows this convention. For development, the root directory is the project root (subdirectories are src/
, etc
/ , tests/
, and so one). For an installed application, the root directory is where it was installed. Best practice is to install it into a virtualenv envrionment, which then becomes the root directory (subdirectories are etc/
and bin/
).
One advantage of doing things this way is that the runtime behavior is the same for an installed application as it is during development. Note that the tests also assume that the root directory is the working directory. You can replace the config path with an absolute directory if that fits your needs, but then you might have a mismatch between development and production. Also, you can always use --config
CLI option to explicitly set the path to wherever you want.
from cookiecutter-python-app.
Thank you very much for your explanation and for the template!
from cookiecutter-python-app.
Related Issues (12)
- deploy.py fails with --repo option for a local relative directory HOT 3
- Add "scripts-to-rule-them-all" for python package HOT 1
- Explicit `!param` tag resolution fails in config.load() HOT 1
- Add support for GitHub Actions HOT 1
- Replace setup.py with pyproject.toml HOT 4
- Migration from YAML to TOML for config files HOT 1
- deprecated call to pytest.main() in test scripts HOT 1
- python setup.py install --user is failing (windows / Python 3.4) HOT 3
- Import not used HOT 1
- Use safe_load() to load YAML config files HOT 1
- app is not working out of the box HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cookiecutter-python-app.