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
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

View File

@@ -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

View File

@@ -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

View File

@@ -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']