From fdfda1ac6248f7f8ecd56ab43864d2d5761249b7 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Fri, 11 Oct 2024 13:27:56 +0200 Subject: [PATCH 1/2] manifest: Fix absolute path checking on windows for Python 3.13 Python 3.13 changed the behavior for os.path.isabs https://docs.python.org/3/library/os.path.html#os.path.isabs Prevent absolute paths that start with a '/'. Signed-off-by: Pieter De Gendt --- src/west/manifest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/west/manifest.py b/src/west/manifest.py index 500f348e..42caeb15 100644 --- a/src/west/manifest.py +++ b/src/west/manifest.py @@ -2421,7 +2421,10 @@ def _load_project(self, pd: Dict, url_bases: Dict[str, str], # symbolic links. ret_norm = os.path.normpath(ret.path) - if os.path.isabs(ret_norm): + # To be "really" absolute, a Windows path must include the "drive" like C:\\, D:\\. + # But here we also want to block drive-less "half-breeds". + # Note this question has confused Python which changed the `.isabs()` behavior in 3.13 + if ret_norm[0] in '/\\' or os.path.isabs(ret_norm): self._malformed(f'project "{ret.name}" has absolute path ' f'{ret.path}; this must be relative to the ' f'workspace topdir' + From c5aa91dcede671c0757b502f41c5cecf97e4ce37 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Fri, 11 Oct 2024 12:16:23 +0200 Subject: [PATCH 2/2] .github: Update supported python versions Python 3.8 is end-of-life, removed. Python 3.13 is released, added. Signed-off-by: Pieter De Gendt --- .github/workflows/package.yml | 2 +- .github/workflows/test.yml | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index f90c65bf..9c1a5d91 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install Python dependencies run: | pip3 install build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed834dfb..2f7d6824 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.9, '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 # This is enough to find many quoting issues diff --git a/pyproject.toml b/pyproject.toml index 90c33134..f405e1f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ classifiers = [ "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", ] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "colorama", "PyYAML>=5.1",