Document Python dependency resolution behaviors and limitations

What does this MR do?

Python users hit two dependency resolution failures that the docs don't explain. They come from requirements files with Git URLs, and from packages that have to build from source. I added both to the "Python resolution known issues" list on the dependency scanning SBOM page, each with a workaround. As the issue proposes, I also listed two requirements file options that already work. These are nested -r files, and --index-url / --extra-index-url lines.

This picks up the issue author's earlier MRs !242742 (closed) and !242744 (closed), which were closed as stale without merging.

For Git URLs, the page describes what the analyzer does today. The manifest with the git+https://... line fails, and the other manifests still resolve. gitlab-org/security-products/analyzers/dependency-scanning!591 (closed) would have stripped those lines, but it was also closed without merging. If it lands later, I'm happy to update the bullet.

Where the statements come from, in the analyzer source:

  • Requirements files go to pip-compile as they are. Only -e and file: lines are removed (source).
  • Index URLs are never written to the lockfile (source).
  • Each manifest resolves from its own directory, so relative -r paths work and one failure doesn't stop the others (source).
  • A requirements.txt generated by pip-compile or uv counts as a lockfile, so the "create the lockfile yourself" workaround works (source).

"The default resolution image doesn't include git" comes from #597725. I didn't pull the image to check it myself.

Decisions where I moved away from the issue proposal. I can change any of them:

  1. The page doesn't link #597727 (closed), #597725 or #597724 (closed). They are closed or can close with this MR, so readers would land on closed issues.
  2. The page doesn't name aiohttp, cryptography or numpy as failing packages. I believe they ship pre-built wheels for Python 3.12 on Linux. The bullet describes the condition instead: no pre-built wheel and no build tools.
  3. There is no "wait for the fix" line, because the style guide asks us not to promise future changes.
  4. For Git URLs, the page doesn't suggest generating the lockfile yourself. That lockfile would contain name @ git+https://... lines, and I couldn't confirm the analyzer parses them.

I re-ran these checks today against the current branch:

$ git diff --check upstream/master...origin/605349-ds-python-resolution-known-issues
$ git diff -U0 upstream/master...origin/605349-ds-python-resolution-known-issues | grep '^+[^+]' | awk 'length($0)-1>100' | wc -l
0

I also checked that the three new links point to headings that exist on the same page. I don't have Vale or markdownlint locally. In the pipeline for the current commit, docs-lint markdown (markdownlint and Vale) and docs-lint links passed.

Closes #605349 (closed)

Related to #597725 (as discussed there, it can be closed after this merges)

Author's checklist

If you are a GitLab team member and only adding documentation, do not add any of the following labels:

  • ~"frontend"
  • ~"backend"
  • ~"type::bug"
  • ~"database"

These labels cause the MR to be added to code verification QA issues.

Reviewer's checklist

Documentation-related MRs should be reviewed by a Technical Writer for a non-blocking review, based on Documentation Guidelines and the Style Guide.

If you aren't sure which tech writer to ask, use roulette or ask in the #docs Slack channel.

  • If the content requires it, ensure the information is reviewed by a subject matter expert.
  • Technical writer review items:
    • Ensure docs metadata is present and up-to-date.
    • Ensure the appropriate labels are added to this MR.
    • Ensure a release milestone is set.
    • If relevant to this MR, ensure content topic type principles are in use, including:
      • The headings should be something you'd do a Google search for. Instead of Default behavior, say something like Default behavior when you close an issue.
      • The headings (other than the page title) should be active. Instead of Configuring GDK, say something like Configure GDK.
      • Any task steps should be written as a numbered list.
      • If the content still needs to be edited for topic types, you can create a follow-up issue with the docs-technical-debt label.
  • Review by assigned maintainer, who can always request/require the reviews above. Maintainer's review can occur before or after a technical writer review.

Implemented with AI assistance; I reviewed and tested the changes.

Edited by Hamza Hassanain

Merge request reports

Loading
Loading