prokher / PythonProjectTemplate

Python project template by Prokher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python project template by Prokher

A Python project template is carefully baked by Prokher for personal use. If you find it useful - you are welcome to use it as well.

Quick start

$ pip install cookiecutter
$ cookiecutter gh:prokher/PythonProjectTemplate
$ cd <NewProject>
$ poetry install
$ poetry run pytest
$ code .

quickstart.gif

Congratulations, you have working Python project. Read its README.md to see how to setup your development environment properly. I also recommend reading generated configuration files pyproject.toml and setup.cfg to check if they match your needs.

Features

Description

This template is intended to automate Python project bootstrapping. At the same time, you will not find scripts or commands for all possible configuration management cases here. I am sure that software engineers must understand how tooling works and must be able to configure tools the works with. So the target use-case is the following: you start with this template, get a working Python project, and then tune the results to satisfy your project needs. To help with this I thoroughly commended all the configuration files and left links to the relevant parts of the documentation everywhere possible. Enjoy.

The template deploys by the awesome Cookiecutter tool. If one day you need to make a template for some project (e.g. a set for structured folders and files) I recommend to take a look at the Cookiecutter. The usage is indeed straightforward and it does its job very well.

Feedback

Please, do not bother me if you dislike some stylistic things. I've made this template for personal use, after all. On the other hand, if you see there is (objectively) better alternative to one of the tools used, or something must be updated due to use latest version of these tools - feel free to make an issue or PR. I would like to keep this template up-to-date and kind of modern.

Development setup

  1. Install PyEnv to be able to work with many Python versions at once PyEnv→Installation.
  2. Install Python versions needed:
    $ pyenv local | xargs -L1 pyenv install
  3. Install Poetry to the system Python.
    $ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
    It is important to install Poetry into the system Python, NOT in your virtual environment. For details see Poetry docs: https://python-poetry.org/docs/#installation
  4. Create local virtualenv in .venv, install all project dependencies (from pyproject.toml), and upgrade pip.:
    $ poetry install && poetry run pip install --upgrade pip

License

This project is licensed under the terms of the MIT License.

About

Python project template by Prokher

License:MIT License


Languages

Language:Python 100.0%