Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lordgordon/py-scaffolding
My custom Python project scaffolding repository.
https://github.com/lordgordon/py-scaffolding
custom-python python python3 repository-template scaffolding
Last synced: 9 days ago
JSON representation
My custom Python project scaffolding repository.
- Host: GitHub
- URL: https://github.com/lordgordon/py-scaffolding
- Owner: lordgordon
- License: mit
- Created: 2021-02-07T18:06:32.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-20T17:40:16.000Z (9 months ago)
- Last Synced: 2024-08-14T07:09:18.006Z (4 months ago)
- Topics: custom-python, python, python3, repository-template, scaffolding
- Language: Python
- Homepage:
- Size: 293 KB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- jimsghstars - lordgordon/py-scaffolding - My custom Python project scaffolding repository. (Python)
README
# py-scaffolding
My custom Python project scaffolding repository: https://github.com/lordgordon/py-scaffolding.Docker images published at https://hub.docker.com/repository/docker/lordgordon/py-scaffolding.
:point_right: Note: to release the project as a Python library, you need to run `poetry build` and add the proper ci/cd
to publish the library.---
![pr-validation](https://github.com/lordgordon/py-scaffolding/workflows/pr-validation/badge.svg?branch=main)
[![release](https://github.com/lordgordon/py-scaffolding/actions/workflows/release.yaml/badge.svg)](https://github.com/lordgordon/py-scaffolding/actions/workflows/release.yaml)## Requirements and setup
- [brew](https://brew.sh/).
- Linux/UNIX compatible system with `make` command.
- [Docker](https://www.docker.com/). For macOS users, [colima](https://github.com/abiosoft/colima) is strongly suggested.Then, to set everything up on macOS:
```shell
brew install pyenv
pyenv install
make
```## Release and Changelog
Version bump and changelog update:
```shell
# PATCH
poetry run cz bump --increment PATCH -ch --dry-run
# MINOR
poetry run cz bump --increment MINOR -ch --dry-run
# MAJOR
poetry run cz bump --increment MAJOR -ch --dry-run
```If OK, run again without `--dry-run`. For full details see
https://commitizen-tools.github.io/commitizen/bump/## Commands
The main command that run everything (lint, test, build):
```shell
make
```Then, to execute the main entry point with the local Poetry environment:
```shell
make run-locally
```or, to execute the main entry point from Docker:
```shell
make run
```or, to open a shell in the Docker image:
```shell
make run-shell
````make help` to the rescue in case of doubts.
### Run the production image
To run the main entry point with the production image, first build the production image:
```shell
make build
```Then:
```shell
docker run --platform linux/amd64 --rm -it py-scaffolding:current-local
```### Serving commands
| command | description |
|:----------------------|:------------------------------------------------------------|
| `make serve-coverage` | Start a local server to show the HTML code coverage report. |
| `make serve-doc` | Start a local server to show the internal documentation. |### Helpful commands
| command | description |
|:-------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `make update` | Just update the environment. |
| `make autolint` | Autolinting code. |
| `make lint-base` | Code linting without running autolinters. |
| `make lint` | Autolint and code linting. |
| `make test` | Run all the tests with code coverage. You can also `make test tests/test_my_specific.py`. |
| `make doc` | Compile and update the internal documentation. |
| `make clean` | Force a clean environment: remove all temporary files and caches. Start from a new environment. This command allow to start over from a fresh state. |
| `make build` | Build the Docker image. |
| `make run` | Execute the main entry point from Docker. |
| `make run-locally` | Execute the main entry point locally (with Poetry). |
| `make run-shell` | Open a shell in the Docker image. |