Skip to content

Commit cb0cde5

Browse files
committed
📦Ensure to always import disutils after setuptools
Ref: pypa/setuptools#2256
1 parent 44c0407 commit cb0cde5

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.flake8

+4-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ format = wemake
4545
# IMPORTANT: avoid using ignore option, always use extend-ignore instead
4646
# Completely and unconditionally ignore the following errors:
4747
extend-ignore =
48+
I # flake8-isort is drunk + we have isort integrated into pre-commit
4849
WPS306 # "Found class without a base class: *" -- we have metaclass shims
4950
WPS422 # "Found future import: *" -- we need these for multipython
5051

@@ -59,7 +60,9 @@ max-line-length = 160
5960
# Allow certain violations in certain files:
6061
per-file-ignores =
6162
# in-tree PEP517 build backend nees a lot of legit `noqa`s
62-
bin/pep517_backend.py: WPS402
63+
# also E800 reports a lot of false-positives for legit
64+
# tool-related comments:
65+
bin/pep517_backend.py: E800, WPS402
6366

6467
# Sphinx builds aren't supposed to Python 2:
6568
docs/conf.py: WPS305

.pre-commit-config.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
22
repos:
33
- repo: git://github.com/timothycrosley/isort
4-
rev: 4.3.21
4+
# rev: 4.3.21-2
5+
rev: 5.1.1
56
hooks:
67
- id: isort
8+
# args:
9+
# - --honor-noqa
710
# FIXME: isort can be enabled for cython once v5.0.0 is out
811
# files: >-
912
# ^.*\.p(xd|y|yx)$

bin/pep517_backend.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
import functools
1111
import os
1212
import sys
13-
from distutils.command.install import install as distutils_install_cmd
14-
from distutils.core import Distribution as distutils_distribution # noqa: N813
1513
from itertools import chain
1614

15+
import toml
16+
from Cython.Build.Cythonize import main as cythonize_cli_cmd
17+
from expandvars import expandvars
1718
from setuptools.build_meta import (
1819
build_sdist, build_wheel, get_requires_for_build_sdist,
1920
get_requires_for_build_wheel, prepare_metadata_for_build_wheel,
2021
)
2122

22-
# noqa: I001, I004, E800 # flake8-isort is drunk
23-
import toml # noqa: I001
24-
from Cython.Build.Cythonize import main as cythonize_cli_cmd # noqa: I001
25-
from expandvars import expandvars # noqa: I001
23+
# isort: split
24+
from distutils.command.install import install as distutils_install_cmd
25+
from distutils.core import Distribution as distutils_distribution # noqa: N813
2626

2727
__all__ = ( # noqa: WPS317, WPS410
2828
'build_sdist', 'build_wheel', 'get_requires_for_build_sdist',

0 commit comments

Comments
 (0)