Support PEP 508 dependency specifications

Open
#239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
devtools

Research direction

Start with the requirements.txt example and the --python-version and --requirement command-line entry points described in the issue. Trace how the PEP 508 environment marker is evaluated, then verify that selecting Python 3.10 includes pydantic in the packages and resolved dependency graph while the reported requirement remains intact.

Written by the indexing model from the issue text.

Description

I have the following requirements.txt:

pydantic==2.11.7 ; python_full_version < '3.11'

python-inspector is running on a system with Python 3.11, but I'm setting the version to 3.10:

python-inspector --python-version 310 --json-pdt result.json --requirement requirements.txt

This is the result:

  {
    "headers": {
    "tool_name": "python-inspector",
    "tool_homepageurl": "https://github.com/aboutcode-org/python-inspector",
    "tool_version": "0.14.3",
    "options": [
      "--index-url https://pypi.org/simple",
      "--json-pdt result-minimal.json",
      "--operating-system linux",
      "--python-version 310",
      "--requirement requirements-minimal.txt"
    ],
    "notice": "Dependency tree generated with python-inspector.\npython-inspector is a free software tool from nexB Inc. and others.\nVisit https://github.com/aboutcode-org/python-inspector/ for support and download.",
    "warnings": [],
    "errors": []
  },
  "files": [
    {
      "type": "file",
      "path": "requirements-minimal.txt",
      "package_data": [
        {
          "type": "pypi",
          "namespace": null,
          "name": null,
          "version": null,
          "qualifiers": {},
          "subpath": null,
          "primary_language": "Python",
          "description": null,
          "release_date": null,
          "parties": [],
          "keywords": [],
          "homepage_url": null,
          "download_url": null,
          "size": null,
          "sha1": null,
          "md5": null,
          "sha256": null,
          "sha512": null,
          "bug_tracking_url": null,
          "code_view_url": null,
          "vcs_url": null,
          "copyright": null,
          "license_expression": null,
          "declared_license": null,
          "notice_text": null,
          "source_packages": [],
          "file_references": [],
          "extra_data": {},
          "dependencies": [
            {
              "purl": "pkg:pypi/[email protected]",
              "extracted_requirement": "pydantic==2.11.7; python_full_version < \"3.11\"",
              "scope": "install",
              "is_runtime": true,
              "is_optional": false,
              "is_resolved": true,
              "resolved_package": {},
              "extra_data": {
                "is_editable": false,
                "link": null,
                "hash_options": [],
                "is_constraint": false,
                "is_archive": null,
                "is_wheel": false,
                "is_url": null,
                "is_vcs_url": null,
                "is_name_at_url": false,
                "is_local_path": null
              }
            }
          ],
          "repository_homepage_url": null,
          "repository_download_url": null,
          "api_data_url": null,
          "datasource_id": "pip_requirements",
          "purl": null
        }
      ]
    }
  ],
  "packages": [],
  "resolved_dependencies_graph": []
}

The expected outcome would be that the packages and the resolved dependency graph is correctly populated, but because I'm running on python 3.11 this dependency is not considered as relevant, and excluded.

Dominant language
Python
Stars
23
Forks
29
Avg merge
1h 7m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aboutcode-org/python-inspector

All issues in aboutcode-org/python-inspector

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.