Skip to content

Commit

Permalink
Updated files with 'repo_helper'.
Browse files Browse the repository at this point in the history
  • Loading branch information
repo-helper[bot] committed Jun 7, 2022
1 parent e7378dc commit 7de4994
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 58 deletions.
28 changes: 28 additions & 0 deletions .github/milestones.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python

# stdlib
import os
import sys

# 3rd party
from github3 import GitHub
from github3.repos import Repository
from packaging.version import InvalidVersion, Version

latest_tag = os.environ["GITHUB_REF_NAME"]

try:
current_version = Version(latest_tag)
except InvalidVersion:
sys.exit()

gh: GitHub = GitHub(token=os.environ["GITHUB_TOKEN"])
repo: Repository = gh.repository(*os.environ["GITHUB_REPOSITORY"].split('/', 1))

for milestone in repo.milestones(state="open"):
try:
milestone_version = Version(milestone.title)
except InvalidVersion:
continue
if milestone_version == current_version:
sys.exit(not milestone.update(state="closed"))
10 changes: 5 additions & 5 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ daysUntilStale: 180

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 180
daysUntilClose: false

# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []
Expand All @@ -31,10 +31,10 @@ exemptAssignees: false
staleLabel: stale

# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
markComment: false
# This issue has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions.

# Comment to post when removing the stale label.
# unmarkComment: >
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/cleanup.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

permissions:
actions: write
issues: write
contents: read

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:

permissions:
actions: write
issues: write
contents: read

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/python_ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

permissions:
actions: write
issues: write
contents: read

jobs:
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exclude: ^$

repos:
- repo: https://github.com/repo-helper/pyproject-parser
rev: v0.4.2
rev: v0.6.1
hooks:
- id: reformat-pyproject

Expand All @@ -30,7 +30,7 @@ repos:
- id: end-of-file-fixer

- repo: https://github.com/domdfcoding/pre-commit-hooks
rev: v0.2.1
rev: v0.3.0
hooks:
- id: requirements-txt-sorter
args:
Expand All @@ -40,7 +40,7 @@ repos:
- id: bind-requirements

- repo: https://github.com/domdfcoding/flake8-dunder-all
rev: v0.1.7
rev: v0.2.1
hooks:
- id: ensure-dunder-all
files: ^pre_commit_hooks/.*\.py$
Expand All @@ -67,18 +67,18 @@ repos:
- --keep-runtime-typing

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
rev: v1.2.0
hooks:
- id: remove-crlf
- id: forbid-crlf

- repo: https://github.com/python-formate/snippet-fmt
rev: v0.1.3
rev: v0.1.4
hooks:
- id: snippet-fmt

- repo: https://github.com/python-formate/formate
rev: v0.4.9
rev: v0.4.10
hooks:
- id: formate
exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ See also: https://github.com/pre-commit/pre-commit
:target: https://github.com/domdfcoding/pre-commit-hooks/commit/master
:alt: GitHub last commit

.. |maintained| image:: https://img.shields.io/maintenance/yes/2021
.. |maintained| image:: https://img.shields.io/maintenance/yes/2022
:alt: Maintenance

.. end shields
Expand Down
16 changes: 0 additions & 16 deletions __pkginfo__.py

This file was deleted.

1 change: 1 addition & 0 deletions formate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ known_third_party = [
"domdf_python_tools",
"github",
"importlib_metadata",
"packaging",
"pytest",
"pytest_cov",
"pytest_randomly",
Expand Down
22 changes: 22 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
default: lint

pdf-docs: latex-docs
make -C doc-source/build/latex/

latex-docs:
SPHINX_BUILDER=latex tox -e docs

unused-imports:
tox -e lint -- --select F401

incomplete-defs:
tox -e lint -- --select MAN

vdiff:
git diff $(repo-helper show version -q)..HEAD

bare-ignore:
greppy '# type:? *ignore(?!\[|\w)' -s

lint: unused-imports incomplete-defs bare-ignore
tox -n qa
13 changes: 0 additions & 13 deletions setup.cfg

This file was deleted.

17 changes: 14 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# * testenv:docs
# * testenv:build
# * testenv:lint
# * testenv:perflint
# * testenv:mypy
# * testenv:pyup
# * testenv:coverage
Expand All @@ -32,9 +33,8 @@ envlist =
skip_missing_interpreters = True
isolated_build = True
requires =
pip>=20.3.3
pip>=21
tox-envlist>=0.2.1
tox-pip-version>=0.0.7

[envlists]
test =
Expand All @@ -52,7 +52,9 @@ qa = mypy, lint
cov = py36, coverage

[testenv]
setenv = PYTHONDEVMODE = 1
setenv =
PYTHONDEVMODE=1
PIP_DISABLE_PIP_VERSION_CHECK=1
deps = -r{toxinidir}/tests/requirements.txt
commands =
python --version
Expand Down Expand Up @@ -94,11 +96,20 @@ deps =
git+https://github.com/domdfcoding/flake8-rst-docstrings-sphinx.git
git+https://github.com/domdfcoding/flake8-rst-docstrings.git
git+https://github.com/python-formate/flake8-unused-arguments.git@magic-methods
git+https://github.com/python-formate/flake8-missing-annotations.git
pydocstyle>=6.0.0
pygments>=2.7.1
importlib_metadata<4.5.0; python_version<'3.8'
commands = python3 -m flake8_rst_docstrings_sphinx pre_commit_hooks tests --allow-toolbox {posargs}

[testenv:perflint]
basepython = python3.6
changedir = {toxinidir}
ignore_errors = True
skip_install = True
deps = perflint
commands = python3 -m perflint pre_commit_hooks {posargs}

[testenv:mypy]
basepython = python3.6
ignore_errors = True
Expand Down

0 comments on commit 7de4994

Please sign in to comment.