https://github.com/sabard/python-package-template
Generic Python package starting point
https://github.com/sabard/python-package-template
copier-template
Last synced: 4 months ago
JSON representation
Generic Python package starting point
- Host: GitHub
- URL: https://github.com/sabard/python-package-template
- Owner: sabard
- License: agpl-3.0
- Created: 2021-11-13T01:05:45.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-14T20:06:52.000Z (12 months ago)
- Last Synced: 2025-06-25T13:03:58.372Z (4 months ago)
- Topics: copier-template
- Language: Shell
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-package-template
`python-package-template` is a [copier](https://github.com/copier-org/copier) template to create **and update** Python packages. Copier uses git to merge changes from the original template into your instance, so you can keep all of your Python packages up to date and consistent.## Initial Setup
### Basic Usage
```bash
pipx install copier
copier copy https://github.com/sabard/python-package-template /path/to/project
cd /path/to/project
./setup.sh
```### Developer
Dependencies:
- [pyenv](https://github.com/pyenv/pyenv)
- [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)Installation is made simple with [pyenv-installer](https://github.com/pyenv/pyenv-installer).
Once you have installed pyenv, install the rest of `python-package-template`'s dependencies with the setup script:
```bash
./setup.sh
```## Update Package Dependencies
Add new dependencies to `requirements.in` and then run:
```bash
./update-deps.sh
```Single dependencies can be updated with:
```bash
./update-deps.sh --upgrade-package
```## Local Usage
TODO add `pipx install copier` or provide another install method than running the setup script
### Create a new template
`cd` into your project directory and run:
```bash
pyenv activate python-package-template
copier copy path/to/python-package-template path/to/your_project
```-or-
```bash
copier copy gh:sabard/python-package-template .
```### Update an existing template
After making changes to the template:
```bash
cd path/to/your_project
pyenv activate python-package-template
copier update
pyenv deactivate
```## Publish Package
Run the upload script which tags and releases the package via a push-triggered CI workflow:
```bash
./upload.sh
```Make sure `TWINE_REPOSITORY`, `TWINE_USERNAME`, and `TWINE_PASSWORD` environment variables are available in your CI environment.