This is a Cookiecutter
The template was created taking as a reference:
Repositories created from this template include
- Proper repository structure with pre-defined folders.
- Code documentation with
Sphinx
. - Testing setup and code coverage with
pytest
andpytest-cov
. - Code examples within code documentation is tested with
doctest
. - Code linting with
pytlint
andflake8
. - Documentation linting with
darglint
. - Complexity measurement with
radon
. - Code formatting with
black
. - Git hooks with
pre-commit
. - Command line interface using
Click
. Makefile
with pre-defined targets to automate tasks.
Clone the repository with:
git clone https://github.com/alvaroof/project_template
Open VSCode then open cookicutter.code-workspace
file. VSCode will automatically open the project within a Docker container.
Open VSCode terminal and type make
. This will create just the project scaffold within the out
directory.
During the process you will be asked:
project_name
- Project name (see "Naming conventions" section)project_slug
- Name of the main root directory (see "Naming conventions" section)package_name
- Package name (see "Naming conventions" section)version
- Initial version; we recommend using the default value
Install the latest Cookiecutter (it is highly recommended to do it within a virtual environment):
pip install -U cookiecutter
Create Python package project from the template:
cookiecutter cookiecutter_pypackage
This will create just the project scaffold. During the process you will be asked about: project_name
, project_slug
, package_name
and version
(see previous section).
The name of the project shall be short and descriptive enough
It shall be like project_name
(in snake case format).
The acronym should be generated from the project root directory.
Field | Example |
---|---|
Project name | Project Name |
Project slug | py_doing_something |
Package name | pysomething |
Repository url (optional) | https://github.com/alvaroof/project_template.git |
Description (optional) | This project aims to do something |
Create a new Git project in Gitlab. Then we will push the new project scaffold with:
cd your_new_project_scaffold
git init
git remote add origin <url>
git add .
git commit -m "Initial commit"
git push -u origin master