Python project structure foundation or template, CLI console scripts.
Project description
This repository is meant to be used as a minimal, yet opinionated baseline for Python software projects. It includes:
Basic Python “distribution”/project metadata
Command-line console script with sub-command boilerplate
A Makefile for local development build, test and maintenance tasks
Docker container images for users and development
Targets/recipes in the Makefile to automate releases
Makefile recipes/targets used for both local development and on CI/CD platforms
A GitLab CI/CD pipeline integrating those CI/CD recipes/targets
A GitHub Actions workflow/pipeline integrating those CI/CD recipes/targets
The intended use is to add this repository as a VCS remote for your project. Thus developers can merge changes from this repository as we make changes related to Python project structure and tooling. As we add structure specific to certain types of projects (e.g. CLI scripts, web development, etc.), frameworks (e.g. Flask, Pyramid, Django, etc.), libraries and such, branches will be used for each such variation such that structure common to different variations can be merged back into the branches for those specific variations.
Do not use the develop or master branches in your project as those branches are used to test the CI/CD automatic releases process and as such contain bumped versions, release notes, and other release artifacts that shouldn’t be merged into real projects. On that same note, when adding this template as a remote be sure to configure it with $ git config remote.template.tagOpt --no-tags to avoid clashing VCS versions in your project.
Installation
Install using any tool for installing standard Python 3 distributions such as pip:
$ sudo pip3 install python-project-structure
Or use the Docker image. See the example ./docker-compose.yml file for usage details.
Optional shell tab completion is available via argcomplete.
Usage
See the command-line help for details on options and arguments:
$ usage: python-project-structure [-h] Python project structure foundation or template, top-level package. optional arguments: -h, --help show this help message and exit
CONTRIBUTING
NOTE: This project is hosted on GitLab. There’s a mirror on GitHub but please use GitLab for reporting issues, submitting PRs/MRs and any other development or maintenance activity.
See the ./CONTRIBUTING.rst file for more details on how to get started with development.
Motivation
There are many other Python project templates so why make another? I’ve been doing Python development since 1998, so I’ve had plenty of time to develop plenty of opinions of my own.
What I want in a template is complete tooling (e.g. test coverage, linting, formatting, CI/CD, etc.) but minimal dependencies, structure, and opinion beyond complete tooling (e.g. some non-Python build/task system, structure for frameworks/libraries not necessarily being used, etc.). I couldn’t find a template that manages that balance so here we are.
I also find it hard to discern from other templates why they made what choices the did. As such, I also use this template as a way to try out various different options in the Python development world and evaluate them for myself. You can learn about my findings and the reasons the choices I’ve made in the commit history.
Most importantly, however, I’ve never found a satisfactory approach to keeping project structure up to date over time. So the primary motivation is to use this repository as a remote from which we can merge structure updates over the life of projects using the template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for python-project-structure-0.1.0b10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b5b7d7f759e6a32a853564b88839a84077d75983083461006cf88298d227a9b |
|
MD5 | 875f4530e078849c2dfd56daf4166ed2 |
|
BLAKE2b-256 | 718879f88175e77b636214e634dae8c2897769b3999826dc6311e2225dff74ba |
Hashes for python_project_structure-0.1.0b10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bde1210189af90f8684afb35226e975d6ea5d598ff2a6b24e023ef851567ce8 |
|
MD5 | 63d00b5d9faf002fdd754bfdb08ba18e |
|
BLAKE2b-256 | c68c157230bcc45d8fac815e6a722b2b3774d93f37d63f2995ee4a9eb41d5b66 |