diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 67eccf9..ba26220 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -22,6 +22,11 @@ categories: exclude-labels: - "changelog: skip" +autolabeler: + - label: "changelog: skip" + branch: + - "/pre-commit-ci-update-config/" + template: | $CHANGES diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8ee0cd1..c78a405 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 9267d82..f3b7162 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -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" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b47718..22051c7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,10 +6,9 @@ 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 @@ -17,7 +16,7 @@ repos: - id: isort - repo: https://github.com/PyCQA/autoflake - rev: v2.0.0 + rev: v2.0.2 hooks: - id: autoflake name: autoflake @@ -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 @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 9534d32..5ca779c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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" @@ -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" @@ -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" diff --git a/tox.ini b/tox.ini index be1d692..ca81785 100644 --- a/tox.ini +++ b/tox.ini @@ -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} @@ -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