Skip to content

Commit a84317b

Browse files
authored
Merge pull request #11729 from uranusjr/strict-optional-egg-link
Enable strict optionals in egg_link code
2 parents fadac1b + a2519eb commit a84317b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/pip/_internal/locations/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
USER_CACHE_DIR = appdirs.user_cache_dir("pip")
1414

1515
# FIXME doesn't account for venv linked to global site-packages
16-
site_packages: typing.Optional[str] = sysconfig.get_path("purelib")
16+
site_packages: str = sysconfig.get_path("purelib")
1717

1818

1919
def get_major_minor_version() -> str:

src/pip/_internal/utils/egg_link.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
# The following comment should be removed at some point in the future.
2-
# mypy: strict-optional=False
3-
41
import os
52
import re
63
import sys
7-
from typing import Optional
4+
from typing import List, Optional
85

96
from pip._internal.locations import site_packages, user_site
107
from pip._internal.utils.virtualenv import (
@@ -57,7 +54,7 @@ def egg_link_path_from_location(raw_name: str) -> Optional[str]:
5754
5855
This method will just return the first one found.
5956
"""
60-
sites = []
57+
sites: List[str] = []
6158
if running_under_virtualenv():
6259
sites.append(site_packages)
6360
if not virtualenv_no_global() and user_site:

0 commit comments

Comments
 (0)