More cleanup

This commit is contained in:
Hemna 2022-12-18 12:44:19 -05:00
parent f6a456a586
commit 41b7c27a63
7 changed files with 228 additions and 338 deletions

View File

@ -17,31 +17,7 @@ repos:
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.0.2
- repo: https://github.com/dizballanze/gray
rev: v0.10.1
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
hooks:
- id: pyupgrade
args:
- --py3-plus
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.7.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear]
- id: gray

View File

@ -1,50 +1,73 @@
.PHONY: virtual dev build-requirements black isort flake8
REQUIREMENTS_TXT ?= requirements.txt dev-requirements.txt
REQUIREMENTS_TXT ?= requirements.txt requirements-dev.txt
.DEFAULT_GOAL := help
.PHONY: help dev test
include Makefile.venv
Makefile.venv:
curl \
-o Makefile.fetched \
-L "https://github.com/sio/Makefile.venv/raw/v2020.08.14/Makefile.venv"
-o Makefile.fetched \
-L "https://github.com/sio/Makefile.venv/raw/v2020.08.14/Makefile.venv"
echo "5afbcf51a82f629cd65ff23185acde90ebe4dec889ef80bbdc12562fbd0b2611 *Makefile.fetched" \
| sha256sum --check - \
&& mv Makefile.fetched Makefile.venv
| sha256sum --check - \
&& mv Makefile.fetched Makefile.venv
all: pip dev
help: # Help for the Makefile
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: dev
dev: venv
$(VENV)/pre-commit install
dev: venv ## Create the virtualenv with all the requirements installed
.PHONY: docs
docs: build
cp README.rst docs/readme.rst
cp Changelog docs/changelog.rst
tox -edocs
clean: clean-venv
rm -rf dist/*
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
.PHONY: test
test: dev
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
coverage: ## check code coverage quickly with the default Python
coverage run --source aprsd_repeat_plugins setup.py test
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
test: dev ## Run all the tox tests
tox -p all
build: test
build: test ## Make the build artifact prior to doing an upload
$(VENV)/python3 setup.py sdist bdist_wheel
$(VENV)/twine check dist/*
upload: build
upload: build ## Upload a new version of the plugin
$(VENV)/twine upload dist/*
update-requirements: dev
$(VENV)/pip-compile requirements.in
$(VENV)/pip-compile dev-requirements.in
check: dev # Code format check with isort and black
tox -efmt-check
check: dev ## Code format check with tox and pep8
tox -epep8
fix: dev # fixes code formatting with isort and black
fix: dev ## fixes code formatting with gray
tox -efmt
update-requirements: dev ## Update the requirements.txt and dev-requirements.txt files
rm requirements.txt
rm requirements-dev.txt
touch requirements.txt
touch requirements-dev.txt
$(VENV)/pip-compile --resolver backtracking --annotation-style line requirements.in
$(VENV)/pip-compile --resolver backtracking --annotation-style line requirements-dev.in

View File

@ -1,281 +0,0 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile dev-requirements.in
#
alabaster==0.7.12
# via sphinx
appdirs==1.4.4
# via
# black
# virtualenv
aprsd==2.0.0
# via -r dev-requirements.in
aprslib==0.6.47
# via aprsd
attrs==21.2.0
# via pytest
babel==2.9.1
# via sphinx
backoff==1.10.0
# via
# aprsd
# opencage
black==21.6b0
# via -r dev-requirements.in
certifi==2020.12.5
# via
# aprsd
# requests
cffi==1.14.5
# via
# aprsd
# cryptography
cfgv==3.3.0
# via pre-commit
chardet==4.0.0
# via
# aprsd
# requests
click==7.1.2
# via
# aprsd
# black
# click-completion
# flask
# pip-tools
click-completion==0.5.2
# via aprsd
coverage==5.5
# via pytest-cov
cryptography==3.4.7
# via
# aprsd
# pyopenssl
distlib==0.3.2
# via virtualenv
dnspython==2.1.0
# via
# aprsd
# py3-validate-email
docutils==0.17.1
# via sphinx
filelock==3.0.12
# via
# aprsd
# py3-validate-email
# tox
# virtualenv
flake8==3.9.2
# via
# -r dev-requirements.in
# flake8-polyfill
flake8-polyfill==1.0.2
# via pep8-naming
flask==1.1.2
# via
# aprsd
# flask-classful
# flask-httpauth
flask-classful==0.14.2
# via aprsd
flask-httpauth==4.3.0
# via aprsd
identify==2.2.10
# via pre-commit
idna==2.10
# via
# aprsd
# py3-validate-email
# requests
imagesize==1.2.0
# via sphinx
imapclient==2.2.0
# via aprsd
iniconfig==1.1.1
# via pytest
isort==5.8.0
# via -r dev-requirements.in
itsdangerous==1.1.0
# via
# aprsd
# flask
jinja2==2.11.3
# via
# aprsd
# click-completion
# flask
# sphinx
lxml==4.6.3
# via
# aprsd
# yfinance
markupsafe==1.1.1
# via
# aprsd
# jinja2
mccabe==0.6.1
# via flake8
multitasking==0.0.9
# via
# aprsd
# yfinance
mypy==0.902
# via -r dev-requirements.in
mypy-extensions==0.4.3
# via
# black
# mypy
nodeenv==1.6.0
# via pre-commit
numpy==1.20.2
# via
# aprsd
# pandas
# yfinance
opencage==1.2.2
# via aprsd
packaging==20.9
# via
# pytest
# sphinx
# tox
pandas==1.2.4
# via
# aprsd
# yfinance
pathspec==0.8.1
# via black
pbr==5.6.0
# via
# -r dev-requirements.in
# aprsd
pep517==0.10.0
# via pip-tools
pep8-naming==0.11.1
# via -r dev-requirements.in
pip-tools==6.1.0
# via -r dev-requirements.in
pluggy==0.13.1
# via
# aprsd
# pytest
# tox
pre-commit==2.13.0
# via -r dev-requirements.in
py==1.10.0
# via
# pytest
# tox
py3-validate-email==0.2.16
# via aprsd
pycodestyle==2.7.0
# via flake8
pycparser==2.20
# via
# aprsd
# cffi
pyflakes==2.3.1
# via flake8
pygments==2.9.0
# via sphinx
pyopenssl==20.0.1
# via
# aprsd
# opencage
pyparsing==2.4.7
# via packaging
pytest==6.2.4
# via
# -r dev-requirements.in
# pytest-cov
pytest-cov==2.12.1
# via -r dev-requirements.in
python-dateutil==2.8.1
# via
# aprsd
# pandas
pytz==2021.1
# via
# aprsd
# babel
# pandas
pyyaml==5.4.1
# via
# aprsd
# pre-commit
regex==2021.4.4
# via black
requests==2.25.1
# via
# aprsd
# opencage
# sphinx
# update-checker
# yfinance
shellingham==1.4.0
# via
# aprsd
# click-completion
six==1.15.0
# via
# aprsd
# click-completion
# imapclient
# opencage
# pyopenssl
# python-dateutil
# tox
# virtualenv
snowballstemmer==2.1.0
# via sphinx
sphinx==4.0.2
# via -r dev-requirements.in
sphinxcontrib-applehelp==1.0.2
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==2.0.0
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
thesmuggler==1.0.1
# via aprsd
toml==0.10.2
# via
# black
# mypy
# pep517
# pre-commit
# pytest
# pytest-cov
# tox
tox==3.23.1
# via -r dev-requirements.in
typing-extensions==3.10.0.0
# via mypy
update-checker==0.18.0
# via aprsd
urllib3==1.26.5
# via
# aprsd
# requests
virtualenv==20.4.7
# via
# pre-commit
# tox
werkzeug==1.0.1
# via
# aprsd
# flask
yfinance==0.1.59
# via aprsd
# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools

2
gray.conf Normal file
View File

@ -0,0 +1,2 @@
formatters = add-trailing-comma,autoflake,fixit,isort,pyupgrade,unify
min-python-version = 3.8

111
requirements-dev.txt Normal file
View File

@ -0,0 +1,111 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --annotation-style=line --resolver=backtracking requirements-dev.in
#
alabaster==0.7.12 # via sphinx
aprsd==2.6.1 # via -r requirements-dev.in
aprslib==0.7.2 # via aprsd
attrs==22.1.0 # via aprsd, ax253, kiss3, pytest
ax253==0.1.5.post1 # via aprsd, kiss3
babel==2.11.0 # via sphinx
beautifulsoup4==4.11.1 # via aprsd
bidict==0.22.0 # via aprsd, python-socketio
bitarray==2.6.0 # via aprsd, ax253, kiss3
black==22.12.0 # via -r requirements-dev.in
build==0.9.0 # via pip-tools
cachetools==5.2.0 # via tox
certifi==2022.12.7 # via aprsd, requests
cffi==1.15.1 # via aprsd, cryptography
cfgv==3.3.1 # via pre-commit
chardet==5.1.0 # via tox
charset-normalizer==2.1.1 # via aprsd, requests
click==8.1.3 # via aprsd, black, click-completion, flask, pip-tools
click-completion==0.5.2 # via aprsd
colorama==0.4.6 # via tox
commonmark==0.9.1 # via aprsd, rich
coverage[toml]==6.5.0 # via pytest-cov
cryptography==38.0.4 # via aprsd, pyopenssl
distlib==0.3.6 # via virtualenv
dnspython==2.2.1 # via aprsd, eventlet
docutils==0.19 # via sphinx
eventlet==0.33.2 # via aprsd
exceptiongroup==1.0.4 # via pytest
filelock==3.8.2 # via tox, virtualenv
flake8==6.0.0 # via -r requirements-dev.in, pep8-naming
flask==2.1.2 # via aprsd, flask-classful, flask-httpauth, flask-socketio
flask-classful==0.14.2 # via aprsd
flask-httpauth==4.7.0 # via aprsd
flask-socketio==5.3.2 # via aprsd
greenlet==2.0.1 # via aprsd, eventlet
identify==2.5.10 # via pre-commit
idna==3.4 # via aprsd, requests
imagesize==1.4.1 # via sphinx
imapclient==2.3.1 # via aprsd
importlib-metadata==5.1.0 # via aprsd, ax253, flask, kiss3, sphinx
iniconfig==1.1.1 # via pytest
isort==5.11.3 # via -r requirements-dev.in
itsdangerous==2.1.2 # via aprsd, flask
jinja2==3.1.2 # via aprsd, click-completion, flask, sphinx
kiss3==8.0.0 # via aprsd
markupsafe==2.1.1 # via aprsd, jinja2
mccabe==0.7.0 # via flake8
mypy==0.991 # via -r requirements-dev.in
mypy-extensions==0.4.3 # via black, mypy
nodeenv==1.7.0 # via pre-commit
packaging==22.0 # via build, pyproject-api, pytest, sphinx, tox
pathspec==0.10.3 # via black
pbr==5.11.0 # via -r requirements-dev.in, aprsd
pep517==0.13.0 # via build
pep8-naming==0.13.2 # via -r requirements-dev.in
pip-tools==6.12.1 # via -r requirements-dev.in
platformdirs==2.6.0 # via black, tox, virtualenv
pluggy==1.0.0 # via aprsd, pytest, tox
pre-commit==2.20.0 # via -r requirements-dev.in
pycodestyle==2.10.0 # via flake8
pycparser==2.21 # via aprsd, cffi
pyflakes==3.0.1 # via flake8
pygments==2.13.0 # via aprsd, rich, sphinx
pyopenssl==22.1.0 # via aprsd
pyproject-api==1.2.1 # via tox
pyserial==3.5 # via aprsd, pyserial-asyncio
pyserial-asyncio==0.6 # via aprsd, kiss3
pytest==7.2.0 # via -r requirements-dev.in, pytest-cov
pytest-cov==4.0.0 # via -r requirements-dev.in
python-engineio==4.3.4 # via aprsd, python-socketio
python-socketio==5.7.2 # via aprsd, flask-socketio
pytz==2022.6 # via aprsd, babel
pyyaml==6.0 # via aprsd, pre-commit
requests==2.28.1 # via aprsd, sphinx, update-checker
rich==12.6.0 # via aprsd
shellingham==1.5.0 # via aprsd, click-completion
six==1.16.0 # via aprsd, click-completion, eventlet, imapclient
snowballstemmer==2.2.0 # via sphinx
soupsieve==2.3.2.post1 # via aprsd, beautifulsoup4
sphinx==5.3.0 # via -r requirements-dev.in
sphinxcontrib-applehelp==1.0.2 # via sphinx
sphinxcontrib-devhelp==1.0.2 # via sphinx
sphinxcontrib-htmlhelp==2.0.0 # via sphinx
sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.3 # via sphinx
sphinxcontrib-serializinghtml==1.1.5 # via sphinx
tabulate==0.9.0 # via aprsd
thesmuggler==1.0.1 # via aprsd
toml==0.10.2 # via pre-commit
tomli==2.0.1 # via black, build, coverage, mypy, pep517, pyproject-api, pytest, tox
tox==4.0.14 # via -r requirements-dev.in
typing-extensions==4.4.0 # via black, mypy
ua-parser==0.16.1 # via aprsd, user-agents
update-checker==0.18.0 # via aprsd
urllib3==1.26.13 # via aprsd, requests
user-agents==2.2.0 # via aprsd
virtualenv==20.17.1 # via pre-commit, tox
werkzeug==2.1.2 # via aprsd, flask
wheel==0.38.4 # via pip-tools
wrapt==1.14.1 # via aprsd
zipp==3.11.0 # via aprsd, importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools

View File

@ -1,4 +1,63 @@
pbr
slack_sdk>=3.0
slackeventsapi>=2.1.0
aprsd>=2.0.0
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --annotation-style=line --resolver=backtracking requirements.in
#
aprsd==2.6.1 # via -r requirements.in
aprslib==0.7.2 # via aprsd
attrs==22.1.0 # via aprsd, ax253, kiss3
ax253==0.1.5.post1 # via aprsd, kiss3
beautifulsoup4==4.11.1 # via aprsd
bidict==0.22.0 # via aprsd, python-socketio
bitarray==2.6.0 # via aprsd, ax253, kiss3
certifi==2022.12.7 # via aprsd, requests
cffi==1.15.1 # via aprsd, cryptography
charset-normalizer==2.1.1 # via aprsd, requests
click==8.1.3 # via aprsd, click-completion, flask
click-completion==0.5.2 # via aprsd
commonmark==0.9.1 # via aprsd, rich
cryptography==38.0.4 # via aprsd, pyopenssl
dnspython==2.2.1 # via aprsd, eventlet
eventlet==0.33.2 # via aprsd
flask==2.1.2 # via aprsd, flask-classful, flask-httpauth, flask-socketio, slackeventsapi
flask-classful==0.14.2 # via aprsd
flask-httpauth==4.7.0 # via aprsd
flask-socketio==5.3.2 # via aprsd
greenlet==2.0.1 # via aprsd, eventlet
idna==3.4 # via aprsd, requests
imapclient==2.3.1 # via aprsd
importlib-metadata==5.1.0 # via aprsd, ax253, flask, kiss3
itsdangerous==2.1.2 # via aprsd, flask
jinja2==3.1.2 # via aprsd, click-completion, flask
kiss3==8.0.0 # via aprsd
markupsafe==2.1.1 # via aprsd, jinja2
pbr==5.11.0 # via -r requirements.in, aprsd
pluggy==1.0.0 # via aprsd
pycparser==2.21 # via aprsd, cffi
pyee==9.0.4 # via slackeventsapi
pygments==2.13.0 # via aprsd, rich
pyopenssl==22.1.0 # via aprsd
pyserial==3.5 # via aprsd, pyserial-asyncio
pyserial-asyncio==0.6 # via aprsd, kiss3
python-engineio==4.3.4 # via aprsd, python-socketio
python-socketio==5.7.2 # via aprsd, flask-socketio
pytz==2022.6 # via aprsd
pyyaml==6.0 # via aprsd
requests==2.28.1 # via aprsd, update-checker
rich==12.6.0 # via aprsd
shellingham==1.5.0 # via aprsd, click-completion
six==1.16.0 # via aprsd, click-completion, eventlet, imapclient
slack-sdk==3.19.5 # via -r requirements.in
slackeventsapi==3.0.1 # via -r requirements.in
soupsieve==2.3.2.post1 # via aprsd, beautifulsoup4
tabulate==0.9.0 # via aprsd
thesmuggler==1.0.1 # via aprsd
typing-extensions==4.4.0 # via pyee
ua-parser==0.16.1 # via aprsd, user-agents
update-checker==0.18.0 # via aprsd
urllib3==1.26.13 # via aprsd, requests
user-agents==2.2.0 # via aprsd
werkzeug==2.1.2 # via aprsd, flask
wrapt==1.14.1 # via aprsd
zipp==3.11.0 # via aprsd, importlib-metadata