Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dougthor42/_template_python
My Python template
https://github.com/dougthor42/_template_python
Last synced: 6 days ago
JSON representation
My Python template
- Host: GitHub
- URL: https://github.com/dougthor42/_template_python
- Owner: dougthor42
- Created: 2020-02-27T19:45:07.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-11T19:59:01.000Z (12 months ago)
- Last Synced: 2024-03-15T12:11:20.984Z (10 months ago)
- Language: Python
- Size: 87.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Generic CookieCutter Template for Python
This repo is my generic template for python projects.
## Usage
1. Clone this repository.
2. Make a virtual environment.
3. Install it: `pip install -e .`
+ If you want to do development: `pip install -e .[dev]`
4. Run `python create_project.py /path/to/dir`
5. Answer the questions.**Note:** The path listed in step for should *not* include the project name.
A new folder will be made for the project, so you'll end up with:```
/path/to/dir/
project_name/
src/
package_name/
README.md
...
```## Development Notes
Normally I'd have (a) a package within a `src` dir and (b) a separate top-level
package for tests, but given that this is supposed to just be a script (and
not, for example, something I distribute on pypi or a standalone application),
I've opted to put everything within a `src` dir only.So all code and tests can be found in `src`. The top-level `create_project.py`
is only to keep the Usage simple (`python create_project.py`).### Testing
Tests are run with:
```
pytest src/
```Note: `pyproject.toml` specifies the
[`testpaths`](https://docs.pytest.org/en/latest/reference.html#confval-testpaths)
option which tells pytest to only look for tests in `src/`. Not setting this
option causes pytest to find tests in `{{cookiecutter.project_slug}}/`.