Skip to content

Fix the pip requirements setup#176

Open
NicolasFussberger wants to merge 2 commits intoeclipse-score:mainfrom
etas-contrib:feature/fix-pip-requirements
Open

Fix the pip requirements setup#176
NicolasFussberger wants to merge 2 commits intoeclipse-score:mainfrom
etas-contrib:feature/fix-pip-requirements

Conversation

@NicolasFussberger
Copy link
Copy Markdown
Contributor

Cleanup the way that python requirements are used:

  • Introduce a proper requirments.txt lock file
  • Support bazel run //:requirements.update to update the lockfile

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.4.2) and connecting to it...
INFO: Invocation ID: 610cb652-2d2b-4a2f-ba1c-9d0a8c1d5a2f
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'rules_python', the root module requires module version rules_python@1.8.3, but got rules_python@1.8.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.2.16, but got rules_cc@0.2.17 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_tooling', the root module requires module version score_tooling@1.1.0, but got score_tooling@1.1.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_rust_policies', the root module requires module version score_rust_policies@0.0.3, but got score_rust_policies@0.0.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (45 packages loaded, 10 targets configured)

Analyzing: target //:license-check (88 packages loaded, 10 targets configured)

Analyzing: target //:license-check (143 packages loaded, 2641 targets configured)

Analyzing: target //:license-check (152 packages loaded, 4668 targets configured)

Analyzing: target //:license-check (163 packages loaded, 7899 targets configured)

Analyzing: target //:license-check (163 packages loaded, 7899 targets configured)

Analyzing: target //:license-check (165 packages loaded, 8023 targets configured)

INFO: Analyzed target //:license-check (168 packages loaded, 10037 targets configured).
[12 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions, 1 running)
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 23.575s, Critical Path: 2.53s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

Copy link
Copy Markdown
Contributor

@PiotrKorkus PiotrKorkus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current solution was partially correct. The only thing that needs fixing is that compile_pip_requirements generates file requirements.lock that this PR is removing and in your MODULE pip is parsing requirements_lock.txt which is incorrect.

  • Keep requirements.lock
  • update tests/integration/requirements.txt with current deps
  • Run bazel run //tests/integration:requirements.update
  • Remove requirements_lock.txt from repo root
  • Replace in MODULE file in pip.parse command:
requirements_lock = "//tests/integration:requirements.lock",

Comment thread tests/integration/BUILD
Comment on lines -23 to 36
compile_pip_requirements(
name = "requirements",
srcs = [
"requirements.txt",
"@score_tooling//python_basics:requirements.txt",
],
extra_args = [
"--no-annotate",
],
requirements_txt = "requirements.lock",
tags = [
"manual",
],
filegroup(
name = "pip_requirements",
srcs = ["requirements.txt"],
visibility = ["//:__pkg__"],
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usage of compile_pip_requirements is correct.

There should be two requirements files in repository. One with list of libraries that is the input to this command and one lock file generated by this command.
In MODULE file there is pip parse of the requirements lock.

Please take a look at the setup in reference_integration - this is corerct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants