update workflows

This commit is contained in:
long2ice
2021-10-19 11:56:51 +08:00
parent c3be2eca19
commit 4faa5b7101
4 changed files with 16 additions and 27 deletions

View File

@@ -8,9 +8,8 @@ jobs:
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: "3.x" python-version: "3.x"
- name: Install and configure Poetry - uses: abatilo/actions-poetry@v2.1.3
uses: snok/install-poetry@v1.1.1 - name: Config poetry
with: run: poetry config experimental.new-installer false
virtualenvs-create: false
- name: CI - name: CI
run: make ci run: make ci

View File

@@ -11,10 +11,9 @@ jobs:
- uses: actions/setup-python@v1 - uses: actions/setup-python@v1
with: with:
python-version: '3.x' python-version: '3.x'
- name: Install and configure Poetry - uses: abatilo/actions-poetry@v2.1.3
uses: snok/install-poetry@v1.1.1 - name: Config poetry
with: run: poetry config experimental.new-installer false
virtualenvs-create: false
- name: Build dists - name: Build dists
run: make build run: make build
- name: Pypi Publish - name: Pypi Publish

View File

@@ -1,19 +1,6 @@
checkfiles = fastapi_cache/ examples/ tests/ checkfiles = fastapi_cache/ examples/ tests/
black_opts = -l 100 -t py38
py_warn = PYTHONDEVMODE=1 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: up:
@poetry update @poetry update
@@ -21,16 +8,16 @@ deps:
@poetry install --no-root -E all @poetry install --no-root -E all
style: deps style: deps
@isort -src $(checkfiles) @poetry run isort -src $(checkfiles)
@black $(black_opts) $(checkfiles) @poetry run black $(checkfiles)
check: deps check: deps
@black --check $(black_opts) $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false) @poetry run black $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
@flake8 $(checkfiles) @poetry run flake8 $(checkfiles)
@bandit -r $(checkfiles) @poetry run bandit -r $(checkfiles)
test: deps test: deps
$(py_warn) pytest $(py_warn) poetry run pytest
build: clean deps build: clean deps
@poetry build @poetry build

View File

@@ -37,3 +37,7 @@ build-backend = "poetry.masonry.api"
redis = ["aioredis"] redis = ["aioredis"]
memcache = ["aiomcache"] memcache = ["aiomcache"]
all = ["aioredis","aiomcache"] all = ["aioredis","aiomcache"]
[tool.black]
line-length = 100
target-version = ['py36', 'py37', 'py38', 'py39']