Skip to content

Commit

Permalink
Merge pull request #107 from python-humanize/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Apr 4, 2023
2 parents 8e17390 + 8e2e76c commit 0de0fc6
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .github/release-drafter.yml
Expand Up @@ -22,6 +22,11 @@ categories:
exclude-labels:
- "changelog: skip"

autolabeler:
- label: "changelog: skip"
branch:
- "/pre-commit-ci-update-config/"

template: |
$CHANGES
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Expand Up @@ -10,5 +10,5 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: "3.x"
- uses: pre-commit/action@v3.0.0
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
Expand Up @@ -5,11 +5,27 @@ on:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# types: [opened, reopened, synchronize]
workflow_dispatch:

permissions:
contents: read

jobs:
update_release_draft:
if: github.repository_owner == 'python-humanize'
permissions:
# write permission is required to create a GitHub Release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next release notes as pull requests are merged into "main"
Expand Down
18 changes: 10 additions & 8 deletions .pre-commit-config.yaml
Expand Up @@ -6,18 +6,17 @@ repos:
args: [--py37-plus]

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.3.0
hooks:
- id: black
args: [--target-version=py37]

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
rev: v2.0.2
hooks:
- id: autoflake
name: autoflake
Expand Down Expand Up @@ -45,11 +44,14 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-json
- id: check-case-conflict
- id: check-merge-conflict
- id: check-json
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: \.github/ISSUE_TEMPLATE\.md|\.github/PULL_REQUEST_TEMPLATE\.md

- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
Expand All @@ -59,24 +61,24 @@ repos:
files: "src/"

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.1.1
hooks:
- id: mypy
additional_dependencies: [pytest, types-freezegun, types-setuptools]
args: [--strict]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.5.0
rev: 0.9.2
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.1
rev: v0.12.2
hooks:
- id: validate-pyproject

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 0.6.1
rev: 1.0.0
hooks:
- id: tox-ini-fmt

Expand Down
26 changes: 12 additions & 14 deletions pyproject.toml
Expand Up @@ -16,12 +16,6 @@ license = {text = "MIT"}
maintainers = [{name = "Hugo van Kemenade"}]
authors = [{name = "Jason Moiron", email = "jmoiron@jmoiron.net"}]
requires-python = ">=3.7"
dependencies = [
'importlib-metadata; python_version < "3.8"',
]
dynamic = [
"version",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -40,13 +34,18 @@ classifiers = [
"Topic :: Text Processing",
"Topic :: Text Processing :: General",
]
dynamic = [
"version",
]
dependencies = [
'importlib-metadata; python_version < "3.8"',
]
[project.optional-dependencies]
tests = [
"freezegun",
"pytest",
"pytest-cov",
]

[project.urls]
Documentation = "https://python-humanize.readthedocs.io/"
Funding = "https://tidelift.com/subscription/pkg/pypi-humanize?utm_source=pypi-humanize&utm_medium=pypi"
Expand All @@ -55,10 +54,6 @@ Homepage = "https://github.com/python-humanize/humanize"
"Release notes" = "https://github.com/python-humanize/humanize/releases"
Source = "https://github.com/python-humanize/humanize"


[tool.black]
target_version = ["py37"]

[tool.hatch]
version.source = "vcs"

Expand All @@ -70,11 +65,14 @@ artifacts = [
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"

[tool.black]
target_version = ["py37"]

[tool.isort]
profile = "black"

[tool.pydocstyle]
convention = "google"

[tool.pytest.ini_options]
addopts = "--color=yes"

[tool.pydocstyle]
convention = "google"
8 changes: 4 additions & 4 deletions tox.ini
Expand Up @@ -5,10 +5,10 @@ envlist =
py{py3, 312, 311, 310, 39, 38, 37}

[testenv]
passenv =
FORCE_COLOR
extras =
tests
passenv =
FORCE_COLOR
commands =
{envpython} -m pytest --cov humanize --cov tests --cov-report xml {posargs}

Expand All @@ -19,11 +19,11 @@ commands =
mkdocs build

[testenv:lint]
passenv =
PRE_COMMIT_COLOR
skip_install = true
deps =
pre-commit
passenv =
PRE_COMMIT_COLOR
commands =
pre-commit run --all-files --show-diff-on-failure

Expand Down

0 comments on commit 0de0fc6

Please sign in to comment.