From b79a30c1ff3a4e49c3c276ba0f0d632755988167 Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Thu, 28 Sep 2023 21:12:06 -0400 Subject: [PATCH 01/12] do not install tomli on python>=3.11 --- pyproject.toml | 2 +- yapf/yapflib/file_resources.py | 18 +++++------------- yapf/yapflib/style.py | 13 ++++++------- yapftests/file_resources_test.py | 18 ------------------ yapftests/style_test.py | 9 --------- 5 files changed, 12 insertions(+), 48 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 04519ae24..4414c4a9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ dependencies = [ 'importlib-metadata>=6.6.0', 'platformdirs>=3.5.1', - 'tomli>=2.0.1', + 'tomli>=2.0.1; python_version<"3.11"', ] [project.scripts] diff --git a/yapf/yapflib/file_resources.py b/yapf/yapflib/file_resources.py index 977a2568f..66ab707ac 100644 --- a/yapf/yapflib/file_resources.py +++ b/yapf/yapflib/file_resources.py @@ -28,6 +28,11 @@ from yapf.yapflib import errors from yapf.yapflib import style +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib + CR = '\r' LF = '\n' CRLF = '\r\n' @@ -51,12 +56,6 @@ def _GetExcludePatternsFromYapfIgnore(filename): def _GetExcludePatternsFromPyprojectToml(filename): """Get a list of file patterns to ignore from pyproject.toml.""" ignore_patterns = [] - try: - import tomli as tomllib - except ImportError: - raise errors.YapfError( - 'tomli package is needed for using pyproject.toml as a ' - 'configuration file') if os.path.isfile(filename) and os.access(filename, os.R_OK): with open(filename, 'rb') as fd: @@ -136,13 +135,6 @@ def GetDefaultStyleForDir(dirname, default_style=style.DEFAULT_STYLE): pass # It's okay if it's not there. else: with fd: - try: - import tomli as tomllib - except ImportError: - raise errors.YapfError( - 'tomli package is needed for using pyproject.toml as a ' - 'configuration file') - pyproject_toml = tomllib.load(fd) style_dict = pyproject_toml.get('tool', {}).get('yapf', None) if style_dict is not None: diff --git a/yapf/yapflib/style.py b/yapf/yapflib/style.py index 72f277b25..b43437ee0 100644 --- a/yapf/yapflib/style.py +++ b/yapf/yapflib/style.py @@ -15,11 +15,17 @@ import os import re +import sys import textwrap from configparser import ConfigParser from yapf.yapflib import errors +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib + class StyleConfigError(errors.YapfError): """Raised when there's a problem reading the style configuration.""" @@ -791,13 +797,6 @@ def _CreateConfigParserFromConfigFile(config_filename): config = ConfigParser() if config_filename.endswith(PYPROJECT_TOML): - try: - import tomli as tomllib - except ImportError: - raise errors.YapfError( - 'tomli package is needed for using pyproject.toml as a ' - 'configuration file') - with open(config_filename, 'rb') as style_file: pyproject_toml = tomllib.load(style_file) style_dict = pyproject_toml.get('tool', {}).get('yapf', None) diff --git a/yapftests/file_resources_test.py b/yapftests/file_resources_test.py index c55333f9d..e71742c6a 100644 --- a/yapftests/file_resources_test.py +++ b/yapftests/file_resources_test.py @@ -76,10 +76,6 @@ def test_get_exclude_file_patterns_from_yapfignore_with_wrong_syntax(self): file_resources.GetExcludePatternsForDir(self.test_tmpdir) def test_get_exclude_file_patterns_from_pyproject(self): - try: - import tomli - except ImportError: - return local_ignore_file = os.path.join(self.test_tmpdir, 'pyproject.toml') ignore_patterns = ['temp/**/*.py', 'temp2/*.py'] with open(local_ignore_file, 'w') as f: @@ -93,10 +89,6 @@ def test_get_exclude_file_patterns_from_pyproject(self): sorted(ignore_patterns)) def test_get_exclude_file_patterns_from_pyproject_no_ignore_section(self): - try: - import tomli - except ImportError: - return local_ignore_file = os.path.join(self.test_tmpdir, 'pyproject.toml') ignore_patterns = [] open(local_ignore_file, 'w').close() @@ -106,10 +98,6 @@ def test_get_exclude_file_patterns_from_pyproject_no_ignore_section(self): sorted(ignore_patterns)) def test_get_exclude_file_patterns_from_pyproject_ignore_section_empty(self): - try: - import tomli - except ImportError: - return local_ignore_file = os.path.join(self.test_tmpdir, 'pyproject.toml') ignore_patterns = [] with open(local_ignore_file, 'w') as f: @@ -175,12 +163,6 @@ def test_setup_config(self): file_resources.GetDefaultStyleForDir(test_dir)) def test_pyproject_toml(self): - # An empty pyproject.toml file should not be used - try: - import tomli - except ImportError: - return - pyproject_toml = os.path.join(self.test_tmpdir, 'pyproject.toml') open(pyproject_toml, 'w').close() diff --git a/yapftests/style_test.py b/yapftests/style_test.py index 10c62edc6..64e64a5be 100644 --- a/yapftests/style_test.py +++ b/yapftests/style_test.py @@ -229,11 +229,6 @@ def testErrorUnknownStyleOption(self): style.CreateStyleFromConfig(filepath) def testPyprojectTomlNoYapfSection(self): - try: - import tomli # noqa: F401 - except ImportError: - return - filepath = os.path.join(self.test_tmpdir, 'pyproject.toml') _ = open(filepath, 'w') with self.assertRaisesRegex(style.StyleConfigError, @@ -241,10 +236,6 @@ def testPyprojectTomlNoYapfSection(self): style.CreateStyleFromConfig(filepath) def testPyprojectTomlParseYapfSection(self): - try: - import tomli # noqa: F401 - except ImportError: - return cfg = textwrap.dedent("""\ [tool.yapf] From 44078293c9196a9c0663fcc4f23015fe2d6d3466 Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Thu, 28 Sep 2023 21:41:56 -0400 Subject: [PATCH 02/12] do not install importlib-metadata on <3.10 --- pyproject.toml | 2 +- third_party/yapf_third_party/_ylib2to3/pgen2/driver.py | 8 +++++--- yapf/__init__.py | 7 +++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4414c4a9e..8309592da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ 'Topic :: Software Development :: Quality Assurance', ] dependencies = [ - 'importlib-metadata>=6.6.0', + 'importlib-metadata>=6.6.0; python_version<"3.10"', 'platformdirs>=3.5.1', 'tomli>=2.0.1; python_version<"3.11"', ] diff --git a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py index 9345fe5aa..3561308c2 100644 --- a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py +++ b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py @@ -20,20 +20,22 @@ import pkgutil import sys # Python imports -from configparser import ConfigParser from contextlib import contextmanager from dataclasses import dataclass from dataclasses import field from pathlib import Path -from pkgutil import get_data from typing import Any from typing import Iterator from typing import List from typing import Optional -from importlib_metadata import metadata from platformdirs import user_cache_dir +if sys.version_info >= (3, 10): + from importlib.metadata import metadata +else: + from importlib_metadata import metadata + # Pgen imports from . import grammar from . import parse diff --git a/yapf/__init__.py b/yapf/__init__.py index ebbc75862..02a8c5dc1 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -33,13 +33,16 @@ import os import sys -from importlib_metadata import metadata - from yapf.yapflib import errors from yapf.yapflib import file_resources from yapf.yapflib import style from yapf.yapflib import yapf_api +if sys.version_info >= (3, 10): + from importlib.metadata import metadata +else: + from importlib_metadata import metadata + __version__ = metadata('yapf')['Version'] From 516ecde65c42de0326d051069e23360fa6d9cdcf Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Thu, 28 Sep 2023 21:44:01 -0400 Subject: [PATCH 03/12] do not install importlib-metadata on <3.8 --- pyproject.toml | 2 +- third_party/yapf_third_party/_ylib2to3/pgen2/driver.py | 2 +- yapf/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8309592da..a79ea7c7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ 'Topic :: Software Development :: Quality Assurance', ] dependencies = [ - 'importlib-metadata>=6.6.0; python_version<"3.10"', + 'importlib-metadata>=6.6.0; python_version<"3.8"', 'platformdirs>=3.5.1', 'tomli>=2.0.1; python_version<"3.11"', ] diff --git a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py index 3561308c2..af1b81ae3 100644 --- a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py +++ b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py @@ -31,7 +31,7 @@ from platformdirs import user_cache_dir -if sys.version_info >= (3, 10): +if sys.version_info >= (3, 8): from importlib.metadata import metadata else: from importlib_metadata import metadata diff --git a/yapf/__init__.py b/yapf/__init__.py index 02a8c5dc1..5c9fd60c2 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -38,7 +38,7 @@ from yapf.yapflib import style from yapf.yapflib import yapf_api -if sys.version_info >= (3, 10): +if sys.version_info >= (3, 8): from importlib.metadata import metadata else: from importlib_metadata import metadata From cad17e6a9ade92a0711ad92aea6fec202682ebb0 Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Tue, 3 Oct 2023 23:23:46 -0400 Subject: [PATCH 04/12] Drop importlib metadata --- MANIFEST.in | 1 + pyproject.toml | 12 ++++++------ .../yapf_third_party/_ylib2to3/pgen2/driver.py | 14 ++++++-------- yapf/VERSION | 1 + yapf/__init__.py | 11 +++++------ 5 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 yapf/VERSION diff --git a/MANIFEST.in b/MANIFEST.in index 26bd40ec3..0f01c67db 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include HACKING.md LICENSE AUTHORS CHANGELOG.md CONTRIBUTING.md CONTRIBUTORS +include yapf/VERSION include .coveragerc .editorconfig .flake8 plugins/README.md include plugins/vim/autoload/yapf.vim plugins/vim/plugin/yapf.vim pylintrc include .style.yapf tox.ini .travis.yml .vimrc diff --git a/pyproject.toml b/pyproject.toml index a79ea7c7e..6f87ddfe1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,10 +7,10 @@ name = "yapf" description = "A formatter for Python code" authors = [{ name = "Google Inc." }] maintainers = [{ name = "Bill Wendling", email = "morbo@google.com" }] +dynamic = ["version"] license = { file = "LICENSE" } readme = "README.md" requires-python = ">=3.7" -version = "0.40.2" classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Console', @@ -27,11 +27,7 @@ classifiers = [ 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Quality Assurance', ] -dependencies = [ - 'importlib-metadata>=6.6.0; python_version<"3.8"', - 'platformdirs>=3.5.1', - 'tomli>=2.0.1; python_version<"3.11"', -] +dependencies = ['platformdirs>=3.5.1', 'tomli>=2.0.1; python_version<"3.11"'] [project.scripts] yapf = "yapf:run_main" @@ -51,11 +47,15 @@ python_tag = "py3" include-package-data = true package-dir = { yapf_third_party = 'third_party/yapf_third_party' } +[tool.setuptools.dynamic] +version = { file = "yapf/VERSION" } + [tool.setuptools.packages.find] where = [".", 'third_party'] include = ["yapf*", 'yapftests*'] [tool.setuptools.package-data] +yapf = ['VERSION'] yapf_third_party = [ 'yapf_diff/LICENSE', '_ylib2to3/Grammar.txt', diff --git a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py index af1b81ae3..7d8f7cf78 100644 --- a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py +++ b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py @@ -31,11 +31,6 @@ from platformdirs import user_cache_dir -if sys.version_info >= (3, 8): - from importlib.metadata import metadata -else: - from importlib_metadata import metadata - # Pgen imports from . import grammar from . import parse @@ -208,10 +203,13 @@ def _generate_pickle_name(gt): head, tail = os.path.splitext(grammar_textfile_name) if tail == '.txt': tail = '' + yapf_version = pkgutil.get_data('yapf', 'VERSION') + if yapf_version is None: + raise RuntimeError('Unable to get YAPF version') cache_dir = user_cache_dir( - appname=metadata('yapf')['Name'].upper(), - appauthor=metadata('yapf')['Author'].split(' ')[0], - version=metadata('yapf')['Version'], + appname='YAPF', + appauthor='Google', + version=yapf_version.decode(encoding='utf-8'), ) return cache_dir + os.sep + head + tail + '-py' + '.'.join( map(str, sys.version_info)) + '.pickle' diff --git a/yapf/VERSION b/yapf/VERSION new file mode 100644 index 000000000..385bb682d --- /dev/null +++ b/yapf/VERSION @@ -0,0 +1 @@ +0.40.2 diff --git a/yapf/__init__.py b/yapf/__init__.py index 5c9fd60c2..fb15a40e6 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -31,6 +31,7 @@ import io import logging import os +import pkgutil import sys from yapf.yapflib import errors @@ -38,12 +39,10 @@ from yapf.yapflib import style from yapf.yapflib import yapf_api -if sys.version_info >= (3, 8): - from importlib.metadata import metadata -else: - from importlib_metadata import metadata - -__version__ = metadata('yapf')['Version'] +__version__ = pkgutil.get_data('yapf', 'VERSION') +if __version__ is None: + raise RuntimeError('Unable to get YAPF version') +__version__ = __version__.decode(encoding='utf-8') def _raw_input(): From 4af842d413f4bcc7a29e8ce3a2ecc2f3c3f6ff37 Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Tue, 3 Oct 2023 23:32:14 -0400 Subject: [PATCH 05/12] with tomli dependency use pipx for one-off command runs --- HACKING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HACKING.md b/HACKING.md index 336b234bd..29172aac1 100644 --- a/HACKING.md +++ b/HACKING.md @@ -3,13 +3,13 @@ - To run YAPF on all of YAPF: ```bash -$ PYTHONPATH=$PWD/yapf python -m yapf -i -r . +$ pipx run --spec=${PWD} --no-cache yapf -m -i -r yapf/ yapftests/ third_party/ ``` - To run YAPF on just the files changed in the current git branch: ```bash -$ PYTHONPATH=$PWD/yapf python -m yapf -i $(git diff --name-only @{upstream}) +$ pipx run --spec=${PWD} --no-cache yapf -m -i $(git diff --name-only @{upstream}) ``` ## Testing and building redistributables locally From 95016b63975df267772d13703dd60030aa885af4 Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Tue, 3 Oct 2023 23:37:52 -0400 Subject: [PATCH 06/12] clearer error message --- third_party/yapf_third_party/_ylib2to3/pgen2/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py index 7d8f7cf78..28e82a163 100644 --- a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py +++ b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py @@ -205,7 +205,7 @@ def _generate_pickle_name(gt): tail = '' yapf_version = pkgutil.get_data('yapf', 'VERSION') if yapf_version is None: - raise RuntimeError('Unable to get YAPF version') + raise RuntimeError('Unable to get YAPF version from package data') cache_dir = user_cache_dir( appname='YAPF', appauthor='Google', From 004f978a1ba5d3d0c9145a54f16de164564bf16c Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Tue, 3 Oct 2023 23:42:16 -0400 Subject: [PATCH 07/12] missing .strip() --- third_party/yapf_third_party/_ylib2to3/pgen2/driver.py | 2 +- yapf/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py index 28e82a163..9b308c156 100644 --- a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py +++ b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py @@ -209,7 +209,7 @@ def _generate_pickle_name(gt): cache_dir = user_cache_dir( appname='YAPF', appauthor='Google', - version=yapf_version.decode(encoding='utf-8'), + version=yapf_version.decode(encoding='utf-8').strip(), ) return cache_dir + os.sep + head + tail + '-py' + '.'.join( map(str, sys.version_info)) + '.pickle' diff --git a/yapf/__init__.py b/yapf/__init__.py index fb15a40e6..ec7185132 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -41,8 +41,8 @@ __version__ = pkgutil.get_data('yapf', 'VERSION') if __version__ is None: - raise RuntimeError('Unable to get YAPF version') -__version__ = __version__.decode(encoding='utf-8') + raise RuntimeError('Unable to get YAPF version from package data') +__version__ = __version__.decode(encoding='utf-8').strip() def _raw_input(): From 72fb1f5409ec9c0c883e79586dd60165c073c61b Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Fri, 6 Oct 2023 20:35:56 -0400 Subject: [PATCH 08/12] use a module instead of a file --- HACKING.md | 2 +- MANIFEST.in | 1 - pyproject.toml | 3 +-- third_party/yapf_third_party/_ylib2to3/pgen2/driver.py | 10 +++------- yapf/VERSION | 1 - yapf/__init__.py | 6 +----- 6 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 yapf/VERSION diff --git a/HACKING.md b/HACKING.md index 29172aac1..1c03e8008 100644 --- a/HACKING.md +++ b/HACKING.md @@ -45,7 +45,7 @@ $ pipx run --spec='tox<4' tox -e bdist_wheel -e sdist $ pipx run --spec='tox<4' tox ``` -1. Bump version in `pyproject.toml`. +1. Bump version in `yapf/_version.py`. 1. Build and test redistributables diff --git a/MANIFEST.in b/MANIFEST.in index 0f01c67db..26bd40ec3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,4 @@ include HACKING.md LICENSE AUTHORS CHANGELOG.md CONTRIBUTING.md CONTRIBUTORS -include yapf/VERSION include .coveragerc .editorconfig .flake8 plugins/README.md include plugins/vim/autoload/yapf.vim plugins/vim/plugin/yapf.vim pylintrc include .style.yapf tox.ini .travis.yml .vimrc diff --git a/pyproject.toml b/pyproject.toml index 6f87ddfe1..0b4bde36c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,14 +48,13 @@ include-package-data = true package-dir = { yapf_third_party = 'third_party/yapf_third_party' } [tool.setuptools.dynamic] -version = { file = "yapf/VERSION" } +version = { attr = "yapf._version.__version__" } [tool.setuptools.packages.find] where = [".", 'third_party'] include = ["yapf*", 'yapftests*'] [tool.setuptools.package-data] -yapf = ['VERSION'] yapf_third_party = [ 'yapf_diff/LICENSE', '_ylib2to3/Grammar.txt', diff --git a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py index 9b308c156..76b31a11c 100644 --- a/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py +++ b/third_party/yapf_third_party/_ylib2to3/pgen2/driver.py @@ -31,6 +31,8 @@ from platformdirs import user_cache_dir +from yapf._version import __version__ as yapf_version + # Pgen imports from . import grammar from . import parse @@ -203,14 +205,8 @@ def _generate_pickle_name(gt): head, tail = os.path.splitext(grammar_textfile_name) if tail == '.txt': tail = '' - yapf_version = pkgutil.get_data('yapf', 'VERSION') - if yapf_version is None: - raise RuntimeError('Unable to get YAPF version from package data') cache_dir = user_cache_dir( - appname='YAPF', - appauthor='Google', - version=yapf_version.decode(encoding='utf-8').strip(), - ) + appname='YAPF', appauthor='Google', version=yapf_version) return cache_dir + os.sep + head + tail + '-py' + '.'.join( map(str, sys.version_info)) + '.pickle' diff --git a/yapf/VERSION b/yapf/VERSION deleted file mode 100644 index 385bb682d..000000000 --- a/yapf/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.40.2 diff --git a/yapf/__init__.py b/yapf/__init__.py index ec7185132..c92a59d17 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -34,16 +34,12 @@ import pkgutil import sys +from yapf._version import __version__ from yapf.yapflib import errors from yapf.yapflib import file_resources from yapf.yapflib import style from yapf.yapflib import yapf_api -__version__ = pkgutil.get_data('yapf', 'VERSION') -if __version__ is None: - raise RuntimeError('Unable to get YAPF version from package data') -__version__ = __version__.decode(encoding='utf-8').strip() - def _raw_input(): wrapper = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') From 38b6123e33f814a2fc15f79d5602bafdd3200d9f Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Fri, 6 Oct 2023 20:38:56 -0400 Subject: [PATCH 09/12] missing file --- yapf/_version.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 yapf/_version.py diff --git a/yapf/_version.py b/yapf/_version.py new file mode 100644 index 000000000..ccd8b38ef --- /dev/null +++ b/yapf/_version.py @@ -0,0 +1 @@ +__version__ = '0.42.0' From 615d1e9661be4b699464f49973f35609a8398c47 Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Fri, 6 Oct 2023 20:41:43 -0400 Subject: [PATCH 10/12] remove unused imports --- yapf/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/yapf/__init__.py b/yapf/__init__.py index c92a59d17..cf4be9379 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -31,7 +31,6 @@ import io import logging import os -import pkgutil import sys from yapf._version import __version__ From f4eddb06bc6d80d31cd86324c42bf57a958fa60c Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Fri, 6 Oct 2023 20:45:10 -0400 Subject: [PATCH 11/12] add to CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25c36347b..b54ec21a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ # All notable changes to this project will be documented in this file. # This project adheres to [Semantic Versioning](http://semver.org/). +## (0.40.3) UNRELEASED +### Changes +- Remove dependency on importlib-metadata +- Remove dependency on tomli when Python ?= 3.11 + + ## [0.40.2] 2023-09-22 ### Changes - The verification module has been removed. NOTE: this changes the public APIs From d9d2f351bfc879bdaf7cf0294c2e9b76f53f81e4 Mon Sep 17 00:00:00 2001 From: Kyle Gottfried Date: Fri, 6 Oct 2023 20:45:48 -0400 Subject: [PATCH 12/12] fixup comment --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b54ec21a4..96a72b5a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ## (0.40.3) UNRELEASED ### Changes - Remove dependency on importlib-metadata -- Remove dependency on tomli when Python ?= 3.11 +- Remove dependency on tomli when using >= py311 ## [0.40.2] 2023-09-22