Skip to content
Open
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
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source .venv/bin/activate
unset PS1
eval "$(register-python-argcomplete ffpass)"

7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.db filter=sqlite diff=sqlite

# NOTE: you can also configure the git filter/smudge for this repo:
# git config set --local filter.sqlite.clean=git-sqlite-clean %f
# git config set --local filter.sqlite.smudge=git-sqlite-smudge %f
# git config set --local filter.sqlite.required=true

76 changes: 27 additions & 49 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -1,59 +1,37 @@
---
name: ffpass

on: [push, pull_request_target]

jobs:
test:
name: Test
runs-on: ubuntu-latest
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .

- name: Test with pytest
run: |
pip install pytest
pip install pytest-cov
python -m pytest tests --junit-xml pytest.xml

- name: Lint with flake8
run: |
pip install flake8
flake8 --ignore=E741,E501 .

- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Unit Test Results
path: pytest.xml


publish-test-results:
name: "Publish Unit Tests Results"
needs: test
runs-on: ubuntu-latest
if: success() || failure()

steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
check_name: Unit Test Results
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "artifacts/Unit Test Results/pytest.xml"
python-version: "3.x"

- name: Install dependencies
run: >
python -m pip install --upgrade pip &&
python -m pip install
coveralls
-r requirements.txt
-r requirements-dev.txt

- name: Test with pytest
run: make test

- name: Lint with flake8
run: make lint

- name: Submit coverage report / coveralls
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python -m coveralls --service=github
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may break coverage reporting, and should possibly be reverted. It's just what I had a working reference copy of at the time that I could use, sorry.

49 changes: 49 additions & 0 deletions .github/workflows/windows-and-mac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: windows-and-mac

on: [push, pull_request_target]

jobs:
windows:
runs-on: [windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .

- name: Test with pytest
run: |
pip install pytest
pip install pytest-cov
python -m pytest tests --junit-xml pytest.xml

macOS:
runs-on: [macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .

- name: Test with pytest
run: |
pip install pytest
pip install pytest-cov
python -m pytest tests --junit-xml pytest.xml
70 changes: 62 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,67 @@
pypi: dist
twine upload dist/*

dist: flake8
SHELL:=/bin/bash

.DEFAULT_GOAL=_help

# NOTE: must put a <TAB> character and two pound "\t##" to show up in this list. Keep it brief! IGNORE_ME
.PHONY: _help
_help:
@printf "\nUsage: make <command>, valid commands:\n\n"
@grep "##" $(MAKEFILE_LIST) | grep -v IGNORE_ME | sed -e 's/##//' | column -t -s $$'\t'


.PHONY: deps
deps: ## Install runtime and dev dependencies
PIP_USER=0 pip install -r requirements.txt -r requirements-dev.txt


.PHONY: build
build: lint ## Build release
build:
-rm dist/*
./setup.py sdist bdist_wheel

flake8:
flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

clean:
.PHONY: release
release: build ## Upload release to PyPI (via Twine)
twine upload dist/*



LINT_LOCS_PY ?= ffpass/ tests/

.PHONY: format
format: ## Not phased in yet, no-op
-black --check ${LINT_LOCS_PY}
-isort --check ${LINT_LOCS_PY}


.PHONY: lint
lint: ## Lint the code
flake8 --count --show-source --statistics
ruff check ${LINT_LOCS_PY}


.PHONY: test
test: ## Run pytest & show coverage report
coverage run
coverage report



.PHONY: install
install: ## Install from local source (via pip)
pip install .


.PHONY: clean
clean: ## Clean up build files/cache
rm -rf *.egg-info build dist
rm -f .coverage
find . \
-name .venv -prune \
-o -name __pycache__ -print \
-o -name *.egg -print \
-o -name .pytest_cache -print \
-o -name .coverage -print \
-o -name .mypy_cache -print \
| xargs -r rm -rf
Loading
Loading