Skip to content

[repo-helper] Configuration Update #12

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

Merged
merged 5 commits into from
May 9, 2022
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
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/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'
pull_request:

permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'
pull_request:

permissions:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
Expand All @@ -20,7 +22,7 @@ jobs:
runs-on: "windows-2019"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.7,3.8,3.9,3.10.0-rc.1'
USING_COVERAGE: '3.7,3.8,3.9,3.10'

strategy:
fail-fast: False
Expand All @@ -29,7 +31,7 @@ jobs:
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
- {python-version: "3.10.0-rc.1", testenvs: "py310-dev,build", experimental: True}
- {python-version: "3.10", testenvs: "py310-dev,build", experimental: True}

steps:
- name: Checkout 🛎️
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'
tags:
- '*'
pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
Expand All @@ -21,7 +23,7 @@ jobs:
runs-on: "ubuntu-20.04"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.7,3.8,3.9,3.10.0-rc.1'
USING_COVERAGE: '3.7,3.8,3.9,3.10'

strategy:
fail-fast: False
Expand All @@ -30,7 +32,7 @@ jobs:
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
- {python-version: "3.10.0-rc.1", testenvs: "py310-dev,build", experimental: True}
- {python-version: "3.10", testenvs: "py310-dev,build", experimental: True}

steps:
- name: Checkout 🛎️
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/python_ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
Expand All @@ -20,7 +22,7 @@ jobs:
runs-on: "macos-latest"
continue-on-error: ${{ matrix.config.experimental }}
env:
USING_COVERAGE: '3.7,3.8,3.9,3.10.0-rc.1'
USING_COVERAGE: '3.7,3.8,3.9,3.10'

strategy:
fail-fast: False
Expand All @@ -29,7 +31,7 @@ jobs:
- {python-version: "3.7", testenvs: "py37,build", experimental: False}
- {python-version: "3.8", testenvs: "py38,build", experimental: False}
- {python-version: "3.9", testenvs: "py39,build", experimental: False}
- {python-version: "3.10.0-rc.1", testenvs: "py310-dev,build", experimental: True}
- {python-version: "3.10", testenvs: "py310-dev,build", experimental: True}

steps:
- name: Checkout 🛎️
Expand Down
19 changes: 12 additions & 7 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.1
rev: v0.4.3
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.1.8
hooks:
- id: ensure-dunder-all
files: ^testing_tox/.*\.py$
Expand All @@ -51,7 +51,7 @@ repos:
- id: flake2lint

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0
rev: v1.9.0
hooks:
- id: python-no-eval
- id: rst-backticks
Expand All @@ -67,13 +67,18 @@ repos:
- --keep-runtime-typing

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

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

- repo: https://github.com/python-formate/formate
rev: v0.4.10
hooks:
- id: formate
exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ testing-tox
:target: https://github.com/python-coincidence/testing-tox/actions?query=workflow%3A%22mypy%22
:alt: mypy status

.. |requires| image:: https://requires.io/github/python-coincidence/testing-tox/requirements.svg?branch=master
:target: https://requires.io/github/python-coincidence/testing-tox/requirements/?branch=master
.. |requires| image:: https://dependency-dash.herokuapp.com/github/python-coincidence/testing-tox/badge.svg
:target: https://dependency-dash.herokuapp.com/github/python-coincidence/testing-tox/
:alt: Requirements Status

.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/python-coincidence/testing-tox?logo=codefactor
Expand All @@ -67,7 +67,7 @@ testing-tox
:target: https://github.com/python-coincidence/testing-tox/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.

23 changes: 23 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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:
#!/usr/bin/env bash
tox -e mypy -- --disallow-incomplete-defs --disallow-untyped-defs | grep "Function is missing a .* annotation" || exit 0

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
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,20 @@ namespace_packages = true
check_untyped_defs = true
warn_unused_ignores = true
no_implicit_optional = true
show_error_codes = true

[tool.snippet-fmt]
directives = [ "code-block",]

[tool.dependency-dash."requirements.txt"]
order = 10

[tool.snippet-fmt.languages.python]
reformat = true

[tool.snippet-fmt.languages.TOML]
reformat = true

[tool.snippet-fmt.languages.ini]

[tool.snippet-fmt.languages.json]
16 changes: 11 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ envlist = py37, py38, py39, py310-dev, mypy, build
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 = py37, py38, py39, py310-dev
qa = mypy, lint

[testenv]
setenv = PYTHONDEVMODE = 1
setenv =
PYTHONDEVMODE=1
PIP_DISABLE_PIP_VERSION_CHECK=1
deps = importcheck>=0.1.0
commands =
python --version
Expand Down Expand Up @@ -60,13 +61,14 @@ deps =
flake8-noqa>=1.1.0
flake8-pyi>=20.10.0
flake8-pytest-style>=1.3.0
flake8-quotes>=3.3.0
flake8-slots>=0.1.0
flake8-sphinx-links>=0.0.4
flake8-strftime>=0.1.1
flake8-typing-imports>=1.10.0
git+https://github.com/domdfcoding/flake8-quotes.git
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
pydocstyle>=6.0.0
pygments>=2.7.1
importlib_metadata<4.5.0; python_version<'3.8'
Expand All @@ -76,7 +78,7 @@ commands = python3 -m flake8_rst_docstrings_sphinx testing_tox --allow-toolbox {
basepython = python3.7
ignore_errors = True
changedir = {toxinidir}
deps = mypy==0.910
deps = mypy==0.942
commands = mypy testing_tox {posargs}

[testenv:pyup]
Expand Down Expand Up @@ -107,6 +109,10 @@ multiline-quotes = """
docstring-quotes = """
count = True
min_python_version = 3.7
unused-arguments-ignore-abstract-functions = True
unused-arguments-ignore-overload-functions = True
unused-arguments-ignore-magic-methods = True
unused-arguments-ignore-variadic-names = True

[check-wheel-contents]
ignore = W002
Expand Down