diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..246a778 --- /dev/null +++ b/.flake8 @@ -0,0 +1,11 @@ +# flake8 is used for linting Python code setup to automatically run with +# pre-commit. +# +# ref: https://flake8.pycqa.org/en/latest/user/configuration.html +# +[flake8] +# E: style errors +# W: style warnings +# C: complexity +# D: docstring warnings (unused pydocstyle extension) +ignore = E, C, W, D diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af95b5b..738dabb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,15 @@ repos: hooks: - id: pyupgrade args: - - --py37-plus + - --py38-plus + + # Autoformat: Python code + - repo: https://github.com/PyCQA/autoflake + rev: v2.0.2 + hooks: + - id: autoflake + args: + - --in-place # Autoformat: Python code - repo: https://github.com/pycqa/isort @@ -49,15 +57,6 @@ repos: rev: "6.0.0" hooks: - id: flake8 - # Ignore style and complexity - # E: style errors - # W: style warnings - # C: complexity - # - args: - - --ignore=E,C,W - - --builtins=c - - --exclude=__init__.py # pre-commit.ci config reference: https://pre-commit.ci/#configuration ci: diff --git a/RELEASE.md b/RELEASE.md index d4ea1ca..70109e6 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,16 +1,15 @@ # How to make a release -`simpervisor` is a package available on [PyPI][] and [conda-forge][]. +`simpervisor` is a package available on [PyPI] and [conda-forge]. These are instructions on how to make a release. ## Pre-requisites -- Push rights to [github.com/jupyterhub/simpervisor][] -- Push rights to [conda-forge/simpervisor-feedstock][] +- Push rights to [github.com/jupyterhub/simpervisor] ## Steps to make a release -1. Create a PR updating `CHANGELOG.md` with [github-activity][] and continue +1. Create a PR updating `CHANGELOG.md` with [github-activity] and continue only when its merged. 1. Checkout main and make sure it is up to date. @@ -31,7 +30,7 @@ These are instructions on how to make a release. tbump ${VERSION} ``` - Following this, the [CI system][] will build and publishe a release. + Following this, the [CI system] will build and publishe a release. 1. Reset the version back to dev, e.g. `1.0.1.dev` after releasing `1.0.0`. @@ -39,8 +38,10 @@ These are instructions on how to make a release. tbump --no-tag ${NEXT_VERSION}.dev ``` -1. Following the release to PyPI, an automated PR should arrive to - [conda-forge/simpervisor-feedstock][] with instructions. +1. Following the release to PyPI, an automated PR should arrive within 24 hours + to [conda-forge/simpervisor-feedstock] with instructions on releasing to + conda-forge. You are welcome to volunteer doing this, but aren't required as + part of making this release to PyPI. [github-activity]: https://github.com/executablebooks/github-activity [github.com/jupyterhub/simpervisor]: https://github.com/jupyterhub/simpervisor diff --git a/pyproject.toml b/pyproject.toml index 310df3b..bbfadb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,17 @@ addopts = "--verbose --color=yes --durations=10" asyncio_mode = "auto" +# autoflake is used for autoformatting Python code +# +# ref: https://github.com/PyCQA/autoflake#readme +# +[tool.autoflake] +ignore-init-module-imports = true +remove-all-unused-imports = true +remove-duplicate-keys = true +remove-unused-variables = true + + # black is used for autoformatting Python code # # ref: https://black.readthedocs.io/en/stable/ diff --git a/simpervisor/__init__.py b/simpervisor/__init__.py index 27b2a15..81ee46d 100644 --- a/simpervisor/__init__.py +++ b/simpervisor/__init__.py @@ -1,2 +1,2 @@ -from ._version import __version__ -from .process import KilledProcessError, SupervisedProcess +from ._version import __version__ # noqa +from .process import KilledProcessError, SupervisedProcess # noqa diff --git a/simpervisor/process.py b/simpervisor/process.py index 416c3b7..beed5c6 100644 --- a/simpervisor/process.py +++ b/simpervisor/process.py @@ -16,8 +16,6 @@ class KilledProcessError(Exception): Each SupervisedProcess can be killed only once. """ - pass - class SupervisedProcess: def __init__(