generated from Coding-Cuddles/bootstrap-python-kata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2498f1c
Showing
11 changed files
with
484 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
cache: 'poetry' | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Check formatting | ||
run: | | ||
source $(poetry env info --path)/bin/activate | ||
make format-check | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
cache: 'poetry' | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Run main | ||
run: make run | ||
|
||
- name: Test | ||
run: | | ||
source $(poetry env info --path)/bin/activate | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.coverage.* | ||
.cache | ||
.pytest_cache/ | ||
|
||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
run = ["make", "test"] | ||
language = "python3" | ||
entrypoint = "main.py" | ||
hidden = ["LICENSE", "venv", ".config", ".gitignore", "**/__pycache__", "**/.pytest_cache", "**/*.pyc"] | ||
|
||
[nix] | ||
channel = "stable-21_11" | ||
|
||
[languages] | ||
|
||
[languages.python3] | ||
pattern = "**/*.py" | ||
|
||
[languages.python3.languageServer] | ||
start = "pylsp" | ||
|
||
[debugger] | ||
support = false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Coding Cuddles | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
all: test | ||
|
||
SRCS := $(shell git ls-files *.py) | ||
|
||
.PHONY: run | ||
run: | ||
./main.py | ||
|
||
.PHONY: test | ||
test: | ||
pytest test_*.py | ||
|
||
.PHONY: format | ||
format: | ||
yapf -i $(SRCS) | ||
|
||
.PHONY: format-check | ||
format-check: | ||
yapf --diff $(SRCS) \ | ||
|| (echo "Some files require formatting. Run 'make format' to fix." && exit 1) | ||
|
||
.PHONY: clean | ||
clean: | ||
git clean -Xfd | ||
|
||
ifndef VERBOSE | ||
.SILENT: | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Bootstrap for Python katas | ||
|
||
[![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) | ||
|
||
## Overview | ||
|
||
This is a bootstrap repository for clean code katas in Python 3 using pytest. | ||
|
||
## Usage | ||
|
||
You can import this project into [Replit](https://replit.com), and it will | ||
handle all dependencies automatically. | ||
|
||
### Prerequisites | ||
|
||
* [Python 3.8+](https://www.python.org/) | ||
* [pytest](https://pytest.org) | ||
|
||
### Run main | ||
|
||
```console | ||
make run | ||
``` | ||
|
||
### Run tests | ||
|
||
```console | ||
make test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env python3 | ||
|
||
if __name__ == "__main__": | ||
print("Hello World!") |
Oops, something went wrong.