Fix the pip requirements setup#176
Fix the pip requirements setup#176NicolasFussberger wants to merge 2 commits intoeclipse-score:mainfrom
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
PiotrKorkus
left a comment
There was a problem hiding this comment.
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.txtwith current deps - Run
bazel run //tests/integration:requirements.update - Remove
requirements_lock.txtfrom repo root - Replace in MODULE file in pip.parse command:
requirements_lock = "//tests/integration:requirements.lock",
| 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__"], | ||
| ) |
There was a problem hiding this comment.
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.
- MODULE file: https://github.com/eclipse-score/reference_integration/blob/3c843821b8e055372e87ea3aff6ac84b53e903ea/bazel_common/score_python.MODULE.bazel#L33
- requirements.in: https://github.com/eclipse-score/reference_integration/blob/main/scripts/tooling/requirements.in
- requirements.txt (lockfile): https://github.com/eclipse-score/reference_integration/blob/main/scripts/tooling/requirements.txt
- BUILD file for the compile reqs: https://github.com/eclipse-score/reference_integration/blob/3c843821b8e055372e87ea3aff6ac84b53e903ea/scripts/tooling/BUILD#L24
Cleanup the way that python requirements are used:
bazel run //:requirements.updateto update the lockfile