Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,21 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Setup just
uses: extractions/setup-just@v3
- name: Install requirements
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9
with:
enable-cache: true
- name: Setup environment
run: |
python3 -m venv .venv
source .venv/bin/activate

python3 -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint project
just sync
- name: Lint
run: |
source .venv/bin/activate
just lint
- name: Run unit tests
- name: Unit tests
run: |
source .venv/bin/activate
just test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# Ruff
.ruff_cache
2 changes: 2 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
brew "just"
brew "uv"
44 changes: 17 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@
# Python Project Template ![](https://github.com/ahcode0919/python-project-template/actions/workflows/ci.yml/badge.svg?branch=main)


Baseline Python project template

## Setup

Project supports local development and VSCode Dev container development

### Local development
### Local Development Installation

Note: Project uses `uv` and `just` to manage project configuration and commands

- Recommended
- Install [`pyenv`](https://github.com/pyenv/pyenv)
- Install current Python version: `pyenv install 3.14.2`
- Set global Python version: `pyenv global 3.14.2`
- Or Install with Homebrew
- Install python 3 `brew install python3`
- Initialize virtual environment: `python3 -m venv .venv`
- Activate: `source .venv/bin/activate`
- Install packages: `pip install -r requirements.txt`
* Install dependencies via Homebrew - `brew bundle install`
* Sync project - `just sync`

### VS Code Dev Container

- Install Docker
- Install VSCode
- Open project folder in VS Code
- Install recommended extensions
- Reopen in container using Remote Development Container menu
* Install Docker
* Install VSCode
* Open project folder in VS Code
* Install recommended extensions
* Reopen in container using Remote Development Container menu

## Project Commands

- Local
- `just lint` - lint project files
- Dev container
- `just lint` - lint and stylecheck project files
- Run unit tests: `just test`
* Local
* `just lint` - lint project files
* Dev container
* `just lint` - lint and stylecheck project files
* Run unit tests: `just test`
* Install dependency: `uv add {package}`

## Usage

- Usage Notes

## Update Dependencies

- Install dependency: `pip install {dependency}`
- Update requirements file: `pip freeze > requirements.txt`
* Usage Notes
7 changes: 5 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
lint:
ruff check . --fix && ruff format .
uv run ruff check . --fix
uv run ruff format .
sync:
uv sync --all-groups
test:
pytest
uv run pytest
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
[project]
name = "example"
version = "0.0.1"
requires-python = ">=3.14"

dependencies = []

[dependency-groups]
dev = ["pytest", "ruff>=0.16.0"]

[tool.pytest.ini_options]
pythonpath = ["."]

[tool.ruff]
line-length = 100
target-version = "py312"
Expand Down
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

Loading