diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock new file mode 100644 index 00000000..27c9e5af --- /dev/null +++ b/.github/workflows/actions.lock @@ -0,0 +1,154 @@ +# This file is machine-generated by `gh actions-lock`. +# Do not edit by hand; run `gh actions-lock` to update. +# Docs: https://gh.io/actions-lockfile +version: 'v0.0.3' +workflows: + '.github/workflows/benchmark.yml': + - 'actions/checkout@v7.0.1' + - 'actions/setup-python@v7.1.0' + - 'codspeedhq/action@v5.6.0' + '.github/workflows/docs.yml': + - 'actions/checkout@v7.0.1' + - 'actions/setup-python@v7.1.0' + - 'astral-sh/setup-uv@v10.3.2' + '.github/workflows/labels.yml': + - 'actions/checkout@v7.0.1' + - 'micnncim/action-label-syncer@v1.3.0' + '.github/workflows/lint.yml': + - 'actions/checkout@v7.0.1' + - 'actions/setup-python@v7.1.0' + - 'astral-sh/setup-uv@v10.3.2' + - 'j178/prek-action@v3.1.0' + '.github/workflows/profile-issue-authors.yml': + - 'astral-sh/setup-uv@v10.3.2' + '.github/workflows/profile-pr-authors.yml': + - 'astral-sh/setup-uv@v10.3.2' + '.github/workflows/release-drafter.yml': + - 'release-drafter/release-drafter@v7.10.0' + '.github/workflows/release.yml': + - 'actions/checkout@v7.0.1' + - 'actions/download-artifact@v8.0.2' + - 'hynek/build-and-inspect-python-package@v3.0.2' + - 'pypa/gh-action-pypi-publish@v1.14.3' + '.github/workflows/require-pr-label.yml': + - 'mheap/github-action-required-labels@v5.6.0' + '.github/workflows/test.yml': + - 'actions/checkout@v7.0.1' + - 'actions/setup-python@v7.1.0' + - 'astral-sh/setup-uv@v10.3.2' + - 'codecov/codecov-action@v7.1.1' +dependencies: + 'actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8': + ref: 'v4.2.2' + commit: 'sha1-4d101475d8b20a2381f78447822ac1eab6504dd8' + owner_id: 44036562 + repo_id: 760702757 + uses: + - 'actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d' + 'actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d': + ref: 'v4.2.1' + commit: 'sha1-508db95dd578ae2727ebd6217d5ba78e4fbda05d' + owner_id: 44036562 + repo_id: 760701061 + 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9': + ref: 'v6.1.0' + commit: 'sha1-55cc8345863c7cc4c66a329aec7e433d2d1c52a9' + owner_id: 44036562 + repo_id: 215566462 + 'actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7': + ref: 'v5.0.4' + commit: 'sha1-668228422ae6a00e4ad889ee87cd7109ec5666a7' + owner_id: 44036562 + repo_id: 215566462 + 'actions/checkout@v7.0.1': + ref: 'v7.0.1' + commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' + owner_id: 44036562 + repo_id: 197814629 + 'actions/download-artifact@v8.0.2': + ref: 'v8.0.2' + commit: 'sha1-9000827ccba6bdab643e8b6fd33ac0654aef8333' + owner_id: 44036562 + repo_id: 192626254 + 'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd': + ref: 'v8.0.0' + commit: 'sha1-ed597411d8f924073f98dfc5c65a23a2325f34cd' + owner_id: 44036562 + repo_id: 205262760 + 'actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97': + ref: 'v7.0.0' + commit: 'sha1-5fda3b95a4ea91299a34e894583c3862153e4b97' + owner_id: 44036562 + repo_id: 192625525 + 'actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405': + ref: 'v6.2.0' + commit: 'sha1-a309ff8b426b58ec0e2a45f0f869d46889d02405' + owner_id: 44036562 + repo_id: 192625525 + 'actions/setup-python@v7.1.0': + ref: 'v7.1.0' + commit: 'sha1-6d4fd22b20465ccc0f7354476588e8df7c9ca0e0' + owner_id: 44036562 + repo_id: 192625525 + 'actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9': + ref: 'v7.0.2' + commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9' + owner_id: 44036562 + repo_id: 192625955 + 'astral-sh/setup-uv@v10.3.2': + ref: 'v10.3.2' + commit: 'sha1-07a047e608db84b3d8c06cd9a7c7dcc9c355c18e' + owner_id: 115962839 + repo_id: 846733598 + 'codecov/codecov-action@v7.1.1': + ref: 'v7.1.1' + commit: 'sha1-303a32d7a59b442fa8d48b6a1cc6825c09c847a5' + owner_id: 8226205 + repo_id: 200299178 + uses: + - 'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd' + 'codspeedhq/action@v5.6.0': + ref: 'v5.6.0' + commit: 'sha1-78102a468f96d8e0ccb92d0ec49425753fc42062' + owner_id: 116658140 + repo_id: 561699778 + uses: + - 'actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7' + - 'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd' + 'hynek/build-and-inspect-python-package@v3.0.2': + ref: 'v3.0.2' + commit: 'sha1-67230f7b8410ae0052b39c1efc89d89fff43ff10' + owner_id: 41240 + repo_id: 526525235 + uses: + - 'actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8' + - 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9' + - 'actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97' + - 'actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9' + 'j178/prek-action@v3.1.0': + ref: 'v3.1.0' + commit: 'sha1-44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d' + owner_id: 10510431 + repo_id: 1052387486 + 'mheap/github-action-required-labels@v5.6.0': + ref: 'v5.6.0' + commit: 'sha1-23e10fde7e062233401931a0eece796cd9bf3177' + owner_id: 59130 + repo_id: 272521528 + 'micnncim/action-label-syncer@v1.3.0': + ref: 'v1.3.0' + commit: 'sha1-3abd5ab72fda571e69fffd97bd4e0033dd5f495c' + owner_id: 21333876 + repo_id: 214834296 + 'pypa/gh-action-pypi-publish@v1.14.3': + ref: 'v1.14.3' + commit: 'sha1-7245906fb61fa33a13554f9d5fb856fe61758086' + owner_id: 647025 + repo_id: 178055147 + uses: + - 'actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405' + 'release-drafter/release-drafter@v7.10.0': + ref: 'v7.10.0' + commit: 'sha1-978bb0b30c5ee8cdd332ced253758157150d43f0' + owner_id: 58292376 + repo_id: 139022359 diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index daab4531..12540508 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -12,12 +12,12 @@ jobs: benchmarks: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false - name: Set up Python - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + uses: actions/setup-python@v7.1.0 with: python-version: "3.15" allow-prereleases: true @@ -34,7 +34,7 @@ jobs: run: pip install -e ".[tests]" - name: Run benchmarks - uses: CodSpeedHQ/action@78102a468f96d8e0ccb92d0ec49425753fc42062 # v5.6.0 + uses: CodSpeedHQ/action@v5.6.0 with: mode: simulation run: pytest tests/test_benchmarks.py --codspeed diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7edfaef6..29561a1f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,17 +12,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false - name: Set up Python - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + uses: actions/setup-python@v7.1.0 with: python-version: "3.x" - name: Install uv - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + uses: astral-sh/setup-uv@v10.3.2 - name: Docs run: | diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 529c3543..67a6b9eb 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -14,10 +14,10 @@ jobs: pull-requests: write runs-on: ubuntu-slim steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0 + - uses: micnncim/action-label-syncer@v1.3.0 with: prune: false env: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 17eba67a..4e4888c3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,22 +13,36 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0 + - uses: j178/prek-action@v3.1.0 mypy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + - uses: actions/setup-python@v7.1.0 with: python-version: "3.x" - name: Install uv - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + uses: astral-sh/setup-uv@v10.3.2 - name: Mypy run: uvx --with tox-uv tox -e mypy + + # Fails when .github/workflows/actions.lock is out of sync with the + # workflows or a locked pin no longer verifies upstream. + lockfile: + runs-on: ubuntu-slim + env: + GH_TOKEN: ${{ github.token }} + + steps: + - uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + - run: gh extension install github/gh-actions-lock --pin v0.4.1 + - run: gh actions-lock --verify diff --git a/.github/workflows/profile-issue-authors.yml b/.github/workflows/profile-issue-authors.yml index ed8a96e2..f1139669 100644 --- a/.github/workflows/profile-issue-authors.yml +++ b/.github/workflows/profile-issue-authors.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@v10.3.2 with: enable-cache: false ignore-empty-workdir: true diff --git a/.github/workflows/profile-pr-authors.yml b/.github/workflows/profile-pr-authors.yml index 185303d1..52fbad48 100644 --- a/.github/workflows/profile-pr-authors.yml +++ b/.github/workflows/profile-pr-authors.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + - uses: astral-sh/setup-uv@v10.3.2 with: enable-cache: false ignore-empty-workdir: true diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 443488fe..69e91b46 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-slim steps: # Drafts your next release notes as pull requests are merged into "main" - - uses: release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7.10.0 + - uses: release-drafter/release-drafter@v7.10.0 autolabeler: if: | @@ -36,4 +36,4 @@ jobs: pull-requests: write runs-on: ubuntu-slim steps: - - uses: release-drafter/release-drafter/autolabeler@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7.10.0 + - uses: release-drafter/release-drafter/autolabeler@v7.10.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14b97229..6ab800c0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 persist-credentials: false @@ -36,7 +36,7 @@ jobs: run: | scripts/generate-translation-binaries.sh - - uses: hynek/build-and-inspect-python-package@67230f7b8410ae0052b39c1efc89d89fff43ff10 # v3.0.2 + - uses: hynek/build-and-inspect-python-package@v3.0.2 # Upload to Test PyPI on every commit on main. release-test-pypi: @@ -53,13 +53,13 @@ jobs: steps: - name: Download packages built by build-and-inspect-python-package - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + uses: actions/download-artifact@v8.0.2 with: name: Packages path: dist - name: Upload package to Test PyPI - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 + uses: pypa/gh-action-pypi-publish@v1.14.3 with: repository-url: https://test.pypi.org/legacy/ @@ -77,10 +77,10 @@ jobs: steps: - name: Download packages built by build-and-inspect-python-package - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + uses: actions/download-artifact@v8.0.2 with: name: Packages path: dist - name: Upload package to PyPI - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 + uses: pypa/gh-action-pypi-publish@v1.14.3 diff --git a/.github/workflows/require-pr-label.yml b/.github/workflows/require-pr-label.yml index 69909cba..8deb9667 100644 --- a/.github/workflows/require-pr-label.yml +++ b/.github/workflows/require-pr-label.yml @@ -13,7 +13,7 @@ jobs: pull-requests: write steps: - - uses: mheap/github-action-required-labels@23e10fde7e062233401931a0eece796cd9bf3177 # v5.6.0 + - uses: mheap/github-action-required-labels@v5.6.0 with: mode: minimum count: 1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96321c4b..e5718983 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,12 +27,12 @@ jobs: os: [windows-latest, macos-latest, ubuntu-latest] steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + uses: actions/setup-python@v7.1.0 with: python-version: ${{ matrix.python-version }} allow-prereleases: true @@ -53,7 +53,7 @@ jobs: brew install gettext - name: Install uv - uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 + uses: astral-sh/setup-uv@v10.3.2 - name: Generate translation binaries run: | @@ -64,7 +64,7 @@ jobs: uvx --python ${{ matrix.python-version }} --with tox-uv tox -e py - name: Upload coverage - uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 + uses: codecov/codecov-action@v7.1.1 with: flags: ${{ matrix.os }} name: ${{ matrix.os }} Python ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c00d5b4a..19e393b5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,14 +7,14 @@ priorities: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.10 + rev: v0.17.4 hooks: - id: ruff-check args: [--exit-non-zero-on-fix] priority: fix - repo: https://github.com/psf/black-pre-commit-mirror - rev: 26.10.0 + rev: 26.10.1 hooks: - id: black priority: fix-py @@ -47,7 +47,7 @@ repos: priority: fix-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: "0.38.2" + rev: "0.39.0" hooks: - id: check-github-workflows priority: check @@ -61,25 +61,25 @@ repos: priority: check - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: v1.30.1 + rev: v1.32.0 hooks: - id: zizmor priority: check - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.30.1 + rev: v2.30.6 hooks: - id: pyproject-fmt priority: fix - repo: https://github.com/abravalheri/validate-pyproject - rev: "0.26" + rev: "v0.27" hooks: - id: validate-pyproject priority: check - repo: https://github.com/tox-dev/tox-ini-fmt - rev: 1.9.0 + rev: 1.10.2 hooks: - id: tox-ini-fmt priority: fix @@ -91,7 +91,7 @@ repos: priority: fix - repo: https://github.com/rbubley/mirrors-prettier - rev: v3.9.9 + rev: v3.10.1 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] diff --git a/src/humanize/time.py b/src/humanize/time.py index f8e0a58a..ea91b888 100644 --- a/src/humanize/time.py +++ b/src/humanize/time.py @@ -49,7 +49,7 @@ def __lt__(self, other: Any) -> Any: def _now() -> dt.datetime: import datetime as dt - return dt.datetime.now() # noqa: DTZ005 # naive local time is intentional + return dt.datetime.now() # naive local time is intentional def _abs_timedelta(delta: dt.timedelta) -> dt.timedelta: @@ -318,7 +318,7 @@ def _convert_aware_datetime( import datetime as dt if isinstance(value, dt.datetime) and value.tzinfo is not None: - value = dt.datetime.fromtimestamp(value.timestamp()) # noqa: DTZ006 + value = dt.datetime.fromtimestamp(value.timestamp()) return value @@ -338,7 +338,7 @@ def naturalday(value: dt.date | dt.datetime, format: str = "%b %d") -> str: if isinstance(value, dt.datetime) and value.tzinfo is not None: today = dt.datetime.now(value.tzinfo).date() else: - today = dt.date.today() # noqa: DTZ011 + today = dt.date.today() value = dt.date(value.year, value.month, value.day) except AttributeError: # Passed value wasn't date-ish @@ -369,7 +369,7 @@ def naturaldate(value: dt.date | dt.datetime) -> str: if isinstance(value, dt.datetime) and value.tzinfo is not None: today = dt.datetime.now(value.tzinfo).date() else: - today = dt.date.today() # noqa: DTZ011 + today = dt.date.today() value = dt.date(value.year, value.month, value.day) except AttributeError: # Passed value wasn't date-ish