mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
Fix license check for setuptools>=77 (#151158)
Fixes #151157 See issue for more information Pull Request resolved: https://github.com/pytorch/pytorch/pull/151158 Approved by: https://github.com/malfet
This commit is contained in:
parent
7dd2ed1197
commit
5b16a0704e
|
|
@ -45,7 +45,11 @@ class TestLicense(TestCase):
|
|||
'Found too many "torch-*dist-info" directories '
|
||||
f'in "{site_packages}, expected only one'
|
||||
)
|
||||
with open(os.path.join(os.path.join(distinfo[0], "LICENSE"))) as fid:
|
||||
# setuptools renamed *dist-info/LICENSE to *dist-info/licenses/LICENSE sicne 77.0
|
||||
license_file = os.path.join(distinfo[0], "licenses", "LICENSE")
|
||||
if not os.path.exists(license_file):
|
||||
license_file = os.path.join(distinfo[0], "LICENSE")
|
||||
with open(license_file) as fid:
|
||||
txt = fid.read()
|
||||
self.assertTrue(starting_txt in txt)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user