Skip to content

Commit 85721f9

Browse files
committed
cleanup unexpected changes
1 parent 2ff0add commit 85721f9

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

src/auditwheel/wheeltools.py

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
from itertools import product
1616
from os.path import splitext
1717
from pathlib import Path
18-
from tempfile import TemporaryDirectory
1918
from types import TracebackType
20-
from typing import Any, ClassVar
2119

2220
from packaging.utils import parse_wheel_filename
2321

@@ -100,13 +98,8 @@ class InWheel(InTemporaryDirectory):
10098
On entering, you'll find yourself in the root tree of the wheel. If you've
10199
asked for an output wheel, then on exit we'll rewrite the wheel record and
102100
pack stuff up for you.
103-
104-
If `out_wheel` is None, we assume the wheel won't be modified and we can
105-
cache the unpacked wheel for future use.
106101
"""
107102

108-
_whl_cache: ClassVar[dict[Path, TemporaryDirectory[Any]]] = {}
109-
110103
def __init__(self, in_wheel: Path, out_wheel: Path | None = None) -> None:
111104
"""Initialize in-wheel context manager
112105
@@ -120,35 +113,9 @@ def __init__(self, in_wheel: Path, out_wheel: Path | None = None) -> None:
120113
"""
121114
self.in_wheel = in_wheel.absolute()
122115
self.out_wheel = None if out_wheel is None else out_wheel.absolute()
123-
self.read_only = out_wheel is None
124-
self.use_cache = self.in_wheel in self._whl_cache
125-
if self.use_cache and not Path(self._whl_cache[self.in_wheel].name).exists():
126-
self.use_cache = False
127-
logger.debug(
128-
"Wheel ctx %s for %s is no longer valid",
129-
self._whl_cache.pop(self.in_wheel),
130-
self.in_wheel,
131-
)
132-
133-
if self.use_cache:
134-
logger.debug(
135-
"Reuse %s for %s", self._whl_cache[self.in_wheel], self.in_wheel
136-
)
137-
self._tmpdir = self._whl_cache[self.in_wheel]
138-
if not self.read_only:
139-
self._whl_cache.pop(self.in_wheel)
140-
else:
141-
super().__init__()
142-
if self.read_only:
143-
self._whl_cache[self.in_wheel] = self._tmpdir
116+
super().__init__()
144117

145118
def __enter__(self) -> Path:
146-
if self.use_cache or self.read_only:
147-
if not self.use_cache:
148-
zip2dir(self.in_wheel, self.name)
149-
self._pwd = Path.cwd()
150-
os.chdir(self.name)
151-
return Path(self.name)
152119
zip2dir(self.in_wheel, self.name)
153120
return super().__enter__()
154121

@@ -165,16 +132,6 @@ def __exit__(
165132
if timestamp:
166133
date_time = datetime.fromtimestamp(int(timestamp), tz=timezone.utc)
167134
dir2zip(self.name, self.out_wheel, date_time)
168-
if self.use_cache or self.read_only:
169-
logger.debug(
170-
"Exiting reused %s for %s",
171-
self._whl_cache[self.in_wheel],
172-
self.in_wheel,
173-
)
174-
os.chdir(self._pwd)
175-
if not self.read_only:
176-
super().__exit__(exc, value, tb)
177-
return None
178135
return super().__exit__(exc, value, tb)
179136

180137

0 commit comments

Comments
 (0)