Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit: add autoflake hook, use dedicated .flake8 config, detail tweaks to RELEASE.md #29

Merged
merged 4 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -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
19 changes: 9 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
15 changes: 8 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -31,16 +30,18 @@ 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`.

```shell
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
Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions simpervisor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ._version import __version__
from .process import KilledProcessError, SupervisedProcess
from ._version import __version__ # noqa
from .process import KilledProcessError, SupervisedProcess # noqa
2 changes: 0 additions & 2 deletions simpervisor/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class KilledProcessError(Exception):
Each SupervisedProcess can be killed only once.
"""

pass


class SupervisedProcess:
def __init__(
Expand Down