9
9
import contextlib
10
10
11
11
from .py39compat import FS_NONASCII
12
- from typing import Dict , Union
13
12
14
13
from . import _path
14
+ from ._path import FilesSpec
15
15
16
16
17
17
try :
@@ -85,15 +85,8 @@ def setUp(self):
85
85
self .fixtures .enter_context (self .add_sys_path (self .site_dir ))
86
86
87
87
88
- # Except for python/mypy#731, prefer to define
89
- # FilesDef = Dict[str, Union['FilesDef', str, bytes]]
90
- FilesDef = Dict [
91
- str , Union [Dict [str , Union [Dict [str , Union [str , bytes ]], str , bytes ]], str , bytes ]
92
- ]
93
-
94
-
95
88
class DistInfoPkg (OnSysPath , SiteDir ):
96
- files : FilesDef = {
89
+ files : FilesSpec = {
97
90
"distinfo_pkg-1.0.0.dist-info" : {
98
91
"METADATA" : """
99
92
Name: distinfo-pkg
@@ -135,7 +128,7 @@ def make_uppercase(self):
135
128
136
129
137
130
class DistInfoPkgWithDot (OnSysPath , SiteDir ):
138
- files : FilesDef = {
131
+ files : FilesSpec = {
139
132
"pkg_dot-1.0.0.dist-info" : {
140
133
"METADATA" : """
141
134
Name: pkg.dot
@@ -150,7 +143,7 @@ def setUp(self):
150
143
151
144
152
145
class DistInfoPkgWithDotLegacy (OnSysPath , SiteDir ):
153
- files : FilesDef = {
146
+ files : FilesSpec = {
154
147
"pkg.dot-1.0.0.dist-info" : {
155
148
"METADATA" : """
156
149
Name: pkg.dot
@@ -177,7 +170,7 @@ def setUp(self):
177
170
178
171
179
172
class EggInfoPkg (OnSysPath , SiteDir ):
180
- files : FilesDef = {
173
+ files : FilesSpec = {
181
174
"egginfo_pkg.egg-info" : {
182
175
"PKG-INFO" : """
183
176
Name: egginfo-pkg
@@ -217,7 +210,7 @@ def setUp(self):
217
210
218
211
219
212
class EggInfoPkgPipInstalledNoToplevel (OnSysPath , SiteDir ):
220
- files : FilesDef = {
213
+ files : FilesSpec = {
221
214
"egg_with_module_pkg.egg-info" : {
222
215
"PKG-INFO" : "Name: egg_with_module-pkg" ,
223
216
# SOURCES.txt is made from the source archive, and contains files
@@ -252,7 +245,7 @@ def setUp(self):
252
245
253
246
254
247
class EggInfoPkgPipInstalledNoModules (OnSysPath , SiteDir ):
255
- files : FilesDef = {
248
+ files : FilesSpec = {
256
249
"egg_with_no_modules_pkg.egg-info" : {
257
250
"PKG-INFO" : "Name: egg_with_no_modules-pkg" ,
258
251
# SOURCES.txt is made from the source archive, and contains files
@@ -282,7 +275,7 @@ def setUp(self):
282
275
283
276
284
277
class EggInfoPkgSourcesFallback (OnSysPath , SiteDir ):
285
- files : FilesDef = {
278
+ files : FilesSpec = {
286
279
"sources_fallback_pkg.egg-info" : {
287
280
"PKG-INFO" : "Name: sources_fallback-pkg" ,
288
281
# SOURCES.txt is made from the source archive, and contains files
@@ -308,7 +301,7 @@ def setUp(self):
308
301
309
302
310
303
class EggInfoFile (OnSysPath , SiteDir ):
311
- files : FilesDef = {
304
+ files : FilesSpec = {
312
305
"egginfo_file.egg-info" : """
313
306
Metadata-Version: 1.0
314
307
Name: egginfo_file
0 commit comments