mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
update workflows
This commit is contained in:
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@@ -8,9 +8,8 @@ jobs:
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1.1.1
|
||||
with:
|
||||
virtualenvs-create: false
|
||||
- uses: abatilo/actions-poetry@v2.1.3
|
||||
- name: Config poetry
|
||||
run: poetry config experimental.new-installer false
|
||||
- name: CI
|
||||
run: make ci
|
||||
|
||||
7
.github/workflows/pypi.yml
vendored
7
.github/workflows/pypi.yml
vendored
@@ -11,10 +11,9 @@ jobs:
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1.1.1
|
||||
with:
|
||||
virtualenvs-create: false
|
||||
- uses: abatilo/actions-poetry@v2.1.3
|
||||
- name: Config poetry
|
||||
run: poetry config experimental.new-installer false
|
||||
- name: Build dists
|
||||
run: make build
|
||||
- name: Pypi Publish
|
||||
|
||||
25
Makefile
25
Makefile
@@ -1,19 +1,6 @@
|
||||
checkfiles = fastapi_cache/ examples/ tests/
|
||||
black_opts = -l 100 -t py38
|
||||
py_warn = PYTHONDEVMODE=1
|
||||
|
||||
help:
|
||||
@echo "FastAPI-Cache development makefile"
|
||||
@echo
|
||||
@echo "usage: make <target>"
|
||||
@echo "Targets:"
|
||||
@echo " up Ensure dev/test dependencies are updated"
|
||||
@echo " deps Ensure dev/test dependencies are installed"
|
||||
@echo " check Checks that build is sane"
|
||||
@echo " test Runs all tests"
|
||||
@echo " style Auto-formats the code"
|
||||
@echo " build Build package"
|
||||
|
||||
up:
|
||||
@poetry update
|
||||
|
||||
@@ -21,16 +8,16 @@ deps:
|
||||
@poetry install --no-root -E all
|
||||
|
||||
style: deps
|
||||
@isort -src $(checkfiles)
|
||||
@black $(black_opts) $(checkfiles)
|
||||
@poetry run isort -src $(checkfiles)
|
||||
@poetry run black $(checkfiles)
|
||||
|
||||
check: deps
|
||||
@black --check $(black_opts) $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
|
||||
@flake8 $(checkfiles)
|
||||
@bandit -r $(checkfiles)
|
||||
@poetry run black $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
|
||||
@poetry run flake8 $(checkfiles)
|
||||
@poetry run bandit -r $(checkfiles)
|
||||
|
||||
test: deps
|
||||
$(py_warn) pytest
|
||||
$(py_warn) poetry run pytest
|
||||
|
||||
build: clean deps
|
||||
@poetry build
|
||||
|
||||
@@ -37,3 +37,7 @@ build-backend = "poetry.masonry.api"
|
||||
redis = ["aioredis"]
|
||||
memcache = ["aiomcache"]
|
||||
all = ["aioredis","aiomcache"]
|
||||
|
||||
[tool.black]
|
||||
line-length = 100
|
||||
target-version = ['py36', 'py37', 'py38', 'py39']
|
||||
|
||||
Reference in New Issue
Block a user