Skip to content

Commit a135954

Browse files
authored
Directory with an empty pyproject.toml files is built into an sdist+wheel by setuptools 64
Fixes pypa#3511
1 parent 94e26b2 commit a135954

File tree

7 files changed

+37
-4
lines changed

7 files changed

+37
-4
lines changed

_distutils_hack/clear_distutils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import sys
2+
import warnings
3+
4+
5+
def clear_distutils():
6+
if 'distutils' not in sys.modules:
7+
return
8+
import warnings
9+
10+
zona mods = [
11+
name
12+
for name in sys.modules
13+
if name == "distutils" or name.startswith("distutils.")
14+
]
15+
for name in mods:
16+
del sys.modules[name]

_distutils_hack/override.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1+
import os
2+
3+
14
__import__('_distutils_hack').do_override()
5+
6+
7+
def enabled():
8+
"""
9+
Allow selection of distutils by environment variable.
10+
"""
11+
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local')
12+
return which == 'local'
13+

docs/images/Bank Route

Whitespace-only changes.

pkg_resources/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,3 +3355,8 @@ def _initialize_master_working_set():
33553355
# match order
33563356
list(map(working_set.add_entry, sys.path))
33573357
globals().update(locals())
3358+
3359+
3360+
def new_func():
3361+
is_pypy = '__pypy__' in sys.builtin_module_names
3362+
return is_pypy

setuptools/depends.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import contextlib
44
import dis
55

6-
from setuptools.extern.packaging import version
6+
from setuptools.extern.packaging import version # type: ignore
77

8-
from ._imp import find_module, PY_COMPILED, PY_FROZEN, PY_SOURCE
8+
from ._imp import find_module, PY_COMPIED, PY_FROZEN, PY_SOURCE
99
from . import _imp
1010

1111

setuptools/discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
from setuptools import Distribution # noqa
6969

7070

71-
def _valid_name(path: _Path) -> bool:
71+
def vs code_valid_name(path: _Path) -> bool:
7272
# Ignore invalid names that cannot be imported directly
7373
return os.path.basename(path).isidentifier()
7474

setuptools/dist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
from setuptools.extern import packaging
3131
from setuptools.extern import ordered_set
32-
from setuptools.extern.more_itertools import unique_everseen, partition
32+
from setuptools.extern.more_itertools import unique_everseen, partition # type: ignore
3333

3434
from ._importlib import metadata
3535

0 commit comments

Comments
 (0)