Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PyCQA/isort
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.9.3
Choose a base ref
...
head repository: PyCQA/isort
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5.10.0
Choose a head ref

Commits on Jul 29, 2021

  1. Copy the full SHA
    a433308 View commit details

Commits on Jul 30, 2021

  1. Revert "Revert "Fixed #1785: module incorrectly excluded from stdlib …

    …definition.""
    
    This reverts commit 8ae8d50.
    timothycrosley committed Jul 30, 2021
    Copy the full SHA
    acf43fc View commit details
  2. Fix skip

    timothycrosley committed Jul 30, 2021
    Copy the full SHA
    e5bfb28 View commit details

Commits on Aug 2, 2021

  1. Copy the full SHA
    380c03b View commit details
  2. Copy the full SHA
    5e136e6 View commit details
  3. Merge pull request #1797 from hukkin/tomli-depr-warn

    Fix deprecation warning from tomli
    timothycrosley authored Aug 2, 2021
    Copy the full SHA
    3a57146 View commit details

Commits on Aug 7, 2021

  1. Copy the full SHA
    c29c6d6 View commit details

Commits on Aug 11, 2021

  1. Copy the full SHA
    013fb7f View commit details
  2. Regenerate the docs

    timothycrosley committed Aug 11, 2021
    Copy the full SHA
    9695fde View commit details

Commits on Aug 12, 2021

  1. Copy the full SHA
    b06a000 View commit details

Commits on Aug 13, 2021

  1. Copy the full SHA
    e67e474 View commit details
  2. Update lock file

    timothycrosley committed Aug 13, 2021
    Copy the full SHA
    b0007e7 View commit details

Commits on Aug 16, 2021

  1. Spelling fixes

    scop committed Aug 16, 2021
    Copy the full SHA
    dff5e91 View commit details
  2. Copy the full SHA
    5bf1dbc View commit details

Commits on Aug 17, 2021

  1. Merge pull request #1804 from scop/spelling

    Spelling fixes
    timothycrosley authored Aug 17, 2021
    Copy the full SHA
    7cf1bf2 View commit details

Commits on Aug 18, 2021

  1. Merge pull request #1805 from scop/jobs-doc

    Document negative number of jobs semantics
    timothycrosley authored Aug 18, 2021
    Copy the full SHA
    bf9398e View commit details

Commits on Sep 11, 2021

  1. Copy the full SHA
    9749f1b View commit details
  2. Copy the full SHA
    bf78e17 View commit details

Commits on Sep 12, 2021

  1. Copy the full SHA
    a3c44ad View commit details
  2. Copy the full SHA
    3f062b2 View commit details
  3. Copy the full SHA
    44a0393 View commit details
  4. Copy the full SHA
    e5d5a4d View commit details
  5. Copy the full SHA
    e10dbfa View commit details

Commits on Sep 13, 2021

  1. Merge pull request #1809 from mkniewallner/issue/1808

    Issue #1808: Add support for Python 3.10
    timothycrosley authored Sep 13, 2021
    Copy the full SHA
    4ccbd1e View commit details

Commits on Sep 14, 2021

  1. Copy the full SHA
    3f13b80 View commit details
  2. Copy the full SHA
    8621794 View commit details
  3. Merge pull request #1810 from anirudnits/issue/1807

    More extensive exception handling
    timothycrosley authored Sep 14, 2021
    Copy the full SHA
    995e016 View commit details

Commits on Sep 30, 2021

  1. Copy the full SHA
    146e01b View commit details
  2. Copy the full SHA
    960d208 View commit details

Commits on Oct 1, 2021

  1. Merge pull request #1817 from Parnassius/issue/1733

    Add an option to set a footer for every import section
    timothycrosley authored Oct 1, 2021
    Copy the full SHA
    2232954 View commit details
  2. Merge pull request #1818 from sgaist/issue/1646

    feature: implement lines before imports
    timothycrosley authored Oct 1, 2021
    Copy the full SHA
    80c213b View commit details

Commits on Oct 2, 2021

  1. Copy the full SHA
    1072501 View commit details
  2. Copy the full SHA
    febf054 View commit details
  3. Correct linting errors

    anirudnits committed Oct 2, 2021
    Copy the full SHA
    6cb81c1 View commit details
  4. Correct failing test

    anirudnits committed Oct 2, 2021
    Copy the full SHA
    26819c0 View commit details

Commits on Oct 3, 2021

  1. moved trie to utils.py

    anirudnits committed Oct 3, 2021
    Copy the full SHA
    d134aa0 View commit details
  2. Copy the full SHA
    33e49a3 View commit details
  3. Copy the full SHA
    36fcf39 View commit details
  4. Copy the full SHA
    2f2bc56 View commit details

Commits on Oct 5, 2021

  1. Copy the full SHA
    616f710 View commit details

Commits on Oct 6, 2021

  1. Merge pull request #1825 from mkniewallner/ci-py310

    Run tests against Python 3.10
    timothycrosley authored Oct 6, 2021
    Copy the full SHA
    24c98ec View commit details

Commits on Oct 7, 2021

  1. Copy the full SHA
    bc9c7fd View commit details
  2. Copy the full SHA
    59fff6c View commit details
  3. Copy the full SHA
    daa37f4 View commit details
  4. Linting changes

    anirudnits committed Oct 7, 2021
    Copy the full SHA
    6f600cf View commit details
  5. Copy the full SHA
    9989878 View commit details
  6. Copy the full SHA
    29915b0 View commit details
  7. Increase test coverage

    anirudnits committed Oct 7, 2021
    Copy the full SHA
    4435942 View commit details
  8. Add test coverage

    anirudnits committed Oct 7, 2021
    Copy the full SHA
    5e44c66 View commit details
  9. Fix typos in the help message

    1. Several small typos are fixed.
    2. The adjective "same" is always preceded by the article "the".
    3. The word "etc." is always preceded by a comma.
    4. The past participle of the verb "run" is "run" instead of "ran".
    5. Add comma after an if clause.
    6. Add space after a period and before another sentence.
    7. Add space after a comma and before another word.
    MapleCCC committed Oct 7, 2021
    Copy the full SHA
    65d983f View commit details
Showing with 2,209 additions and 1,866 deletions.
  1. +1 −1 .github/workflows/integration.yml
  2. +1 −1 .github/workflows/lint.yml
  3. +5 −3 .github/workflows/test.yml
  4. +10 −0 CHANGELOG.md
  5. +1 −1 Dockerfile
  6. +32 −9 docs/configuration/options.md
  7. +13 −4 docs/configuration/pre-commit.md
  8. +1 −1 docs/contributing/1.-contributing-guide.md
  9. +1 −0 docs/contributing/4.-acknowledgements.md
  10. +3 −3 isort/_future/_dataclasses.py
  11. +0 −23 isort/_vendored/toml/__init__.py
  12. +0 −1,053 isort/_vendored/toml/decoder.py
  13. +0 −295 isort/_vendored/toml/encoder.py
  14. +0 −13 isort/_vendored/toml/ordered.py
  15. +0 −21 isort/_vendored/toml/tz.py
  16. +6 −12 isort/_vendored/{toml → tomli}/LICENSE
  17. +6 −0 isort/_vendored/tomli/__init__.py
  18. +650 −0 isort/_vendored/tomli/_parser.py
  19. +100 −0 isort/_vendored/tomli/_re.py
  20. +1 −0 isort/_vendored/tomli/py.typed
  21. +1 −1 isort/_version.py
  22. +26 −4 isort/api.py
  23. +12 −9 isort/core.py
  24. +1 −1 isort/hooks.py
  25. +41 −13 isort/main.py
  26. +14 −0 isort/output.py
  27. +7 −1 isort/parse.py
  28. +2 −2 isort/pylama_isort.py
  29. +81 −33 isort/settings.py
  30. +1 −1 isort/stdlibs/__init__.py
  31. +1 −0 isort/stdlibs/py27.py
  32. +2 −2 isort/stdlibs/py3.py
  33. +221 −0 isort/stdlibs/py310.py
  34. +1 −0 isort/stdlibs/py35.py
  35. +1 −0 isort/stdlibs/py36.py
  36. +1 −0 isort/stdlibs/py37.py
  37. +1 −0 isort/stdlibs/py38.py
  38. +1 −0 isort/stdlibs/py39.py
  39. +56 −0 isort/utils.py
  40. +374 −343 poetry.lock
  41. +4 −2 pyproject.toml
  42. +2 −2 scripts/mkstdlibs.py
  43. +1 −0 tests/integration/test_hypothesmith.py
  44. +3 −1 tests/integration/test_projects_using_isort.py
  45. +9 −0 tests/integration/test_setting_combinations.py
  46. +2 −2 tests/unit/test_deprecated_finders.py
  47. +1 −1 tests/unit/test_format.py
  48. +233 −6 tests/unit/test_isort.py
  49. +134 −0 tests/unit/test_main.py
  50. +31 −1 tests/unit/test_regressions.py
  51. +61 −0 tests/unit/test_settings.py
  52. +13 −0 tests/unit/test_ticketed_features.py
  53. +38 −0 tests/unit/test_utils.py
  54. +1 −1 tests/unit/utils.py
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: ["3.8"]

steps:
- uses: actions/checkout@v2
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: ["3.8"]

steps:
- uses: actions/checkout@v2
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, ubuntu-18.04, macos-latest, windows-latest]

steps:
@@ -48,11 +48,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
- name: Install poetry
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry
poetry install
- name: Install dependencies
run: poetry install

- name: Test
shell: bash
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,16 @@ Changelog
NOTE: isort follows the [semver](https://semver.org/) versioning standard.
Find out more about isort's release policy [here](https://pycqa.github.io/isort/docs/major_releases/release_policy).

### 5.10.0 November 3 2021
- Implemented #1796: Switch to `tomli` for pyproject.toml configuration loader.
- Fixed #1801: CLI bug (--exend-skip-glob, overrides instead of extending).
- Fixed #1802: respect PATH customization in nested calls to git.
- Fixed #1838: Append only with certain code snippets incorrectly adds imports.
- Added official support for Python 3.10

#### Potentially breaking changes:
- Fixed #1785: `_ast` module incorrectly excluded from stdlib definition.

### 5.9.3 July 28 2021
- Improved text of skipped file message to mention gitignore feature.
- Made all exceptions pickleable.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ FROM python:$VERSION
# Install pip and poetry
RUN python -m pip install --upgrade pip && python -m pip install poetry

# Setup as minimal a stub project as posible, simply to allow caching base dependencies
# Setup as minimal a stub project as possible, simply to allow caching base dependencies
# between builds.
#
# If error is encountered in these steps, can safely be removed locally.
41 changes: 32 additions & 9 deletions docs/configuration/options.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ profiles](https://pycqa.github.io/isort/docs/configuration/profiles.html).

## Python Version

Tells isort to set the known standard library based on the specified Python version. Default is to assume any Python 3 version could be the target, and use a union of all stdlib modules across versions. If auto is specified, the version of the interpreter used to run isort (currently: 38) will be used.
Tells isort to set the known standard library based on the specified Python version. Default is to assume any Python 3 version could be the target, and use a union of all stdlib modules across versions. If auto is specified, the version of the interpreter used to run isort (currently: 39) will be used.

**Type:** String
**Default:** `py3`
@@ -56,28 +56,31 @@ Extends --skip to add additional files that isort should skip over. If you want

## Skip Glob

Additional files that isort should skip over (extending --skip-glob).
Files that isort should skip over.

**Type:** Frozenset
**Default:** `frozenset()`
**Python & Config File Name:** skip_glob
**CLI Flags:**

- --extend-skip-glob
- --sg
- --skip-glob

## Extend Skip Glob

**No Description**
Additional files that isort should skip over (extending --skip-glob).

**Type:** Frozenset
**Default:** `frozenset()`
**Python & Config File Name:** extend_skip_glob
**CLI Flags:** **Not Supported**
**CLI Flags:**

- --extend-skip-glob

## Skip Gitignore

Treat project as a git repository and ignore files listed in .gitignore.
NOTE: This requires git to be installed and accesible from the same shell as isort.
NOTE: This requires git to be installed and accessible from the same shell as isort.

**Type:** Bool
**Default:** `False`
@@ -199,7 +202,7 @@ Force isort to recognize a module as being a local folder. Generally, this is re
Force isort to recognize a module as part of Python's standard library.

**Type:** Frozenset
**Default:** `('_dummy_thread', '_thread', 'abc', 'aifc', 'argparse', 'array', 'ast', 'asynchat', 'asyncio', 'asyncore', 'atexit', 'audioop', 'base64', 'bdb', 'binascii', 'binhex', 'bisect', 'builtins', 'bz2', 'cProfile', 'calendar', 'cgi', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop', 'collections', 'colorsys', 'compileall', 'concurrent', 'configparser', 'contextlib', 'contextvars', 'copy', 'copyreg', 'crypt', 'csv', 'ctypes', 'curses', 'dataclasses', 'datetime', 'dbm', 'decimal', 'difflib', 'dis', 'distutils', 'doctest', 'dummy_threading', 'email', 'encodings', 'ensurepip', 'enum', 'errno', 'faulthandler', 'fcntl', 'filecmp', 'fileinput', 'fnmatch', 'formatter', 'fpectl', 'fractions', 'ftplib', 'functools', 'gc', 'getopt', 'getpass', 'gettext', 'glob', 'graphlib', 'grp', 'gzip', 'hashlib', 'heapq', 'hmac', 'html', 'http', 'imaplib', 'imghdr', 'imp', 'importlib', 'inspect', 'io', 'ipaddress', 'itertools', 'json', 'keyword', 'lib2to3', 'linecache', 'locale', 'logging', 'lzma', 'macpath', 'mailbox', 'mailcap', 'marshal', 'math', 'mimetypes', 'mmap', 'modulefinder', 'msilib', 'msvcrt', 'multiprocessing', 'netrc', 'nis', 'nntplib', 'ntpath', 'numbers', 'operator', 'optparse', 'os', 'ossaudiodev', 'parser', 'pathlib', 'pdb', 'pickle', 'pickletools', 'pipes', 'pkgutil', 'platform', 'plistlib', 'poplib', 'posix', 'posixpath', 'pprint', 'profile', 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'queue', 'quopri', 'random', 're', 'readline', 'reprlib', 'resource', 'rlcompleter', 'runpy', 'sched', 'secrets', 'select', 'selectors', 'shelve', 'shlex', 'shutil', 'signal', 'site', 'smtpd', 'smtplib', 'sndhdr', 'socket', 'socketserver', 'spwd', 'sqlite3', 'sre', 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stat', 'statistics', 'string', 'stringprep', 'struct', 'subprocess', 'sunau', 'symbol', 'symtable', 'sys', 'sysconfig', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios', 'test', 'textwrap', 'threading', 'time', 'timeit', 'tkinter', 'token', 'tokenize', 'trace', 'traceback', 'tracemalloc', 'tty', 'turtle', 'turtledemo', 'types', 'typing', 'unicodedata', 'unittest', 'urllib', 'uu', 'uuid', 'venv', 'warnings', 'wave', 'weakref', 'webbrowser', 'winreg', 'winsound', 'wsgiref', 'xdrlib', 'xml', 'xmlrpc', 'zipapp', 'zipfile', 'zipimport', 'zlib', 'zoneinfo')`
**Default:** `('_ast', '_dummy_thread', '_thread', 'abc', 'aifc', 'argparse', 'array', 'ast', 'asynchat', 'asyncio', 'asyncore', 'atexit', 'audioop', 'base64', 'bdb', 'binascii', 'binhex', 'bisect', 'builtins', 'bz2', 'cProfile', 'calendar', 'cgi', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop', 'collections', 'colorsys', 'compileall', 'concurrent', 'configparser', 'contextlib', 'contextvars', 'copy', 'copyreg', 'crypt', 'csv', 'ctypes', 'curses', 'dataclasses', 'datetime', 'dbm', 'decimal', 'difflib', 'dis', 'distutils', 'doctest', 'dummy_threading', 'email', 'encodings', 'ensurepip', 'enum', 'errno', 'faulthandler', 'fcntl', 'filecmp', 'fileinput', 'fnmatch', 'formatter', 'fpectl', 'fractions', 'ftplib', 'functools', 'gc', 'getopt', 'getpass', 'gettext', 'glob', 'graphlib', 'grp', 'gzip', 'hashlib', 'heapq', 'hmac', 'html', 'http', 'imaplib', 'imghdr', 'imp', 'importlib', 'inspect', 'io', 'ipaddress', 'itertools', 'json', 'keyword', 'lib2to3', 'linecache', 'locale', 'logging', 'lzma', 'macpath', 'mailbox', 'mailcap', 'marshal', 'math', 'mimetypes', 'mmap', 'modulefinder', 'msilib', 'msvcrt', 'multiprocessing', 'netrc', 'nis', 'nntplib', 'ntpath', 'numbers', 'operator', 'optparse', 'os', 'ossaudiodev', 'parser', 'pathlib', 'pdb', 'pickle', 'pickletools', 'pipes', 'pkgutil', 'platform', 'plistlib', 'poplib', 'posix', 'posixpath', 'pprint', 'profile', 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'queue', 'quopri', 'random', 're', 'readline', 'reprlib', 'resource', 'rlcompleter', 'runpy', 'sched', 'secrets', 'select', 'selectors', 'shelve', 'shlex', 'shutil', 'signal', 'site', 'smtpd', 'smtplib', 'sndhdr', 'socket', 'socketserver', 'spwd', 'sqlite3', 'sre', 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stat', 'statistics', 'string', 'stringprep', 'struct', 'subprocess', 'sunau', 'symbol', 'symtable', 'sys', 'sysconfig', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios', 'test', 'textwrap', 'threading', 'time', 'timeit', 'tkinter', 'token', 'tokenize', 'trace', 'traceback', 'tracemalloc', 'tty', 'turtle', 'turtledemo', 'types', 'typing', 'unicodedata', 'unittest', 'urllib', 'uu', 'uuid', 'venv', 'warnings', 'wave', 'weakref', 'webbrowser', 'winreg', 'winsound', 'wsgiref', 'xdrlib', 'xml', 'xmlrpc', 'zipapp', 'zipfile', 'zipimport', 'zlib', 'zoneinfo')`
**Python & Config File Name:** known_standard_library
**CLI Flags:**

@@ -428,6 +431,15 @@ Sets the default section for import options: ('FUTURE', 'STDLIB', 'THIRDPARTY',
**Python & Config File Name:** import_headings
**CLI Flags:** **Not Supported**

## Import Footers

**No Description**

**Type:** Dict
**Default:** `{}`
**Python & Config File Name:** import_footers
**CLI Flags:** **Not Supported**

## Balanced Wrapping

Balances wrapping to produce the most consistent line length possible
@@ -479,6 +491,18 @@ Ensures the output doesn't save if the resulting file contains syntax errors.
- --ac
- --atomic

## Lines Before Imports

How many lines to add before an import section

**Type:** Int
**Default:** `-1`
**Python & Config File Name:** lines_before_imports
**CLI Flags:**

- --lbi
- --lines-before-imports

## Lines After Imports

**No Description**
@@ -796,7 +820,6 @@ Tells isort to honor noqa comments to enforce skipping those comments.

Add an explicitly defined source path (modules within src paths have their imports automatically categorized as first_party). Glob expansion (`*` and `**`) is supported for this option.


**Type:** Tuple
**Default:** `()`
**Python & Config File Name:** src_paths
@@ -1244,7 +1267,7 @@ Explicitly set the settings path or file instead of auto determining based on fi

## Jobs

Number of files to process in parallel.
Number of files to process in parallel. Negative value means use number of CPUs.

**Type:** Int
**Default:** `None`
17 changes: 13 additions & 4 deletions docs/configuration/pre-commit.md
Original file line number Diff line number Diff line change
@@ -7,9 +7,20 @@ isort provides official support for [pre-commit](https://pre-commit.com/).

To use isort's official pre-commit integration add the following config:

```yaml
- repo: https://github.com/pycqa/isort
rev: 5.10.0
hooks:
- id: isort
name: isort (python)
```
under the `repos` section of your projects `.pre-commit-config.yaml` file. Optionally if you want to have different hooks
over different file types (ex: python vs cython vs pyi) you can do so with the following config:

```yaml
- repo: https://github.com/pycqa/isort
rev: 5.8.0
rev: 5.10.0
hooks:
- id: isort
name: isort (python)
@@ -21,12 +32,10 @@ To use isort's official pre-commit integration add the following config:
types: [pyi]
```

under the `repos` section of your projects `.pre-commit-config.yaml` file.

### seed-isort-config

Older versions of isort used a lot of magic to determine import placement, that could easily break when running on CI/CD.
To fix this, a utilitiy called `seed-isort-config` was created. Since isort 5 however, the project has drastically improved its placement
To fix this, a utility called `seed-isort-config` was created. Since isort 5 however, the project has drastically improved its placement
logic and ensured a good level of consistency across environments.
If you have a step in your pre-commit config called `seed-isort-config` or similar, it is highly recommend that you remove this.
It is guaranteed to slow things down, and can conflict with isort's own module placement logic.
2 changes: 1 addition & 1 deletion docs/contributing/1.-contributing-guide.md
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ A local test cycle might look like the following:
3. if #2 fails, debug, save, and goto #1
* `docker run -it isort bash` will get you into the failed environment
* `docker run -v $(git rev-parse --show-toplevel):/isort` will make changes made in the docker environment persist on your local checkout.
**TIP**: combine both to get an interacive docker shell that loads changes made locally, even after build, to quickly rerun that pesky failing test
**TIP**: combine both to get an interactive docker shell that loads changes made locally, even after build, to quickly rerun that pesky failing test
4. `./scripts/docker.sh`
5. if #4 fails, debug, save and goto #1; you may need to specify a different `--build-arg VERSION=$VER`
6. congrats! you are probably ready to push a contribution
1 change: 1 addition & 0 deletions docs/contributing/4.-acknowledgements.md
Original file line number Diff line number Diff line change
@@ -230,6 +230,7 @@ Code Contributors
- Bob (@bobwalker99)
- Martijn Pieters (@mjpieters)
- Asiel Díaz Benítez (@adbenitez)
- Almaz (@monosans)

Documenters
===================
6 changes: 3 additions & 3 deletions isort/_future/_dataclasses.py
Original file line number Diff line number Diff line change
@@ -284,7 +284,7 @@ def __repr__(self):

# This is used to support the PEP 487 __set_name__ protocol in the
# case where we're using a field that contains a descriptor as a
# defaul value. For details on __set_name__, see
# default value. For details on __set_name__, see
# https://www.python.org/dev/peps/pep-0487/#implementation-details.
#
# Note that in _process_class, this Field object is overwritten
@@ -680,7 +680,7 @@ def _get_field(cls, a_name, a_type):
# In addition to checking for actual types here, also check for
# string annotations. get_type_hints() won't always work for us
# (see https://github.com/python/typing/issues/508 for example),
# plus it's expensive and would require an eval for every stirng
# plus it's expensive and would require an eval for every string
# annotation. So, make a best effort to see if this is a ClassVar
# or InitVar using regex's and checking that the thing referenced
# is actually of the correct type.
@@ -1148,7 +1148,7 @@ class C(Base):
raise TypeError(f"Invalid field: {item!r}")

if not isinstance(name, str) or not name.isidentifier():
raise TypeError(f"Field names must be valid identifers: {name!r}")
raise TypeError(f"Field names must be valid identifiers: {name!r}")
if keyword.iskeyword(name):
raise TypeError(f"Field names must not be keywords: {name!r}")
if name in seen:
23 changes: 0 additions & 23 deletions isort/_vendored/toml/__init__.py

This file was deleted.

Loading