Skip to content

Commit

Permalink
Merge branch 'feature/massive-refactor' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mcqueary committed Dec 15, 2023
2 parents e27b2ef + bfb0df6 commit 7411658
Show file tree
Hide file tree
Showing 79 changed files with 46,953 additions and 1,262 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest,macos-latest]
os: [ubuntu-latest,macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -40,9 +40,9 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 graver tests --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 src/graver tests --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 graver tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
poetry run flake8 src/graver tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest and report coverage
run: |
poetry run pytest --cov=graver
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ __pycache__/
*.db
*.csv
*.egg-info
*.json
data.json
*.log
.bandit
.env
Expand Down
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
Expand Down
26 changes: 14 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# same as `export PYTHONPATH="$PWD:$PYTHONPATH"`
# see also https://stackoverflow.com/a/18137056
mkfile_path := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
PYTHONPATH:=$(PYTHONPATH):$(mkfile_path):$(mkfile_path)graver
PACKAGES:=graver
PYTHONPATH:=$(PYTHONPATH):$(mkfile_path):$(mkfile_path)src/graver
PACKAGES:=src/graver

VENV?=.venv
PIP=$(VENV)/bin/pip
Expand All @@ -16,30 +16,32 @@ help: ## list targets with short description
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9._-]+:.*?## / {printf "\033[1m\033[36m%-38s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

cov: ## run pytest coverage report
. $(VENV)/bin/activate && pytest --cov=graver --cov-report term-missing
poetry run pytest --cov=graver --cov-report term-missing

coveralls: ## report coverage data to coveralls.io
. $(VENV)/bin/activate && coveralls

test-unit: ## run pytest unit tests only
. $(VENV)/bin/activate && pytest -rA -vvs --log-level INFO --without-integration
poetry run pytest -rA -vvs --log-level INFO --without-integration

test-integration: ## run pytest integration tests
. $(VENV)/bin/activate && pytest -rA -vvs --log-level INFO --with-integration
poetry run pytest -rA -vvs --log-level INFO --with-integration

test: ## run pytest
. $(VENV)/bin/activate && pytest -rA -vvs --log-level INFO
poetry run pytest -rA -vvs --log-level INFO

lint: ## run flake8 to check the code
. $(VENV)/bin/activate && flake8 $(PACKAGES) tests --count --select=E9,F63,F7,F82 --show-source --statistics
. $(VENV)/bin/activate && flake8 $(PACKAGES) tests --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
poetry run flake8 $(PACKAGES) tests --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 $(PACKAGES) tests --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics

install-editable:
. $(VENV)/bin/activate && pip install -e .
# install-editable:
# . $(VENV)/bin/activate && pip install -e .
install:
. $(VENV)/bin/activate && poetry install

fmt: ## run black to format the code
. $(VENV)/bin/activate && isort $(PACKAGES) tests
. $(VENV)/bin/activate && black -q --line-length 88 $(PACKAGES) tests
poetry run isort $(PACKAGES) tests
poetry run black -q --line-length 88 $(PACKAGES) tests

$(VENV)/init: ## init the virtual environment
python3 -m venv $(VENV)
Expand Down
2 changes: 1 addition & 1 deletion bin/export-json.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
sqlite3 graves.db <<EOF
sqlite3 $1 <<EOF
.headers on
.mode json
.output data.json
Expand Down
3 changes: 2 additions & 1 deletion definitions.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import os
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))

PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
8 changes: 0 additions & 8 deletions graver/__init__.py

This file was deleted.

123 changes: 0 additions & 123 deletions graver/cemetery.py

This file was deleted.

Loading

0 comments on commit 7411658

Please sign in to comment.