Skip to content

Direct reference metadata compatibility #3014

Closed
pypa/hatch
#1924
@ofek

Description

@ofek

I'm in the process of adding support for UV in Hatch and I noticed that the test suite is failing because of a difference in how UV writes direct_url.json vs pip, specifically the requested_revision field. The reason this is read is to determine whether dependencies are in sync.

Given the following requirements:

requests @ git+https://github.com/psf/requests
httpx @ git+https://github.com/encode/httpx@master

The following command shows different results based on which installer was used:

python -c "import json,pprint;from importlib.metadata import distribution;pprint.pprint([json.loads(distribution(pkg).read_text('direct_url.json')) for pkg in ['requests', 'httpx']])"

UV:

[{'url': 'https://github.com/psf/requests',
  'vcs_info': {'commit_id': '31ebb8102c00f8cf8b396a6356743cca4362e07b',
               'requested_revision': '31ebb8102c00f8cf8b396a6356743cca4362e07b',
               'vcs': 'git'}},
 {'url': 'https://github.com/encode/httpx',
  'vcs_info': {'commit_id': '4b85e6c3898b94e686b427afd83138c87520b479',
               'requested_revision': '4b85e6c3898b94e686b427afd83138c87520b479',
               'vcs': 'git'}}]

pip:

[{'url': 'https://github.com/psf/requests',
  'vcs_info': {'commit_id': '31ebb8102c00f8cf8b396a6356743cca4362e07b',
               'vcs': 'git'}},
 {'url': 'https://github.com/encode/httpx',
  'vcs_info': {'commit_id': '4b85e6c3898b94e686b427afd83138c87520b479',
               'requested_revision': 'master',
               'vcs': 'git'}}]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions