Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pipx for openSUSE:Factory checked in at 2024-01-15 22:21:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pipx (Old) and /work/SRC/openSUSE:Factory/.python-pipx.new.21961 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pipx" Mon Jan 15 22:21:28 2024 rev:8 rq:1138976 version:1.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pipx/python-pipx.changes 2024-01-03 12:31:13.837160334 +0100 +++ /work/SRC/openSUSE:Factory/.python-pipx.new.21961/python-pipx.changes 2024-01-15 22:22:02.277037905 +0100 @@ -1,0 +2,13 @@ +Mon Jan 15 14:32:28 UTC 2024 - Eyad Issa <[email protected]> + +- Update to 1.4.2 + * Print more user friendly error when --python version not found + * Allow skipping maintenance tasks for list command + * Use modern PEP 723 syntax, fix mistake in name + * Modernize toml + * Verify if script name provided is a file before running it + * Fix python path resolution on linux + + https://github.com/pypa/pipx/releases/tag/1.4.2 + +------------------------------------------------------------------- Old: ---- pipx-1.4.0.tar.gz New: ---- pipx-1.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pipx.spec ++++++ --- /var/tmp/diff_new_pack.lAHRYY/_old 2024-01-15 22:22:04.037102589 +0100 +++ /var/tmp/diff_new_pack.lAHRYY/_new 2024-01-15 22:22:04.037102589 +0100 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-pipx -Version: 1.4.0 +Version: 1.4.2 Release: 0 Summary: Install and Run Python Applications in Isolated Environments License: MIT ++++++ pipx-1.4.0.tar.gz -> pipx-1.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/CHANGELOG.md new/pipx-1.4.2/CHANGELOG.md --- old/pipx-1.4.0/CHANGELOG.md 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/CHANGELOG.md 2020-02-02 01:00:00.000000000 +0100 @@ -1,5 +1,19 @@ ## dev +- Allow skipping maintenance tasks during list command +- Raise more user friendly error when provided `--python` version is not found +- Update `pipx run` on scripts using `/// script` and no `run` table following the updated version of PEP 723 (#1180) +- Avoid repeated exception logging in a few rare cases (#1192) +- Include `tomli` into `pipx.pyz` (zipapp) so that it can be executed with Python 3.10 or earlier (#1142) +- Fix resolving the python executable path on linux +- `pipx run`: Verify whether the script name provided is a file before running it + +## 1.4.1 + +- Set default logging level to WARNING, so debug log messages won't be shown without passing additional flags such as `--verbose` + +## 1.4.0 + - Delete directories directly instead of spawning rmdir on Windows - Fix "Failed to delete" error when using Microsoft Store Python - Fix "No pyvenv.cfg file" error when using Microsoft Store Python (#1164) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/CONTRIBUTING.md new/pipx-1.4.2/CONTRIBUTING.md --- old/pipx-1.4.0/CONTRIBUTING.md 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/CONTRIBUTING.md 2020-02-02 01:00:00.000000000 +0100 @@ -3,12 +3,14 @@ Everyone who interacts with the pipx project via codebase, issue tracker, chat rooms, or otherwise is expected to follow the [PSF Code of Conduct](https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md). -## Running pipx From Source Tree +## Running pipx For Development -To run the pipx executable from your source tree during development, run pipx from the src directory: +To develop `pipx`, either create a [developer environment](#creating-a-developer-environment), or perform an editable +install: ``` -python src/pipx --version +python -m pip install -e . +python -m pipx --version ``` ## Running Tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/PKG-INFO new/pipx-1.4.2/PKG-INFO --- old/pipx-1.4.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pipx -Version: 1.4.0 +Version: 1.4.2 Summary: Install and Run Python Applications in Isolated Environments Project-URL: Bug Tracker, https://github.com/pypa/pipx/issues Project-URL: Documentation, https://pipx.pypa.io diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/pyproject.toml new/pipx-1.4.2/pyproject.toml --- old/pipx-1.4.0/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -55,13 +55,12 @@ [tool.ruff] line-length = 121 -lint.select = [ +src = ["src"] +lint.extend-select = [ "A", "B", "C4", "C9", - "E", - "F", "I", "PLC", "PLE", @@ -69,20 +68,12 @@ "RSE", "W", ] -lint.ignore = [ - "B904", -] -isort = {known-first-party = ["helpers", "package_info", "pipx"]} +lint.isort = {known-first-party = ["helpers", "package_info", "pipx"]} lint.mccabe.max-complexity = 15 [tool.pytest.ini_options] markers = ["all_packages: test install with maximum number of packages"] -[tool.mypy] -show_error_codes = true -overrides = [ - { module = [ - "pipx.version", - "pycowsay.*", - ], ignore_missing_imports = true }, -] +[[tool.mypy.overrides]] +module = ["pipx.version", "pycowsay.*"] +ignore_missing_imports = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/src/pipx/commands/install.py new/pipx-1.4.2/src/pipx/commands/install.py --- old/pipx-1.4.0/src/pipx/commands/install.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/src/pipx/commands/install.py 2020-02-02 01:00:00.000000000 +0100 @@ -1,9 +1,14 @@ from pathlib import Path from typing import List, Optional -from pipx import constants +from pipx import constants, emojis from pipx.commands.common import package_name_from_spec, run_post_install_actions -from pipx.constants import EXIT_CODE_INSTALL_VENV_EXISTS, EXIT_CODE_OK, ExitCode +from pipx.constants import ( + EXIT_CODE_INSTALL_VENV_EXISTS, + EXIT_CODE_OK, + EXIT_CODE_SPECIFIED_PYTHON_EXECUTABLE_NOT_FOUND, + ExitCode, +) from pipx.interpreter import DEFAULT_PYTHON from pipx.util import pipx_wrap from pipx.venv import Venv, VenvContainer @@ -102,6 +107,23 @@ include_dependencies, force=force, ) + except FileNotFoundError as e: + venv.remove_venv() + if python in str(e) or "The system cannot find the file specified" in str(e): + print( + pipx_wrap( + f""" + {emojis.hazard} No executable for the provided Python version '{python}' found. + Please make sure the executable name is on your PATH / + the path to the executable is correct. + """, + subsequent_indent=" " * 4, + ) + ) + return EXIT_CODE_SPECIFIED_PYTHON_EXECUTABLE_NOT_FOUND + else: + print() + raise except (Exception, KeyboardInterrupt): print() venv.remove_venv() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/src/pipx/commands/list_packages.py new/pipx-1.4.2/src/pipx/commands/list_packages.py --- old/pipx-1.4.0/src/pipx/commands/list_packages.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/src/pipx/commands/list_packages.py 2020-02-02 01:00:00.000000000 +0100 @@ -4,7 +4,7 @@ from pathlib import Path from typing import Any, Collection, Dict, Tuple -from pipx import constants +from pipx import constants, shared_libs from pipx.colors import bold from pipx.commands.common import VenvProblems, get_venv_summary, venv_health_check from pipx.constants import EXIT_CODE_LIST_PROBLEM, EXIT_CODE_OK, ExitCode @@ -89,12 +89,17 @@ include_injected: bool, json_format: bool, short_format: bool, + skip_maintenance: bool, ) -> ExitCode: """Returns pipx exit code.""" venv_dirs: Collection[Path] = sorted(venv_container.iter_venv_dirs()) if not venv_dirs: print(f"nothing has been installed with pipx {sleep}", file=sys.stderr) + if skip_maintenance: + shared_libs.shared_libs.skip_upgrade = True + logger.info("Skipping shared libs maintenance tasks") + venv_container.verify_shared_libs() if json_format: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/src/pipx/commands/run.py new/pipx-1.4.2/src/pipx/commands/run.py --- old/pipx-1.4.0/src/pipx/commands/run.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/src/pipx/commands/run.py 2020-02-02 01:00:00.000000000 +0100 @@ -48,7 +48,7 @@ # Look for a local file first. app_path = Path(app) - if app_path.exists(): + if app_path.is_file(): return app_path.read_text(encoding="utf-8") elif is_path: raise PipxError(f"The specified path {app} does not exist") @@ -328,7 +328,7 @@ Supports inline script metadata. """ - name = "pyproject" + name = "script" # Windows is currently getting un-normalized line endings, so normalize content = content.replace("\r\n", "\n") @@ -336,6 +336,20 @@ matches = [m for m in INLINE_SCRIPT_METADATA.finditer(content) if m.group("type") == name] if not matches: + pyproject_matches = [m for m in INLINE_SCRIPT_METADATA.finditer(content) if m.group("type") == "pyproject"] + if pyproject_matches: + logger.error( + pipx_wrap( + f""" + {hazard} Using old form of requirements table. Use updated PEP + 723 syntax by replacing `# /// pyproject` with `# /// script` + and `run.dependencies` (or `run.requirements`) with + `dependencies`. + """, + subsequent_indent=" " * 4, + ) + ) + raise ValueError("Old 'pyproject' table found") return None if len(matches) > 1: @@ -348,7 +362,7 @@ pyproject = tomllib.loads(content) requirements = [] - for requirement in pyproject.get("run", {}).get("requirements", []): + for requirement in pyproject.get("dependencies", []): # Validate the requirement try: req = Requirement(requirement) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/src/pipx/constants.py new/pipx-1.4.2/src/pipx/constants.py --- old/pipx-1.4.0/src/pipx/constants.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/src/pipx/constants.py 2020-02-02 01:00:00.000000000 +0100 @@ -46,6 +46,7 @@ EXIT_CODE_UNINSTALL_ERROR = ExitCode(1) EXIT_CODE_REINSTALL_VENV_NONEXISTENT = ExitCode(1) EXIT_CODE_REINSTALL_INVALID_PYTHON = ExitCode(1) +EXIT_CODE_SPECIFIED_PYTHON_EXECUTABLE_NOT_FOUND = ExitCode(1) pipx_log_file: Optional[Path] = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/src/pipx/main.py new/pipx-1.4.2/src/pipx/main.py --- old/pipx-1.4.0/src/pipx/main.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/src/pipx/main.py 2020-02-02 01:00:00.000000000 +0100 @@ -263,7 +263,9 @@ force=args.force, ) elif args.command == "list": - return commands.list_packages(venv_container, args.include_injected, args.json, args.short) + return commands.list_packages( + venv_container, args.include_injected, args.json, args.short, args.skip_maintenance + ) elif args.command == "uninstall": return commands.uninstall(venv_dir, constants.LOCAL_BIN_DIR, constants.LOCAL_MAN_DIR, verbose) elif args.command == "uninstall-all": @@ -294,7 +296,7 @@ return commands.ensure_pipx_paths(force=args.force) except Exception as e: logger.debug("Uncaught Exception:", exc_info=True) - raise PipxError(str(e), wrap_message=False) + raise PipxError(str(e), wrap_message=False) from None elif args.command == "completions": print(constants.completion_instructions) return ExitCode(0) @@ -566,6 +568,7 @@ g = p.add_mutually_exclusive_group() g.add_argument("--json", action="store_true", help="Output rich data in json format.") g.add_argument("--short", action="store_true", help="List packages only.") + g.add_argument("--skip-maintenance", action="store_true", help="Skip maintenance tasks.") def _add_run(subparsers: argparse._SubParsersAction, shared_parser: argparse.ArgumentParser) -> None: @@ -699,15 +702,6 @@ completer_venvs = InstalledVenvsCompleter(venv_container) - parser = argparse.ArgumentParser( - prog=prog_name(), - formatter_class=LineWrapRawTextHelpFormatter, - description=PIPX_DESCRIPTION, - ) - parser.man_short_description = PIPX_DESCRIPTION.splitlines()[1] # type: ignore - - subparsers = parser.add_subparsers(dest="command", description="Get help for commands with pipx COMMAND --help") - shared_parser = argparse.ArgumentParser(add_help=False) shared_parser.add_argument( @@ -723,6 +717,16 @@ shared_parser.add_argument("--verbose", "-v", action="count", default=0, help=("Give more output.")) + parser = argparse.ArgumentParser( + prog=prog_name(), + formatter_class=LineWrapRawTextHelpFormatter, + description=PIPX_DESCRIPTION, + parents=[shared_parser], + ) + parser.man_short_description = PIPX_DESCRIPTION.splitlines()[1] # type: ignore + + subparsers = parser.add_subparsers(dest="command", description="Get help for commands with pipx COMMAND --help") + _add_install(subparsers, shared_parser) _add_uninject(subparsers, completer_venvs.use, shared_parser) _add_inject(subparsers, completer_venvs.use, shared_parser) @@ -786,12 +790,12 @@ return _setup_log_file(platformdirs.user_log_path("pipx")) -def setup_logging(verbose: bool) -> None: +def setup_logging(verbose: int) -> None: pipx_str = bold(green("pipx >")) if sys.stdout.isatty() else "pipx >" pipx.constants.pipx_log_file = setup_log_file() # Determine logging level - level_number = max(0, 2 - verbose) * 10 + level_number = max(0, logging.WARNING - 10 * verbose) level = logging.getLevelName(level_number) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/src/pipx/shared_libs.py new/pipx-1.4.2/src/pipx/shared_libs.py --- old/pipx-1.4.0/src/pipx/shared_libs.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/src/pipx/shared_libs.py 2020-02-02 01:00:00.000000000 +0100 @@ -31,6 +31,7 @@ self._site_packages: Optional[Path] = None self.has_been_updated_this_run = False self.has_been_logged_this_run = False + self.skip_upgrade = False @property def site_packages(self) -> Path: @@ -65,7 +66,7 @@ @property def needs_upgrade(self) -> bool: - if self.has_been_updated_this_run: + if self.has_been_updated_this_run or self.skip_upgrade: return False if not self.pip_path.is_file(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/src/pipx/util.py new/pipx-1.4.2/src/pipx/util.py --- old/pipx-1.4.0/src/pipx/util.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/src/pipx/util.py 2020-02-02 01:00:00.000000000 +0100 @@ -174,7 +174,7 @@ # See https://github.com/pypa/pipx/issues/1164 # Conversely, if the binary is a symlink, then we should NOT use the real path, as Python expects to receive the # symlink in argv[0] so that it can locate the venv. - if not os.path.islink(cmd_str_list[0]): + if not os.path.islink(cmd_str_list[0]) and WINDOWS: cmd_str_list[0] = os.path.realpath(cmd_str_list[0]) completed_process = subprocess.run( cmd_str_list, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/src/pipx/venv.py new/pipx-1.4.2/src/pipx/venv.py --- old/pipx-1.4.0/src/pipx/venv.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/src/pipx/venv.py 2020-02-02 01:00:00.000000000 +0100 @@ -209,7 +209,7 @@ self._run_pip(cmd) except PipxError as e: logging.info(e) - raise PipxError(f"Error uninstalling {package}.") + raise PipxError(f"Error uninstalling {package}.") from None if was_injected: self.pipx_metadata.injected_packages.pop(package) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pipx-1.4.0/src/pipx/version.py new/pipx-1.4.2/src/pipx/version.py --- old/pipx-1.4.0/src/pipx/version.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pipx-1.4.2/src/pipx/version.py 2020-02-02 01:00:00.000000000 +0100 @@ -12,5 +12,5 @@ __version_tuple__: VERSION_TUPLE version_tuple: VERSION_TUPLE -__version__ = version = '1.4.0' -__version_tuple__ = version_tuple = (1, 4, 0) +__version__ = version = '1.4.2' +__version_tuple__ = version_tuple = (1, 4, 2)
