Make requirements-ci.txt reading cwd independent (#91771)

Discovered while running `test_typing.py` locally

Pull Request resolved: https://github.com/pytorch/pytorch/pull/91771
Approved by: https://github.com/huydhn, https://github.com/ZainRizvi
This commit is contained in:
Nikita Shulga
2023-01-05 20:08:23 +00:00
committed by PyTorch MergeBot
parent a5f32f8978
commit 3b4e4d2b62

View File

@ -9,7 +9,7 @@ def get_correct_mypy_version():
# there's probably a more elegant way to do this
match, = re.finditer(
r'mypy==(\d+(?:\.\d+)*)',
Path('.circleci/docker/requirements-ci.txt').read_text(),
(Path(__file__).parent.parent / '.circleci' / 'docker' / 'requirements-ci.txt').read_text(),
)
version, = match.groups()
return version