1
0
mirror of https://github.com/cmur2/kube-stale-resources.git synced 2024-12-22 02:54:24 +01:00

module: adopt Poetry dependency manager

This commit is contained in:
cn 2020-08-08 21:26:49 +02:00 committed by Christian Nicolai
parent 64b19885e9
commit 5851cd4e37
5 changed files with 49 additions and 24 deletions

View File

@ -16,14 +16,8 @@ jobs:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev --deploy
- name: Formatting
run: |
# check that the source files are formatted correctly
pipenv run yapf -q *.py
pip install poetry
poetry install
- name: Linting
run: |
pipenv run mypy *.py
pipenv run pylint *.py
make lint

1
.gitignore vendored
View File

@ -1 +1,2 @@
.mypy_cache
poetry.lock

23
Makefile Normal file
View File

@ -0,0 +1,23 @@
# https://tech.davis-hansson.com/p/make/
SHELL := bash
.ONESHELL:
.SILENT:
.SHELLFLAGS := -eux -o pipefail -c
.DELETE_ON_ERROR:
.DEFAULT_GOAL := all
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.PHONY: all
all: lint ## Run lint and test (default goal)
.PHONY: lint
lint: ## Lint all source code
poetry run yapf -q *.py
poetry run pylint *.py
poetry run mypy *.py
.PHONY: help
help: ## Print this help text
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'

15
Pipfile
View File

@ -1,15 +0,0 @@
[[source]]
url = 'https://pypi.python.org/simple'
[requires]
python_version = '3.8'
[packages]
pyyaml = '*'
requests = '*'
[dev-packages]
rope = '==0.17.0'
pylint = '==2.5.3'
yapf = '==0.30.0'
mypy = '== 0.782'

22
pyproject.toml Normal file
View File

@ -0,0 +1,22 @@
[build-system]
requires = ["poetry>=1.0"]
build-backend = "poetry.masonry.api"
[tool.poetry]
name = "kube-stale-resources"
version = "1.0.0"
description = "Utility augmenting 'kubectl diff' to detect stale resources in Kubernetes clusters between local YAML manifests (target state) and the cluster (live state)."
authors = ["Christian Nicolai"]
license = "Apache-2.0"
homepage = "https://dev.mycrobase.de/gitea/cn/kube-stale-resources"
[tool.poetry.dependencies]
python = "^3.8"
pyyaml = "5.3.1"
requests = "2.24.0"
[tool.poetry.dev-dependencies]
mypy = "0.782"
pylint = "2.5.3"
rope = "0.17.0"
yapf = "0.30.0"