diff --git a/python/meson.build b/python/meson.build index e90766a..29fbef8 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.62', + version: '0.1.5.65', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py index 3b30e4a..23da8e7 100644 --- a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py +++ b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py @@ -358,6 +358,12 @@ class BootstrapSettings: '--offline -U', ).split(), ) + whl_cache_update: Optional[bool] = dataclasses.field( + default_factory=lambda: os.environ.get( + 'WHL_CACHE_UPDATE', json.dumps(False) + ) + in [json.dumps(True)] + ) @classmethod def get( @@ -520,37 +526,44 @@ def env_bootstrap( f.write('\n'.join(requirements_in)) f.flush() - subprocess.check_call( - [ - 'uv', - 'pip', - 'compile', - *uv_python_version, - '--generate-hashes', - *pip_find_links_args, - # '-p', - # bootstrap_settings.python_path, - *bootstrap_settings.uv_args, - '-o', - str(requirements_path), - f.name, - ] - ) - - if not bootstrap_settings.env_path.exists(): - subprocess.check_call( - [ + cmd = [ + 'uv', 'pip', - 'download', - '--only-binary=:all:', + 'compile', *uv_python_version, + '--generate-hashes', *pip_find_links_args, - '-r', + # '-p', + # bootstrap_settings.python_path, + *bootstrap_settings.uv_args, + '-o', str(requirements_path), - '-d', - str(bootstrap_settings.whl_cache_path), + f.name, ] - ) + + logger.info(dict(cmd=cmd)) + subprocess.check_call(cmd) + + # if not bootstrap_settings.env_path.exists(): + if ( + not bootstrap_settings.whl_cache_path.exists() + or bootstrap_settings.whl_cache_update + ): + cmd = [ + 'pip', + 'download', + '--only-binary=:all:', + *uv_python_version, + *pip_find_links_args, + '-r', + str(requirements_path), + '-d', + str(bootstrap_settings.whl_cache_path), + ] + + logger.info(dict(cmd=cmd)) + + subprocess.check_call(cmd) cache_find_links_args = ( '-f', @@ -563,7 +576,12 @@ def env_bootstrap( *[ o for o in bootstrap_settings.uv_args - if not o in ['-U', '--upgrade'] + if not o + in [ + '-U', + '--upgrade', + '--no-index', + ] ], 'venv', *venv_python_version, @@ -573,22 +591,24 @@ def env_bootstrap( ] ) - subprocess.check_call( - [ - 'uv', - 'pip', - 'install', - *uv_python_version, - *cache_find_links_args, - # *pip_find_links_args, - '-p', - bootstrap_settings.python_path, - '--require-hashes', - *bootstrap_settings.uv_args, - '-r', - str(requirements_path), - ] - ) + cmd = [ + 'uv', + 'pip', + 'install', + *uv_python_version, + *cache_find_links_args, + # *pip_find_links_args, + '-p', + bootstrap_settings.python_path, + '--require-hashes', + *bootstrap_settings.uv_args, + '-r', + str(requirements_path), + ] + + logger.info(dict(cmd=cmd)) + + subprocess.check_call(cmd) if bootstrap_settings.pip_check_conflicts: subprocess.check_call( diff --git a/python/online/fxreader/pr34/commands_typed/status.py b/python/online/fxreader/pr34/commands_typed/status.py index 0f4fe14..0569af8 100644 --- a/python/online/fxreader/pr34/commands_typed/status.py +++ b/python/online/fxreader/pr34/commands_typed/status.py @@ -12,6 +12,8 @@ import textwrap import optparse import traceback +from . import logging as pr34_logging + from typing import ( Any, Optional, @@ -60,7 +62,8 @@ def get_info( def run(argv: list[str]): - logging.basicConfig(level=logging.INFO) + # logging.basicConfig(level=logging.INFO) + pr34_logging.setup() assert isinstance(argv, list) and all([isinstance(o, str) for o in argv]) diff --git a/python/online/fxreader/pr34/oom_firefox.py b/python/online/fxreader/pr34/oom_firefox.py index 8500f60..674105e 100644 --- a/python/online/fxreader/pr34/oom_firefox.py +++ b/python/online/fxreader/pr34/oom_firefox.py @@ -417,6 +417,19 @@ def main(): if total > limit: to_free = total - kill_to + + logger.info( + dict( + total=total, + limit=limit, + kill_to=kill_to, + to_free=to_free, + low_priority_pids=low_priority_pids, + worker_regex=args.worker_regex, + main_regex=args.main_regex, + ) + ) + killed, freed = kill_prioritized( procs, to_free, diff --git a/releases/whl/online_fxreader_pr34-0.1.5.63-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.63-py3-none-any.whl new file mode 100644 index 0000000..e754139 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.63-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92b0db4b8e9e896b2acb9545cb08fc0441e6bb73e2b7e7d7cdc69e5820af0ac1 +size 83695 diff --git a/releases/whl/online_fxreader_pr34-0.1.5.64-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.64-py3-none-any.whl new file mode 100644 index 0000000..30f5648 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.64-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51dbc93696d697834ddaca9d121fbd8f01a7ef03bdee02387be32c7401549585 +size 83715 diff --git a/releases/whl/online_fxreader_pr34-0.1.5.65-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.65-py3-none-any.whl new file mode 100644 index 0000000..9b317ab --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.65-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29325361cdf449311627eee6abffbec2887dbef352d37c43d855a07f3bb78496 +size 83820