Merge pull request #850 from ericfrederich/fix-requirements-fixer
Stop pkg_resources from being added as well
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 6d6d291..937696b 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.5.0
+ rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@@ -23,7 +23,7 @@
hooks:
- id: add-trailing-comma
- repo: https://github.com/asottile/pyupgrade
- rev: v3.15.1
+ rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py38-plus]
diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml
index c0d811c..4b4d0cf 100644
--- a/.pre-commit-hooks.yaml
+++ b/.pre-commit-hooks.yaml
@@ -145,7 +145,7 @@
language: python
types: [text]
- id: fix-encoding-pragma
- name: fix python encoding pragma
+ name: fix python encoding pragma (deprecated)
description: 'adds # -*- coding: utf-8 -*- to the top of python files.'
language: python
entry: fix-encoding-pragma
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c1daaba..bf99d9f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,17 @@
+4.6.0 - 2024-04-06
+==================
+
+### Features
+- `requirements-txt-fixer`: remove duplicate packages.
+ - #1014 PR by @vhoulbreque-withings.
+ - #960 issue @csibe17.
+
+### Migrating
+- `fix-encoding-pragma`: deprecated -- will be removed in 5.0.0. use
+ [pyupgrade](https://github.com/asottile/pyupgrade) or some other tool.
+ - #1033 PR by @mxr.
+ - #1032 issue by @mxr.
+
4.5.0 - 2023-10-07
==================
diff --git a/README.md b/README.md
index 9ae7ec5..4992baf 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
```yaml
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.5.0 # Use the ref you want to point at
+ rev: v4.6.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
# - id: ...
@@ -127,6 +127,9 @@
removes UTF-8 byte order marker
#### `fix-encoding-pragma`
+
+_Deprecated since py2 is EOL - use [pyupgrade](https://github.com/asottile/pyupgrade) instead._
+
Add `# -*- coding: utf-8 -*-` to the top of python files.
- To remove the coding pragma pass `--remove` (useful in a python3-only codebase)
diff --git a/pre_commit_hooks/fix_encoding_pragma.py b/pre_commit_hooks/fix_encoding_pragma.py
index 60c71ee..eee6705 100644
--- a/pre_commit_hooks/fix_encoding_pragma.py
+++ b/pre_commit_hooks/fix_encoding_pragma.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import argparse
+import sys
from typing import IO
from typing import NamedTuple
from typing import Sequence
@@ -107,6 +108,13 @@
def main(argv: Sequence[str] | None = None) -> int:
+ print(
+ 'warning: this hook is deprecated and will be removed in a future '
+ 'release because py2 is EOL. instead, use '
+ 'https://github.com/asottile/pyupgrade',
+ file=sys.stderr,
+ )
+
parser = argparse.ArgumentParser(
'Fixes the encoding pragma of python files',
)
diff --git a/setup.cfg b/setup.cfg
index 6a4c459..82a5457 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = pre_commit_hooks
-version = 4.5.0
+version = 4.6.0
description = Some out-of-the-box hooks for pre-commit.
long_description = file: README.md
long_description_content_type = text/markdown