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
42 changes: 14 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'poetry'
python-version: "3.8"

- name: Install dependencies
run: poetry install
- uses: astral-sh/setup-uv@v6
with:
version: "latest"

- name: Check formatting
run: |
source $(poetry env info --path)/bin/activate
make format-check
run: make format-check

test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'poetry'
python-version: "3.8"

- name: Install dependencies
run: poetry install
- uses: astral-sh/setup-uv@v6
with:
version: "latest"

- name: Run main
run: make run

- name: Test
run: |
source $(poetry env info --path)/bin/activate
make test
run: make test
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
all: test

# Detect available package managers
UV := $(shell command -v uv 2> /dev/null)

SRCS := $(shell git ls-files *.py)

ifdef UV
RUNNER := uv run
else
RUNNER :=
endif

.PHONY: run
run:
./main.py
$(RUNNER) ./main.py

.PHONY: test
test:
pytest test_*.py
$(RUNNER) pytest test_*.py

.PHONY: format
format:
yapf -i $(SRCS)
$(RUNNER) ruff format $(SRCS)

.PHONY: format-check
format-check:
yapf --diff $(SRCS) \
$(RUNNER) ruff format --check $(SRCS) \
|| (echo "Some files require formatting. Run 'make format' to fix." && exit 1)

.PHONY: clean
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Bootstrap for Python katas
# Bootstrap for Python coding kata

[![CI](https://github.com/Coding-Cuddles/bootstrap-python-kata/actions/workflows/main.yml/badge.svg)](https://github.com/Coding-Cuddles/bootstrap-python-kata/actions/workflows/main.yml)
[![Replit](https://img.shields.io/badge/Try%20with%20Replit-black?logo=replit)](https://replit.com/new/github/Coding-Cuddles/bootstrap-python-kata)
Expand Down
276 changes: 0 additions & 276 deletions poetry.lock

This file was deleted.

Loading