-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build system with
flit
and Makefile (#3)
- Loading branch information
Showing
9 changed files
with
124 additions
and
128 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,29 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.6", "3.7", "3.8", "3.9"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2.3.4 | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2.2.2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install flit | ||
run: pip install flit | ||
- name: Build | ||
run: make | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v2.0.2 |
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
name: publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2.3.4 | ||
- name: Setup Python 3.8 | ||
uses: actions/setup-python@v2.2.2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install flit | ||
run: pip install flit | ||
- name: Publish | ||
env: | ||
FLIT_USERNAME: __token__ | ||
FLIT_PASSWORD: ${{ secrets.PYPY_API_TOKEN }} | ||
run: flit publish |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,27 +1,29 @@ | ||
# Environments | ||
.env | ||
.env/ | ||
.venv/ | ||
env/ | ||
venv/ | ||
.env | ||
*.lock | ||
|
||
# Cache | ||
*.pyc | ||
# IDEA | ||
.idea | ||
.vscode | ||
|
||
# Setup Tools | ||
build/ | ||
dist/ | ||
# Python | ||
*.egg | ||
*.egg-info | ||
|
||
# PyTest | ||
*.pyc | ||
__pycache__ | ||
.pytest_cache | ||
build/ | ||
dist/ | ||
|
||
# VS Code | ||
.vscode | ||
|
||
# SQLite | ||
# Generated | ||
*.db | ||
*.sqlite | ||
*.sqlite3 | ||
*.sqlite3-shm | ||
*.sqlite3-wal | ||
*.zip | ||
.coverage | ||
coverage.xml |
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,25 @@ | ||
.DEFAULT_GOAL := build | ||
|
||
install: # Install dependencies | ||
flit install --deps develop --symlink | ||
|
||
fmt format: # Run code formatters | ||
isort --profile black . | ||
black . | ||
|
||
lint: # Run code linters | ||
isort --profile black --check --diff . | ||
black --check --diff --color . | ||
flake8 --max-line-length 88 --max-complexity 8 --select C,E,F,W,B,B950,S --ignore E203,E501 ninja_apikey | ||
# TODO: mypy ninja_apikey | ||
|
||
test: # Run tests | ||
pytest -v sample_project ninja_apikey | ||
|
||
cov test-cov: # Run tests with coverage | ||
pytest --cov=ninja_apikey --cov-report=term-missing --cov-report=xml -v sample_project ninja_apikey | ||
|
||
build: # Build project | ||
make install | ||
make lint | ||
make cov |
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,3 @@ | ||
"""Easy to use API key authentication for Django Ninja REST Framework""" | ||
|
||
__version__ = "0.2.0" |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# flake8: noqa | ||
from datetime import timedelta | ||
|
||
import pytest | ||
|
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