Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update dependencies #9

Merged
merged 3 commits into from
Aug 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version-query >= 1.1, == 1.*
version-query ~= 1.1
4 changes: 2 additions & 2 deletions requirements_ci.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
codecov >= 2.0.15
coverage >= 5.0.3
codecov ~= 2.1
coverage ~= 6.2
-rrequirements_test.txt
8 changes: 4 additions & 4 deletions requirements_ci_optional.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pint ~= 0.10.1
pint ~= 0.19.1
psutil ~= 5.6
py-cpuinfo == 5.*
# pycuda >= 2019.1 # CUDA is not available on Travis/AppVeyor
pyudev ~= 0.22.0
py-cpuinfo ~= 8.0
# pycuda >= 2022.1 # CUDA is not available on Travis/AppVeyor
pyudev ~= 0.24.0
8 changes: 4 additions & 4 deletions requirements_optional.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pint ~= 0.10.1
pint ~= 0.19.1
psutil ~= 5.6
py-cpuinfo == 5.*
pycuda >= 2019.1
pyudev ~= 0.22.0
py-cpuinfo ~= 8.0
pycuda >= 2022.1
pyudev ~= 0.24.0
12 changes: 6 additions & 6 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
colorlog >= 4.1
docutils >= 0.16
pip >= 20.0
Pygments >= 2.5
setuptools >= 45.1
wheel >= 0.34
colorlog ~= 6.6
docutils ~= 0.18
pip >= 21.0
Pygments ~= 2.11
setuptools >= 60.4
wheel >= 0.37
-rrequirements.txt
2 changes: 2 additions & 0 deletions system_query/cpu_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def _get_cache_size(level: int, cpuinfo_data: dict) -> t.Optional[int]:
'l{}_data_cache_size'.format(level), cpuinfo_data.get('l{}_cache_size'.format(level), None))
if raw_value is None:
return None
if isinstance(raw_value, int):
return raw_value
assert isinstance(raw_value, str), (type(raw_value), raw_value)
# Sometimes cpuinfo prints e.g. `192 KiB (6 instances)` so we use
# just the first two words
Expand Down
6 changes: 6 additions & 0 deletions test/test_cpu_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ def test_cpu_cache_size_with_units(self):
info = _get_cache_size(1, {'l1_cache_size': '4 MiB'})
self.assertIsInstance(info, int)
self.assertEqual(info, 4 * 1024 ** 2)

@unittest.skipIf(not CPU, 'skipping CPU cache query')
def test_cpu_cache_size_with_units_and_instances(self):
info = _get_cache_size(1, {'l1_cache_size': '192 KiB (6 instances)'})
self.assertIsInstance(info, int)
self.assertEqual(info, 192 * 1024)