Skip to content

Commit 4d68282

Browse files
committed
Update supported Python and package versions.
* [Python] Remove EOL versions Remove versions that are end of life (3.8 and 3.9). * [Python] Add new stable versions Add new stable versions (3.13 and 3.14). * [pip] Update dependencies Updated dependencies for tools, partly to support new versions , to have new features available, fix pip-audit findings or to be in sync with other S-CORE repos.
1 parent e6e47e9 commit 4d68282

42 files changed

Lines changed: 3821 additions & 2786 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ coverage --instrumentation_filter="[:]"
1818

1919
# Python toolchain configurations
2020
common --flag_alias=python=@rules_python//python/config_settings:python_version
21-
build:python_3_8 --python=3.8
22-
build:python_3_9 --python=3.9
2321
build:python_3_10 --python=3.10
2422
build:python_3_11 --python=3.11
2523
build:python_3_12 --python=3.12
24+
build:python_3_13 --python=3.13
25+
build:python_3_14 --python=3.14
2626
build --config=python_3_12
2727

2828
common --flag_alias=use_bazel_tools_python_toolchains=//bazel/toolchains/python:bazel_tools_python_toolchains

CONTRIBUTING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Eclipse Safe Open Vehicle Core (SCORE)
2+
23
The [Eclipse Safe Open Vehicle Core](https://projects.eclipse.org/projects/automotive.score) project aims to develop an open-source core stack for Software Defined Vehicles (SDVs), specifically targeting embedded high-performance Electronic Control Units (ECUs).
34
Please check the [documentation](https://eclipse-score.github.io) for more information.
45
The source code is hosted at [GitHub](https://github.com/eclipse-score).
@@ -19,19 +20,23 @@ Want to contribute? You're welcoe and we're happy to accept your pull requests!
1920
### Getting involved
2021

2122
#### Setup Phase
23+
2224
This phase is part of the eclipse Incubation Phase and shall establish all the processes needed for a safe development of functions. Only after this phase it will be possible to contribute code to the project. As the development in this project is driven by requirements, the processes and needed infrastructure incl. tooling will be established based on non-functional Stakeholder_Requirements<!-- TODO: fill link to correct page with requirements -->. During setup phase the contributions are Bug Fixes and Improvements (both on processes and infrastructure).
2325

2426
#### Bug Fixes and Improvements
27+
2528
Improvements are adding/changing processes and infrastructure, bug fixes can be also on development work products like code.
2629
In case you want to fix a bug or contribute an improvement, please perform the following steps:
27-
1) Create a PR by using the corresponding template ([Bugfix PR template](.github/PULL_REQUEST_TEMPLATE/bug_fix.md) or [Improvement PR template](.github/PULL_REQUEST_TEMPLATE/improvement.md)). Please mark your PR as draft until it's ready for review by the Committers (see the [Eclipse Foundation Project Handbook](https://www.eclipse.org/projects/handbook/#contributing-committers) for more information on the role definitions).
30+
31+
1) Create a PR by using the corresponding template ([Bugfix PR template](.github/PULL_REQUEST_TEMPLATE/bug_fix.md) or [Improvement PR template](.github/PULL_REQUEST_TEMPLATE/improvement.md)). Please mark your PR as draft until it's ready for review by the Committers (see the [Eclipse Foundation Project Handbook](https://www.eclipse.org/projects/handbook/#contributing-committers) for more information on the role definitions).
2832
2) Initiate content review by opening a corresponding issue for the PR when it is ready for review. Review of the PR and final merge into the project repository is in responsibility of the Committers. Use the [Bugfix Issue template](.github/ISSUE_TEMPLATE/bug_fix.md) or [Improvement Issue template](.github/ISSUE_TEMPLATE/improvement.md) for this.
2933

3034
Please check here for our Git Commit Rules in the [Configuration_Tool_Guidelines](https://eclipse-score.github.io/score/process_description/guidelines/index.html).
3135

3236
Please use the [Stakeholder and Tool Requirements Template](https://eclipse-score.github.io/score/process_description/templates/index.html) when defining these requirements.
3337

3438
#### Additional Information
39+
3540
Please note, that all Git commit messages must adhere the rules described in the [Eclipse Foundation Project Handbook](https://www.eclipse.org/projects/handbook/#resources-commit).
3641

3742
Please find process descriptions here: [process description](https://eclipse-score.github.io/score/process_description/).
@@ -65,4 +70,4 @@ Other options are also available through other pip hub aliases, for example, the
6570
#### Local quality check
6671

6772
Ideally, one should verify code quality locally before pushing changes to the CI. This avoids unecessary CI jobs and can even speed up development.
68-
To do that, simply run [`scripts/run_all_tests.sh`](scripts/run_all_tests.sh).
73+
To do that, simply run [`scripts/run_all_tests.sh`](scripts/run_all_tests.sh) from the repo root.

MODULE.bazel

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# *******************************************************************************
1313
module(
1414
name = "score_bazel_tools_python",
15-
version = "0.1.3",
15+
version = "0.1.4",
1616
compatibility_level = 0,
1717
repo_name = "bazel_tools_python",
1818
)
@@ -23,14 +23,16 @@ bazel_dep(name = "aspect_rules_lint", version = "1.4.4", dev_dependency = True)
2323
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2", dev_dependency = True)
2424

2525
# docs-as-code
26-
bazel_dep(name = "score_tooling", version = "1.0.4", dev_dependency = True)
26+
bazel_dep(name = "score_tooling", version = "1.0.5", dev_dependency = True)
2727
bazel_dep(name = "platforms", version = "0.0.11", dev_dependency = True)
2828

2929
# Unfortunately bazel_skylib can not be dev_dependency because we use some of its libraries.
30-
bazel_dep(name = "bazel_skylib", version = "1.7.1")
30+
bazel_dep(name = "bazel_skylib", version = "1.9.0")
3131

3232
# Unfortunately rules_python can not be dev_dependency because we provide our pip hub using it.
33-
bazel_dep(name = "rules_python", version = "1.4.1")
33+
# Updating it to newer than 1.6.3 currently breaks our build due to changes in rules_python
34+
# and we have to update score_score_tooling as well to accommodate those changes.
35+
bazel_dep(name = "rules_python", version = "1.6.3")
3436

3537
# We patch rules_python patch to python coverage files.
3638
# This enable us to select our own .coveragerc file when issuing a bazel coverage command.
@@ -43,11 +45,11 @@ single_version_override(
4345
# Python toolchain and dependencies
4446

4547
PYTHON_VERSIONS = [
46-
"3.8",
47-
"3.9",
4848
"3.10",
4949
"3.11",
5050
"3.12",
51+
"3.13",
52+
"3.14",
5153
]
5254

5355
# By default, one can't add `dev_dependency = True` to `python` extension from
@@ -80,11 +82,11 @@ python = use_extension("@rules_python//python/extensions:python.bzl", "python")
8082
# buildifier: leave-alone
8183
use_repo(
8284
python,
83-
bazel_tools_python_python_3_8 = "python_3_8",
84-
bazel_tools_python_python_3_9 = "python_3_9",
8585
bazel_tools_python_python_3_10 = "python_3_10",
8686
bazel_tools_python_python_3_11 = "python_3_11",
8787
bazel_tools_python_python_3_12 = "python_3_12",
88+
bazel_tools_python_python_3_13 = "python_3_13",
89+
bazel_tools_python_python_3_14 = "python_3_14",
8890
)
8991

9092
[

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ The next sections explain the steps to achieve a proper config for each Bazel de
3232

3333
### Requirements
3434

35-
It's important to note that this repository does not supply python toolchains but only its pip dependencies. Therefore one must set up its own python toolchain. This repository support major python versions from `3.8` to `3.12`.
35+
It's important to note that this repository does not supply python toolchains but only its pip dependencies. Therefore one must set up its own python toolchain. This repository support major python versions from `3.10` to `3.14`.
3636

3737
Additionaly, one must have the following bazel repositories already in place:
3838

39-
- bazel_skylib >= 1.7.1
40-
- rules_python >= 1.4.1
39+
- bazel_skylib >= 1.9.0
40+
- rules_python >= 1.7.0
4141

4242
### Select python pip hub version
4343

bazel/rules/rules_python_pip_hub.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ This is needed so this custom pip hub can select which rules python pip hub shou
143143
deps_to_config_map = {
144144
"@rules_python_pip_hub_3_10": "@your_repo_name//label/to/your:config_setting_3_10",
145145
"@rules_python_pip_hub_3_11": "@your_repo_name//label/to/your:config_setting_3_11",
146-
"@rules_python_pip_hub_3_8": "@your_repo_name//label/to/your:config_setting_3_8",
147-
"@rules_python_pip_hub_3_9": "@your_repo_name//label/to/your:config_setting_3_9",
146+
"@rules_python_pip_hub_3_12": "@your_repo_name//label/to/your:config_setting_3_12",
147+
"@rules_python_pip_hub_3_13": "@your_repo_name//label/to/your:config_setting_3_13",
148+
"@rules_python_pip_hub_3_14": "@your_repo_name//label/to/your:config_setting_3_14",
148149
}
149150
```
150151

bazel/toolchains/python/versions.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"""This module defines which python version are supported."""
1515

1616
PYTHON_VERSIONS = [
17-
"3.8",
18-
"3.9",
1917
"3.10",
2018
"3.11",
2119
"3.12",
20+
"3.13",
21+
"3.14",
2222
]
2323

2424
def unsupported_python_configuration_error(custom_message):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ max-line-length=120
4141
disallow_untyped_defs = false
4242
explicit_package_bases = true
4343
incremental = false
44-
python_version = "3.9"
44+
python_version = "3.10"
4545

4646
[tool.pylint.messages_control]
4747
disable = [

quality/private/python/pycoverage/test/test_pycoverage_report_generator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ def test_pycoverage_reporter_main(mocker, caplog, reports_file, st_size, output_
6060

6161
if reports_file == "lcov_files_no_py_targets.tmp":
6262
assert "No python coverage reports found." in caplog.text
63-
return

quality/private/python/tools/black_runner.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@
2020
WOULD_REFORMAT_MSG = "would reformat"
2121

2222

23-
def _removeprefix(text: str, prefix: str) -> str:
24-
"""Remove a certain prefix from a a given text.
25-
26-
This function is supposed to add backwards compartibility with python 3.8 as
27-
python versions equal or greater than 3.9 already offer this as a built in.
28-
"""
29-
if text.startswith(prefix):
30-
return text[len(prefix) :].strip()
31-
return text
32-
33-
3423
def get_black_command(aspect_arguments: python_tool_common.AspectArguments) -> t.List[str]:
3524
"""Returns the command to run a black subprocess."""
3625

@@ -54,7 +43,7 @@ def black_output_parser(tool_output: python_tool_common.SubprocessInfo) -> pytho
5443

5544
for line in tool_output.stderr.splitlines():
5645
if line.startswith(WOULD_REFORMAT_MSG):
57-
file = _removeprefix(line, WOULD_REFORMAT_MSG)
46+
file = line.removeprefix(WOULD_REFORMAT_MSG)
5847
findings += [
5948
python_tool_common.Finding(
6049
path=pathlib.Path(file),

quality/private/python/tools/python_tool_common.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,6 @@ def execute_subprocess(
157157
)
158158

159159

160-
def _is_relative_to(path: pathlib.Path, root: pathlib.Path):
161-
"""Helper function that mimics what pathlib.Path.is_relative_to does.
162-
163-
This is needed to ensure support for python 3.8.
164-
"""
165-
try:
166-
path.relative_to(root)
167-
return True
168-
except ValueError:
169-
return False
170-
171-
172160
@dataclasses.dataclass
173161
class AspectArguments: # pylint: disable=too-many-instance-attributes
174162
"""Class that provides a clean and verified interface between aspect and runner."""
@@ -188,7 +176,7 @@ def resolve_paths(paths: t.List[str], prepend_path: str = "") -> t.Set[pathlib.P
188176
resolved_paths = set()
189177
for path in paths:
190178
try:
191-
if _is_relative_to(pathlib.Path(path), pathlib.Path(self.tool_root)):
179+
if pathlib.Path(path).is_relative_to(pathlib.Path(self.tool_root)):
192180
# This is the usual branch for local files or libraries.
193181
# The code go through here when path is relative to the sandbox root.
194182
resolved_paths.add(pathlib.Path(path).relative_to(self.tool_root).resolve(strict=True))

0 commit comments

Comments
 (0)