diff --git a/.pre-commit-config.yml b/.pre-commit-config.yml
deleted file mode 100644
index 3bd65c2..0000000
--- a/.pre-commit-config.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-# File introduces automated checks triggered on git events
-# to enable run `pip install pre-commit && pre-commit install`
-
-repos:
-  - repo: local
-    hooks:
-      - id: yapf
-        name: yapf
-        language: python
-        entry: yapf
-        args: [-i, -vv]
-        types: [python]
-  - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v3.2.0
-    hooks:
-      - id: trailing-whitespace
-      - id: check-docstring-first
-      - id: check-json
-      - id: check-added-large-files
-      - id: check-yaml
-      - id: debug-statements
-      - id: requirements-txt-fixer
-      - id: check-merge-conflict
-      - id: double-quote-string-fixer
-      - id: end-of-file-fixer
-      - id: sort-simple-yaml
-  - repo: meta
-    hooks:
-      - id: check-hooks-apply
-      - id: check-useless-excludes
diff --git a/.pre-commit-hooks.yml b/.pre-commit-hooks.yml
deleted file mode 100644
index 3eba1f2..0000000
--- a/.pre-commit-hooks.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-# File configures YAPF to be used as a git hook with https://github.com/pre-commit/pre-commit
-
-- id: yapf
-  name: yapf
-  description: "A formatter for Python files."
-  entry: yapf
-  args: [-i] #inplace
-  language: python
-  types: [python]
diff --git a/yapf/__init__.py b/yapf/__init__.py
index 14c693d..39b15c9 100644
--- a/yapf/__init__.py
+++ b/yapf/__init__.py
@@ -27,19 +27,34 @@ If no filenames are specified, YAPF reads the code from stdin.
 """
 
 import argparse
+import codecs
+import io
 import logging
 import os
 import sys
 
 from yapf.yapflib import errors
 from yapf.yapflib import file_resources
-from yapf.yapflib import py3compat
 from yapf.yapflib import style
 from yapf.yapflib import yapf_api
 
 __version__ = '0.33.0'
 
 
+def _raw_input():
+  wrapper = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
+  return wrapper.buffer.raw.readall().decode('utf-8')
+
+
+def _removeBOM(source):
+  """Remove any Byte-order-Mark bytes from the beginning of a file."""
+  bom = codecs.BOM_UTF8
+  bom = bom.decode('utf-8')
+  if source.startswith(bom):
+    return source[len(bom):]
+  return source
+
+
 def main(argv):
   """Main program.
 
@@ -83,7 +98,7 @@ def main(argv):
         # user will need to hit 'Ctrl-D' more than once if they're inputting
         # the program by hand. 'raw_input' throws an EOFError exception if
         # 'Ctrl-D' is pressed, which makes it easy to bail out of this loop.
-        original_source.append(py3compat.raw_input())
+        original_source.append(_raw_input())
       except EOFError:
         break
       except KeyboardInterrupt:
@@ -93,7 +108,7 @@ def main(argv):
       style_config = file_resources.GetDefaultStyleForDir(os.getcwd())
 
     source = [line.rstrip() for line in original_source]
-    source[0] = py3compat.removeBOM(source[0])
+    source[0] = _removeBOM(source[0])
 
     try:
       reformatted_source, _ = yapf_api.FormatCode(
diff --git a/yapf/yapflib/py3compat.py b/yapf/yapflib/py3compat.py
deleted file mode 100644
index c95d4b5..0000000
--- a/yapf/yapflib/py3compat.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2015 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Utilities for Python2 / Python3 compatibility."""
-
-import codecs
-import io
-import sys
-
-PY38 = sys.version_info[0] >= 3 and sys.version_info[1] >= 8
-
-
-def raw_input():
-  wrapper = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
-  return wrapper.buffer.raw.readall().decode('utf-8')
-
-
-def removeBOM(source):
-  """Remove any Byte-order-Mark bytes from the beginning of a file."""
-  bom = codecs.BOM_UTF8
-  bom = bom.decode('utf-8')
-  if source.startswith(bom):
-    return source[len(bom):]
-  return source

diff --git a/yapftests/main_test.py b/yapftests/main_test.py
index 5b73476..7241a02 100644
--- a/yapftests/main_test.py
+++ b/yapftests/main_test.py
@@ -20,8 +20,6 @@ import sys
 import unittest
 import yapf
 
-from yapf.yapflib import py3compat
-
 from yapftests import yapf_test_helper
 
 
@@ -79,11 +77,11 @@ def patched_input(code):
     return next(lines)
 
   try:
-    orig_raw_import = yapf.py3compat.raw_input
-    yapf.py3compat.raw_input = patch_raw_input
+    orig_raw_import = yapf._raw_input
+    yapf._raw_input = patch_raw_input
     yield
   finally:
-    yapf.py3compat.raw_input = orig_raw_import
+    yapf._raw_input = orig_raw_import
 
 
 class RunMainTest(yapf_test_helper.YAPFTest):
diff --git a/yapftests/reformatter_basic_test.py b/yapftests/reformatter_basic_test.py
index a8b2fdd..2edbc31 100644
--- a/yapftests/reformatter_basic_test.py
+++ b/yapftests/reformatter_basic_test.py
@@ -13,15 +13,17 @@
 # limitations under the License.
 """Basic tests for yapf.reformatter."""
 
+import sys
 import textwrap
 import unittest
 
-from yapf.yapflib import py3compat
 from yapf.yapflib import reformatter
 from yapf.yapflib import style
 
 from yapftests import yapf_test_helper
 
+PY38 = sys.version_info[0] >= 3 and sys.version_info[1] >= 8
+
 
 class BasicReformatterTest(yapf_test_helper.YAPFTest):
 
@@ -3162,7 +3164,7 @@ my_dict = {
     finally:
       style.SetGlobalStyle(style.CreateYapfStyle())
 
-  @unittest.skipUnless(py3compat.PY38, 'Requires Python 3.8')
+  @unittest.skipUnless(PY38, 'Requires Python 3.8')
   def testWalrus(self):
     unformatted_code = textwrap.dedent("""\
       if (x  :=  len([1]*1000)>100):

Resolve duplicate pre-commit files?
Hi!

There are two pre-commit files in here that have identical copies as both `.yaml` and `.yml`:

```console
# ls -l .pre-commit-* | sed "s,${USER},user,g"
-rw-r--r-- 1 user user 803 Apr 19 00:29 .pre-commit-config.yaml
-rw-r--r-- 1 user user 803 Apr 19 00:29 .pre-commit-config.yml
-rw-r--r-- 1 user user 239 Apr 19 00:29 .pre-commit-hooks.yaml
-rw-r--r-- 1 user user 239 Apr 19 00:29 .pre-commit-hooks.yml

# diff -u .pre-commit-config.y{a,}ml && echo identical
identical

# diff -u .pre-commit-hooks.y{a,}ml && echo identical
identical
```

Is there a reason we need both of these still today? Also, does anyone know what it was that got us into this duplication back then?

Thanks and best, Sebastian
yapftests/main_test.py::MainTest::testEchoBadInput yapftests/main_test.py::MainTest::testEchoInput yapftests/main_test.py::MainTest::testEchoInputWithStyle
yapftests/main_test.py::RunMainTest::testShouldHandleYapfError yapftests/main_test.py::MainTest::testHelp yapftests/main_test.py::MainTest::testNoPythonFilesMatched yapftests/reformatter_basic_test.py::BasicReformatterTest::testArgsAndKwargsFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testBinaryOperators yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLineBeforeClassDocstring yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLineBeforeModuleDocstring yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLinesAtEndOfFile yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLinesBeforeDecorators yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLinesBeforeFunctionsNotInColumnZero yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLinesBetweenTopLevelImportsAndVariables yapftests/reformatter_basic_test.py::BasicReformatterTest::testClosingBracketIndent yapftests/reformatter_basic_test.py::BasicReformatterTest::testClosingBracketsInlinedInCall yapftests/reformatter_basic_test.py::BasicReformatterTest::testCoalesceBracketsOnDict yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentBeforeFuncDef yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentBetweenDecorators yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentColumnLimitOverflow yapftests/reformatter_basic_test.py::BasicReformatterTest::testComments yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentsInDataLiteral yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentsWithContinuationMarkers yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentsWithTrailingSpaces yapftests/reformatter_basic_test.py::BasicReformatterTest::testComprehensionForAndIf yapftests/reformatter_basic_test.py::BasicReformatterTest::testContiguousList yapftests/reformatter_basic_test.py::BasicReformatterTest::testContinuationIndent yapftests/reformatter_basic_test.py::BasicReformatterTest::testContinuationMarkerAfterStringWithContinuation yapftests/reformatter_basic_test.py::BasicReformatterTest::testContinuationMarkers yapftests/reformatter_basic_test.py::BasicReformatterTest::testContinuationSpaceRetention yapftests/reformatter_basic_test.py::BasicReformatterTest::testDedentClosingBracketsWithTypeAnnotationExceedingLineLength yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictSetGenerator yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictionaryElementsOnOneLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictionaryMakerFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictionaryOnOwnLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictionaryValuesOnOwnLines yapftests/reformatter_basic_test.py::BasicReformatterTest::testDisableEndingCommaHeuristic yapftests/reformatter_basic_test.py::BasicReformatterTest::testDocstringAndMultilineComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testDocstrings yapftests/reformatter_basic_test.py::BasicReformatterTest::testDontAddBlankLineAfterMultilineString yapftests/reformatter_basic_test.py::BasicReformatterTest::testDontSplitKeywordValueArguments yapftests/reformatter_basic_test.py::BasicReformatterTest::testEllipses yapftests/reformatter_basic_test.py::BasicReformatterTest::testEmptyContainers yapftests/reformatter_basic_test.py::BasicReformatterTest::testEndingComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testEndingWhitespaceAfterSimpleStatement yapftests/reformatter_basic_test.py::BasicReformatterTest::testExcessCharacters yapftests/reformatter_basic_test.py::BasicReformatterTest::testExcessLineCountWithDefaultKeywords yapftests/reformatter_basic_test.py::BasicReformatterTest::testExpressionPenalties yapftests/reformatter_basic_test.py::BasicReformatterTest::testForceMultilineDict_False yapftests/reformatter_basic_test.py::BasicReformatterTest::testForceMultilineDict_True yapftests/reformatter_basic_test.py::BasicReformatterTest::testFormattingListComprehensions yapftests/reformatter_basic_test.py::BasicReformatterTest::testFunctionCallArguments yapftests/reformatter_basic_test.py::BasicReformatterTest::testFunctionCallContinuationLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testFunctionCallInDict yapftests/reformatter_basic_test.py::BasicReformatterTest::testFunctionCallInNestedDict yapftests/reformatter_basic_test.py::BasicReformatterTest::testI18n yapftests/reformatter_basic_test.py::BasicReformatterTest::testI18nCommentsInDataLiteral yapftests/reformatter_basic_test.py::BasicReformatterTest::testI18nNonFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testIfConditionalParens yapftests/reformatter_basic_test.py::BasicReformatterTest::testIfExpressionWithFunctionCall yapftests/reformatter_basic_test.py::BasicReformatterTest::testImportAsList yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentBlankLines yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsInDict yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsInFunctionCall yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsInList yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsInTuple yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsWithTypeAnnotationExceedingLineLength yapftests/reformatter_basic_test.py::BasicReformatterTest::testLineDepthOfSingleLineStatement yapftests/reformatter_basic_test.py::BasicReformatterTest::testLineWrapInForExpression yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehension yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehensionPreferNoBreakForTrivialExpression yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehensionPreferOneLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehensionPreferOneLineOverArithmeticSplit yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehensionPreferThreeLinesForLineWrap yapftests/reformatter_basic_test.py::BasicReformatterTest::testListWithFunctionCalls yapftests/reformatter_basic_test.py::BasicReformatterTest::testMatchingParenSplittingMatching yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineCommentReformatted yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineDictionaryKeys yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineDocstringAndMultilineComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineLambdas yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineShebang yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineString yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultipleContinuationMarkers yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultipleDictionariesInList yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultipleUgliness yapftests/reformatter_basic_test.py::BasicReformatterTest::testNamedAssignNotAtEndOfLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testNestedDictionary yapftests/reformatter_basic_test.py::BasicReformatterTest::testNestedListsInDictionary yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoBreakOutsideOfBracket yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoKeywordArgumentBreakage yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoPenaltySplitting yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoQueueSeletionInMiddleOfLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSpaceBetweenUnaryOpAndOpeningParen yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSpacesAroundKeywordDefaultValues yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSpacesBetweenOpeningBracketAndStartingOperator yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSpacesBetweenSubscriptsAndCalls yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingAroundCompOperators yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingAroundTermOperators yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingBeforeEndingSubscriptBracket yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingOnSingleArgument yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingWhenBinPacking yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingWithinSubscriptList yapftests/reformatter_basic_test.py::BasicReformatterTest::testNotInParams yapftests/reformatter_basic_test.py::BasicReformatterTest::testNotSplittingAfterSubscript yapftests/reformatter_basic_test.py::BasicReformatterTest::testOpeningAndClosingBrackets yapftests/reformatter_basic_test.py::BasicReformatterTest::testOverColumnLimit yapftests/reformatter_basic_test.py::BasicReformatterTest::testPseudoParens yapftests/reformatter_basic_test.py::BasicReformatterTest::testRelativeImportStatements yapftests/reformatter_basic_test.py::BasicReformatterTest::testRelaxArraySubscriptAffinity yapftests/reformatter_basic_test.py::BasicReformatterTest::testSimpleFunctionsWithTrailingComments yapftests/reformatter_basic_test.py::BasicReformatterTest::testSimpleMultilineCode yapftests/reformatter_basic_test.py::BasicReformatterTest::testSimpleMultilineWithComments yapftests/reformatter_basic_test.py::BasicReformatterTest::testSingleComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testSingleLineFunctions yapftests/reformatter_basic_test.py::BasicReformatterTest::testSingleLineList yapftests/reformatter_basic_test.py::BasicReformatterTest::testSpaceAfterNotOperator yapftests/reformatter_basic_test.py::BasicReformatterTest::testSpaceBetweenStringAndParentheses yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitAfterComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitListWithComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitListWithInterspersedComments yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitListWithTerminatingComma yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitStringsIfSurroundedByParens yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingAllArgs yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingArgumentsTerminatedByComma yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingArraysSensibly yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingBeforeFirstArgumentOnCompoundStatement yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingBeforeFirstArgumentOnFunctionCall yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingBeforeFirstArgumentOnFunctionDefinition yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingBeforeFirstElementListArgument yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingOneArgumentList yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingTopLevelAllArgs yapftests/reformatter_basic_test.py::BasicReformatterTest::testStableDictionaryFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testStableInlinedDictionaryFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testSubscriptExpression yapftests/reformatter_basic_test.py::BasicReformatterTest::testSubscriptExpressionTerminatedByComma yapftests/reformatter_basic_test.py::BasicReformatterTest::testTrailerOnSingleLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testTrailingCommaAndBracket yapftests/reformatter_basic_test.py::BasicReformatterTest::testTupleCohesion yapftests/reformatter_basic_test.py::BasicReformatterTest::testTupleCommaBeforeLastParen yapftests/reformatter_basic_test.py::BasicReformatterTest::testUnaryNotOperator yapftests/reformatter_basic_test.py::BasicReformatterTest::testUnaryOpInDictionaryValue yapftests/reformatter_basic_test.py::BasicReformatterTest::testUnbreakableNot yapftests/reformatter_basic_test.py::BasicReformatterTest::testUnformattedAfterMultilineString yapftests/reformatter_basic_test.py::BasicReformatterTest::testWalrus