Skip to content

Commit f6c0291

Browse files
authored
Merge pull request #1506 from konstin/url-must-be-a-url
RFC: Clarify that the direct_url.json url field must be a spec-compliant url
2 parents 63993ba + 0f44140 commit f6c0291

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

source/specifications/direct-url-data-structure.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ This document specifies a JSON-serializable abstract data structure that can rep
1010
URLs to python projects and distribution artifacts such as VCS source trees, local
1111
source trees, source distributions and wheels.
1212

13-
The representation of the components of this data structure as a :rfc:`1738` URL
14-
is not formally specified at time of writing. A common representation is the pip URL
15-
format. Other examples are provided in the :ref:`Version specifier specification <version-specifiers>`.
16-
13+
At time of writing, it is not formally specified how to merge the parts of this
14+
data structure into a single URL that can be passed to tools. A common representation is the
15+
pip URL format (`VCS Support <pip-vcs-support_>`_), other examples are provided in the
16+
:ref:`Version specifier specification <version-specifiers>`.
1717

1818
Specification
1919
=============
@@ -22,9 +22,12 @@ The Direct URL Data Structure MUST be a dictionary, serializable to JSON accordi
2222
:rfc:`8259`.
2323

2424
It MUST contain at least two fields. The first one is ``url``, with
25-
type ``string``. Depending on what ``url`` refers to, the second field MUST be
26-
one of ``vcs_info`` (if ``url`` is a VCS reference), ``archive_info`` (if
27-
``url`` is a source archives or a wheel), or ``dir_info`` (if ``url`` is a
25+
type ``string``. Its content must be a valid URL according to the
26+
`WHATWG URL Standard <whatwg-url-standard_>`_.
27+
28+
Depending on what ``url`` refers to, the second field MUST be one of ``vcs_info``
29+
(if ``url`` is a VCS reference), ``archive_info`` (if
30+
``url`` is a source archive or a wheel), or ``dir_info`` (if ``url`` is a
2831
local directory). These info fields have a (possibly empty) subdictionary as
2932
value, with the possible keys defined below.
3033

@@ -396,3 +399,5 @@ History
396399

397400

398401
.. _archive-info-hashes: https://discuss.python.org/t/22299
402+
.. _pip-vcs-support: https://pip.pypa.io/en/stable/topics/vcs-support/
403+
.. _whatwg-url-standard: https://url.spec.whatwg.org/

0 commit comments

Comments
 (0)