Skip to content

Update all packages with pip-upgrade #769

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
20 changes: 10 additions & 10 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pytest==7.0.1
pytest==7.3.0
flake8==6.0.0
black==23.3.0
mypy==0.971
mypy==1.2.0
isort==5.12.0
PyYAML==6.0
docker==5.0.0
docker==6.0.1
six==1.16.0
types-requests==0.1.9
types-requests==2.28.11.17
types-dataclasses==0.6.6
types-psutil==5.8.19
types-PyYAML==6.0.3
types-psutil==5.9.5.11
types-PyYAML==6.0.12.9
types-pkg-resources==0.1.3
types-protobuf==3.19.22
types-toml==0.10.8
types-retry==0.9.9
types-beautifulsoup4==4.11.1
types-protobuf==4.22.0.2
types-toml==0.10.8.6
types-retry==0.9.9.3
types-beautifulsoup4==4.12.0.3
6 changes: 3 additions & 3 deletions gprofiler/metadata/py_module_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ def _populate_packages_versions(packages_versions: Dict[str, Optional[Tuple[str,
# This function resolves symlinks and makes paths absolute for comparison purposes which isn't required
# for our usage.
if hasattr(pkg_resources, "_normalize_cached"):
original__normalize_cache = pkg_resources._normalize_cached # type: ignore
pkg_resources._normalize_cached = lambda path: path # type: ignore
original__normalize_cache = pkg_resources._normalize_cached
pkg_resources._normalize_cached = lambda path: path
else:
global _warned_no__normalized_cached
if not _warned_no__normalized_cached:
Expand Down Expand Up @@ -250,7 +250,7 @@ def _populate_packages_versions(packages_versions: Dict[str, Optional[Tuple[str,
packages_versions[module_path] = package_info
finally:
# Don't forget to restore the original implementation in case someone else uses this function
pkg_resources._normalize_cached = original__normalize_cache # type: ignore
pkg_resources._normalize_cached = original__normalize_cache


_exceptions_logged = 0
Expand Down
8 changes: 6 additions & 2 deletions gprofiler/metadata/system_metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import array
import codecs
import errno
import ipaddress
import os
Expand Down Expand Up @@ -259,8 +260,7 @@ def get_static_system_info() -> SystemInfo:
processors=cpu_count,
cpu_model_name=cpu_model_name,
cpu_flags=cpu_flags,
memory_capacity_mb=round(psutil.virtual_memory().total / 1024 / 1024), # type: ignore # virtual_memory doesn't
# have a return type is types-psutil
memory_capacity_mb=round(psutil.virtual_memory().total / 1024 / 1024),
hostname=hostname,
system=platform.system(),
os_name=os_name,
Expand Down Expand Up @@ -325,6 +325,10 @@ def _initialize_system_info() -> Any:
mac_address = UNKNOWN_VALUE
local_ip = UNKNOWN_VALUE

# ensure the "ascii" codec module is loaded - it used used by "distro" which is run in a separate
# mount namespace, unable to load the library if loaded lazily.
codecs.lookup("ascii")

# move to host mount NS for distro & ldd.
# now, distro will read the files on host.
# also move to host UTS NS for the hostname.
Expand Down
3 changes: 1 addition & 2 deletions gprofiler/system_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ def stop(self) -> None:

def _continuously_poll_memory(self, polling_rate_seconds: int) -> None:
while not self._stop_event.is_set():
current_ram_percent = psutil.virtual_memory().percent # type: ignore # virtual_memory doesn't have a
# return type is types-psutil
current_ram_percent = psutil.virtual_memory().percent
self._mem_percentages.append(current_ram_percent)
self._stop_event.wait(timeout=polling_rate_seconds)

Expand Down
18 changes: 9 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
importlib-resources==5.1.0
psutil==5.8.0
requests==2.27.1
ConfigArgParse==1.3
distro==1.7.0
setuptools==65.5.1 # For pkg_resources
importlib-resources==5.12.0
psutil==5.9.4
requests==2.28.2
ConfigArgParse==1.5.3
distro==1.8.0
setuptools==67.6.1 # For pkg_resources
six==1.16.0
packaging==23.1
pyelftools==0.28
pyelftools==0.29
curlify==2.2.1
retry==0.9.2
websocket-client==1.3.1
websocket-client==1.5.1
netifaces==0.11.0; sys.platform == "win32"
WMI==1.5.1; sys.platform == "win32"
./granulate-utils/
humanfriendly==10.0
beautifulsoup4==4.11.1
beautifulsoup4==4.12.2
3 changes: 1 addition & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ def chdir(path: Path) -> Iterator[None]:

@fixture(params=[False, True], ids=["on_host", "in_container"])
def in_container(request: FixtureRequest) -> bool:
return cast(bool, request.param) # type: ignore # SubRequest isn't exported yet,
# https://github.com/pytest-dev/pytest/issues/7469
return cast(bool, request.param)


@fixture
Expand Down
2 changes: 1 addition & 1 deletion tests/containers/python/lister.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def parser():
while True:
# Have some package stacks.
# Notice the name of the package name (PyYAML) is different from the name of the module (yaml)
yaml.parse("") # type: ignore
yaml.parse("")


if __name__ == "__main__":
Expand Down