Skip to content

Commit 1464e7b

Browse files
crusaderkyemmatyping
authored andcommitted
Require psutil in Windows; relax version requirements (#6762)
1 parent b29a433 commit 1464e7b

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

mypy/dmypy_server.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,13 +559,12 @@ def get_meminfo() -> Dict[str, Any]:
559559
try:
560560
import psutil # type: ignore # It's not in typeshed yet
561561
except ImportError:
562-
if sys.platform != 'win32':
563-
res['memory_psutil_missing'] = (
564-
'psutil not found, run pip install mypy[dmypy] '
565-
'to install the needed components for dmypy'
566-
)
562+
res['memory_psutil_missing'] = (
563+
'psutil not found, run pip install mypy[dmypy] '
564+
'to install the needed components for dmypy'
565+
)
567566
else:
568-
process = psutil.Process(os.getpid())
567+
process = psutil.Process()
569568
meminfo = process.memory_info()
570569
res['memory_rss_mib'] = meminfo.rss / MiB
571570
res['memory_vms_mib'] = meminfo.vms / MiB

setup.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,10 @@ def run(self):
174174
classifiers=classifiers,
175175
cmdclass=cmdclass,
176176
# When changing this, also update test-requirements.txt.
177-
install_requires = ['typed-ast >= 1.3.5, < 1.4.0',
178-
'mypy_extensions >= 0.4.0, < 0.5.0',
179-
],
177+
install_requires=['typed-ast >= 1.3.5, < 1.4.0',
178+
'mypy_extensions >= 0.4.0, < 0.5.0',
179+
],
180180
# Same here.
181-
extras_require = {
182-
'dmypy': 'psutil >= 5.4.0, < 5.5.0; sys_platform!="win32"',
183-
},
181+
extras_require={'dmypy': 'psutil >= 4.0'},
184182
include_package_data=True,
185183
)

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ flake8-bugbear; python_version >= '3.5'
44
flake8-pyi; python_version >= '3.6'
55
lxml==4.2.4
66
mypy_extensions>=0.4.0,<0.5.0
7-
psutil>=5.4.0,<5.5.0; sys_platform!='win32'
7+
psutil>=4.0
88
pytest>=4.4
99
pytest-xdist>=1.22
1010
pytest-cov>=2.4.0

0 commit comments

Comments
 (0)