Skip to content

Instantly share code, notes, and snippets.

@SahbiOuali13
Last active November 19, 2022 18:12
Show Gist options
  • Save SahbiOuali13/f67a17dfce0b6e7c63e779eb159a4cbc to your computer and use it in GitHub Desktop.
Save SahbiOuali13/f67a17dfce0b6e7c63e779eb159a4cbc to your computer and use it in GitHub Desktop.
- It uses jinja2 templating - `pipx install cookiecutter` - Install from github audreyfeldroy/cookiecutter-pypackage - cookiecutter gh:audreyfeldroy/cookiecutter-pypackage - You can create your own project template and reproduce it using `cookiecutte
  1. Create your own project folder you want to reproduce, then cookiecutter.json

  • Create cookiecutter.json
{
    "project_name": "Mon super projet",
    "project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}",
    "project_decription": "Give a short description of your project.",
    "use_pytest": "y",
    "version_de_python": ["3.11", "3.10", "3.9"]
}
  • create inside a folder {{ {{ cookiecutter.project_slug }} }}
  • using pipenv generate a Pipfile then delete .venv and the lock file
    • Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]
{% if cookiecutter.use_pytest == 'y' -%}
pytest = "*"{% endif %}

[requires]
python_version = "{{ cookiecutter.version_de_python }}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment