Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
[repo-helper] Configuration Update (#29)
Browse files Browse the repository at this point in the history
* Updated files with 'repo_helper'.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
repo-helper[bot] and pre-commit-ci[bot] committed Sep 5, 2022
1 parent 4e30b3e commit 102b583
Show file tree
Hide file tree
Showing 26 changed files with 294 additions and 105 deletions.
5 changes: 3 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ current_version = 3.0.1
commit = True
tag = True

[bumpversion:file:__pkginfo__.py]

[bumpversion:file:README.rst]

[bumpversion:file:doc-source/index.rst]
Expand All @@ -18,6 +16,9 @@ replace = : str = "{new_version}"

[bumpversion:file:pyproject.toml]

search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:setup.cfg]
search = version = {current_version}
replace = version = {new_version}
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"))
12 changes: 6 additions & 6 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 @@ -28,13 +28,13 @@ exemptMilestones: false
exemptAssignees: false

# Label to use when marking as stale
staleLabel: wontfix
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.

9 changes: 7 additions & 2 deletions .github/workflows/docs_test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
---
name: "Docs Check"
on:
- push
push:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'
pull_request:

permissions:
contents: read
Expand All @@ -12,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: "actions/checkout@v1"
uses: "actions/checkout@v2"

- name: Check for changed files
uses: dorny/paths-filter@v2
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ name: Flake8

on:
push:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'
pull_request:

permissions:
contents: read

jobs:
Run:
name: "Flake8"
runs-on: "ubuntu-18.04"
runs-on: "ubuntu-20.04"

steps:
- name: Checkout 🛎️
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ name: mypy

on:
push:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'
pull_request:

permissions:
contents: read
Expand Down Expand Up @@ -42,7 +47,7 @@ jobs:
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox virtualenv
python -m pip install --upgrade tox virtualenv!=20.16.0
- name: "Run mypy"
if: steps.changes.outputs.code == 'true'
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/octocheese.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

name: "GitHub Releases"
on:
push:
branches: ["master"]
schedule:
- cron: 0 12 * * 2,4,6
- cron: 0 12 * * *

jobs:
Run:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ name: Windows

on:
push:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
Expand Down Expand Up @@ -54,7 +61,7 @@ jobs:
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox virtualenv
python -m pip install --upgrade tox virtualenv!=20.16.0
- name: "Run Tests for Python ${{ matrix.config.python-version }}"
if: steps.setup-python.outcome == 'success'
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/python_ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ name: Linux

on:
push:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'
tags:
- '*'
pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
Expand Down Expand Up @@ -54,7 +62,7 @@ jobs:
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox virtualenv
python -m pip install --upgrade tox virtualenv!=20.16.0
python -m pip install --upgrade coverage_pyver_pragma
- name: "Run Tests for Python ${{ matrix.config.python-version }}"
Expand Down Expand Up @@ -92,21 +100,26 @@ jobs:
path: coverage

- name: Display structure of downloaded files
id: show
run: ls -R
working-directory: coverage
continue-on-error: true

- name: Combine Coverage 👷
if: ${{ steps.show.outcome != 'failure' }}
run: |
shopt -s globstar
python -m coverage combine coverage/**/.coverage
- name: "Upload Combined Coverage Artefact 🚀"
if: ${{ steps.show.outcome != 'failure' }}
uses: actions/upload-artifact@v2
with:
name: "combined-coverage"
path: .coverage

- name: "Upload Combined Coverage to Coveralls"
if: ${{ steps.show.outcome != 'failure' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -123,21 +136,21 @@ jobs:

- name: Setup Python 🐍
uses: "actions/setup-python@v2"
if: startsWith(github.ref, 'refs/tags/')
with:
python-version: 3.8
if: startsWith(github.ref, 'refs/tags/')

- name: Install dependencies 🔧
if: startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox
if: startsWith(github.ref, 'refs/tags/')
- name: Build distributions 📦
if: startsWith(github.ref, 'refs/tags/')
run: |
tox -e build
if: startsWith(github.ref, 'refs/tags/')
- name: Upload distribution to PyPI 🚀
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -146,3 +159,11 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true

- name: Close milestone 🚪
if: startsWith(github.ref, 'refs/tags/')
run: |
python -m pip install --upgrade github3.py packaging
python .github/milestones.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 8 additions & 1 deletion .github/workflows/python_ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ name: macOS

on:
push:
branches-ignore:
- 'repo-helper-update'
- 'pre-commit-ci-update-config'
- 'imgbot'

pull_request:

permissions:
actions: write
issues: write
contents: read

jobs:
Expand Down Expand Up @@ -54,7 +61,7 @@ jobs:
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox virtualenv
python -m pip install --upgrade tox virtualenv!=20.16.0
- name: "Run Tests for Python ${{ matrix.config.python-version }}"
if: steps.setup-python.outcome == 'success'
Expand Down
26 changes: 18 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
exclude: ^$

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

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
Expand All @@ -25,7 +30,7 @@ repos:
- id: end-of-file-fixer

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

- repo: https://github.com/domdfcoding/flake8-dunder-all
rev: v0.1.7
rev: v0.2.2
hooks:
- id: ensure-dunder-all
files: ^ytools/.*\.py$

- repo: https://github.com/domdfcoding/flake2lint
rev: v0.4.0
rev: v0.4.2
hooks:
- 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 @@ -62,19 +67,24 @@ repos:
- --keep-runtime-typing

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

- repo: https://github.com/repo-helper/formate
rev: v0.4.4
- 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$

- repo: https://github.com/domdfcoding/dep_checker
rev: v0.6.2
rev: v0.7.0
hooks:
- id: dep_checker
args:
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ confidence=
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=all
enable=assert-on-tuple,astroid-error,bad-except-order,bad-inline-option,bad-option-value,bad-reversed-sequence,bare-except,binary-op-exception,boolean-datetime,catching-non-exception,cell-var-from-loop,confusing-with-statement,consider-merging-isinstance,consider-using-enumerate,consider-using-ternary,continue-in-finally,cyclic-import,deprecated-pragma,django-not-available,duplicate-except,duplicate-key,eval-used,exec-used,expression-not-assigned,fatal,file-ignored,fixme,global-at-module-level,global-statement,global-variable-not-assigned,global-variable-undefined,http-response-with-content-type-json,http-response-with-json-dumps,invalid-all-object,invalid-characters-in-docstring,len-as-condition,literal-comparison,locally-disabled,locally-enabled,lost-exception,lowercase-l-suffix,misplaced-bare-raise,missing-kwoa,mixed-line-endings,model-has-unicode,model-missing-unicode,model-no-explicit-unicode,model-unicode-not-callable,multiple-imports,new-db-field-with-default,non-ascii-bytes-literals,nonexistent-operator,not-in-loop,notimplemented-raised,overlapping-except,parse-error,pointless-statement,pointless-string-statement,raising-bad-type,raising-non-exception,raw-checker-failed,redefine-in-handler,redefined-argument-from-local,redefined-builtin,redundant-content-type-for-json-response,reimported,relative-import,return-outside-function,simplifiable-if-statement,singleton-comparison,syntax-error,trailing-comma-tuple,trailing-newlines,unbalanced-tuple-unpacking,undefined-all-variable,undefined-loop-variable,unexpected-line-ending-format,unidiomatic-typecheck,unnecessary-lambda,unnecessary-pass,unnecessary-semicolon,unneeded-not,unpacking-non-sequence,unreachable,unrecognized-inline-option,used-before-assignment,useless-else-on-loop,using-constant-test,wildcard-import,yield-outside-function,useless-return
enable=assert-on-tuple,astroid-error,bad-except-order,bad-inline-option,bad-option-value,bad-reversed-sequence,bare-except,binary-op-exception,boolean-datetime,catching-non-exception,cell-var-from-loop,confusing-with-statement,consider-merging-isinstance,consider-using-enumerate,consider-using-ternary,continue-in-finally,deprecated-pragma,django-not-available,duplicate-except,duplicate-key,eval-used,exec-used,expression-not-assigned,fatal,file-ignored,fixme,global-at-module-level,global-statement,global-variable-not-assigned,global-variable-undefined,http-response-with-content-type-json,http-response-with-json-dumps,invalid-all-object,invalid-characters-in-docstring,len-as-condition,literal-comparison,locally-disabled,locally-enabled,lost-exception,lowercase-l-suffix,misplaced-bare-raise,missing-kwoa,mixed-line-endings,model-has-unicode,model-missing-unicode,model-no-explicit-unicode,model-unicode-not-callable,multiple-imports,new-db-field-with-default,non-ascii-bytes-literals,nonexistent-operator,not-in-loop,notimplemented-raised,overlapping-except,parse-error,pointless-statement,pointless-string-statement,raising-bad-type,raising-non-exception,raw-checker-failed,redefine-in-handler,redefined-argument-from-local,redefined-builtin,redundant-content-type-for-json-response,reimported,relative-import,return-outside-function,simplifiable-if-statement,singleton-comparison,syntax-error,trailing-comma-tuple,trailing-newlines,unbalanced-tuple-unpacking,undefined-all-variable,undefined-loop-variable,unexpected-line-ending-format,unidiomatic-typecheck,unnecessary-lambda,unnecessary-pass,unnecessary-semicolon,unneeded-not,unpacking-non-sequence,unreachable,unrecognized-inline-option,used-before-assignment,useless-else-on-loop,using-constant-test,wildcard-import,yield-outside-function,useless-return

[REPORTS]

Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include __pkginfo__.py
include LICENSE
include requirements.txt
prune **/__pycache__
Expand Down

0 comments on commit 102b583

Please sign in to comment.