Skip to content

Commit

Permalink
fix(repositories): use urls for versioned JSON API instead of `rele…
Browse files Browse the repository at this point in the history
…ases` (#5972)

* fix(repositories): use `urls` for JSON API instead of `releases`
* test(repositories): check for `files` content
* test(repositories): remove `releases` key from version fixtures
  • Loading branch information
mkniewallner authored Jul 8, 2022
1 parent 939d1dd commit bf885ac
Show file tree
Hide file tree
Showing 15 changed files with 99 additions and 762 deletions.
2 changes: 1 addition & 1 deletion src/poetry/repositories/pypi_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _get_release_info(
)

try:
version_info = json_data["releases"][version]
version_info = json_data["urls"]
except KeyError:
version_info = []

Expand Down
36 changes: 0 additions & 36 deletions tests/repositories/fixtures/pypi.org/json/attrs/17.4.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,42 +61,6 @@
"version": "17.4.0"
},
"last_serial": 3451237,
"releases": {
"17.4.0": [
{
"comment_text": "",
"digests": {
"md5": "5835a573b3f0316e1602dac3fd9c1daf",
"sha256": "a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450"
},
"downloads": -1,
"filename": "attrs-17.4.0-py2.py3-none-any.whl",
"has_sig": true,
"md5_digest": "5835a573b3f0316e1602dac3fd9c1daf",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"size": 31658,
"upload_time": "2017-12-30T08:20:05",
"url": "https://files.pythonhosted.org/packages/b5/60/4e178c1e790fd60f1229a9b3cb2f8bc2f4cc6ff2c8838054c142c70b5adc/attrs-17.4.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "d7a89063b2e0fd36bd82389c4d82821d",
"sha256": "1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9"
},
"downloads": -1,
"filename": "attrs-17.4.0.tar.gz",
"has_sig": true,
"md5_digest": "d7a89063b2e0fd36bd82389c4d82821d",
"packagetype": "sdist",
"python_version": "source",
"size": 97071,
"upload_time": "2017-12-30T08:20:08",
"url": "https://files.pythonhosted.org/packages/8b/0b/a06cfcb69d0cb004fde8bc6f0fd192d96d565d1b8aa2829f0f20adb796e5/attrs-17.4.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
Expand Down
116 changes: 0 additions & 116 deletions tests/repositories/fixtures/pypi.org/json/cachecontrol/0.12.5.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,122 +46,6 @@
"version": "0.12.5"
},
"last_serial": 3939938,
"releases": {
"0.12.0": [
{
"comment_text": "",
"digests": {
"md5": "807c457b3b7df9d1f23b1aad7f9c9a22",
"sha256": "ce479e88e697dc088297a5781daa2e812aa0dc888dc439602a308af6f4ff09e8"
},
"downloads": -1,
"filename": "CacheControl-0.12.0.tar.gz",
"has_sig": false,
"md5_digest": "807c457b3b7df9d1f23b1aad7f9c9a22",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13815,
"upload_time": "2017-01-30T05:05:38",
"url": "https://files.pythonhosted.org/packages/41/ae/b9c375b001f13d73c0d8eba2264f6de955769f7cef9140d7fc192814255e/CacheControl-0.12.0.tar.gz"
}
],
"0.12.1": [
{
"comment_text": "",
"digests": {
"md5": "c6c5944d3a6f73bb752a4b4e2e1ffca5",
"sha256": "99c1506b98d53c222493e0ff65904c91aaedd7c8e235cb4f00287ddbbb597072"
},
"downloads": -1,
"filename": "CacheControl-0.12.1.tar.gz",
"has_sig": false,
"md5_digest": "c6c5944d3a6f73bb752a4b4e2e1ffca5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13939,
"upload_time": "2017-03-14T21:42:44",
"url": "https://files.pythonhosted.org/packages/3a/f7/075de886ad249f4ca08615ebd8bec9ce995ed6852790b6d9df38ae059e43/CacheControl-0.12.1.tar.gz"
}
],
"0.12.2": [
{
"comment_text": "",
"digests": {
"md5": "38667f538f36c641eb0b00d0db145823",
"sha256": "d7d919830d7edc5f4b355fa678a2ea49e9ccb67966abc373ec20f93f3f471265"
},
"downloads": -1,
"filename": "CacheControl-0.12.2.tar.gz",
"has_sig": false,
"md5_digest": "38667f538f36c641eb0b00d0db145823",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14327,
"upload_time": "2017-03-27T15:49:21",
"url": "https://files.pythonhosted.org/packages/d2/6c/221f699710a6a643bd9a4324cf22ffb9fb73a089d2bfbed5fe4694f3caaf/CacheControl-0.12.2.tar.gz"
}
],
"0.12.3": [
{
"comment_text": "",
"digests": {
"md5": "45bf98a2e3435438dcee89e519b34195",
"sha256": "a9fc50e216c7c101f4ec4312f012dea501c2859cb256c7a68186a172ab71f632"
},
"downloads": -1,
"filename": "CacheControl-0.12.3.tar.gz",
"has_sig": false,
"md5_digest": "45bf98a2e3435438dcee89e519b34195",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14345,
"upload_time": "2017-05-25T13:49:06",
"url": "https://files.pythonhosted.org/packages/a3/b3/6bb6c1535a283f01fe0c4e9644784756fee2ec080e2a6097f1c59325609e/CacheControl-0.12.3.tar.gz"
}
],
"0.12.4": [
{
"comment_text": "",
"digests": {
"md5": "464675fc575b3a0b841598cb916be516",
"sha256": "a7d21ba4e3633d95ac9fed5be205ee6d1da36bdc4b8914eb7a57ff50b7e5628c"
},
"downloads": -1,
"filename": "CacheControl-0.12.4.tar.gz",
"has_sig": false,
"md5_digest": "464675fc575b3a0b841598cb916be516",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14471,
"upload_time": "2018-01-27T06:24:40",
"url": "https://files.pythonhosted.org/packages/98/f5/76619a63f0e4a1d2f5a1792ebc233a395c648c63d3461dc0331479ef120a/CacheControl-0.12.4.tar.gz"
}
],
"0.12.5": [
{
"comment_text": "",
"digests": {
"md5": "f1baef403e8dd68c5a203e2eb23a0f2e",
"sha256": "cef77effdf51b43178f6a2d3b787e3734f98ade253fa3187f3bb7315aaa42ff7"
},
"downloads": -1,
"filename": "CacheControl-0.12.5.tar.gz",
"has_sig": false,
"md5_digest": "f1baef403e8dd68c5a203e2eb23a0f2e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
"size": 14383,
"upload_time": "2018-06-07T14:53:13",
"url": "https://files.pythonhosted.org/packages/5e/f0/2c193ed1f17c97ae539da7e1c2d48b80d8cccb1917163b26a91ca4355aa6/CacheControl-0.12.5.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
Expand Down
36 changes: 0 additions & 36 deletions tests/repositories/fixtures/pypi.org/json/colorama/0.3.9.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,42 +45,6 @@
"version": "0.3.9"
},
"last_serial": 2833818,
"releases": {
"0.3.9": [
{
"comment_text": "",
"digests": {
"md5": "cc0c01c7b3b34d0354d813e9ab26aca3",
"sha256": "463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda"
},
"downloads": -1,
"filename": "colorama-0.3.9-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "cc0c01c7b3b34d0354d813e9ab26aca3",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"size": 20181,
"upload_time": "2017-04-27T07:12:36",
"url": "https://files.pythonhosted.org/packages/db/c8/7dcf9dbcb22429512708fe3a547f8b6101c0d02137acbd892505aee57adf/colorama-0.3.9-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "3a0e415259690f4dd7455c2683ee5850",
"sha256": "48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"
},
"downloads": -1,
"filename": "colorama-0.3.9.tar.gz",
"has_sig": false,
"md5_digest": "3a0e415259690f4dd7455c2683ee5850",
"packagetype": "sdist",
"python_version": "source",
"size": 25053,
"upload_time": "2017-04-27T07:12:12",
"url": "https://files.pythonhosted.org/packages/e6/76/257b53926889e2835355d74fec73d82662100135293e17d382e2b74d1669/colorama-0.3.9.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
Expand Down
36 changes: 0 additions & 36 deletions tests/repositories/fixtures/pypi.org/json/funcsigs/1.0.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,42 +44,6 @@
"version": "1.0.2"
},
"last_serial": 2083703,
"releases": {
"1.0.2": [
{
"comment_text": "",
"digests": {
"md5": "701d58358171f34b6d1197de2923a35a",
"sha256": "330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca"
},
"downloads": -1,
"filename": "funcsigs-1.0.2-py2.py3-none-any.whl",
"has_sig": true,
"md5_digest": "701d58358171f34b6d1197de2923a35a",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"size": 17697,
"upload_time": "2016-04-25T22:22:05",
"url": "https://files.pythonhosted.org/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "7e583285b1fb8a76305d6d68f4ccc14e",
"sha256": "a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50"
},
"downloads": -1,
"filename": "funcsigs-1.0.2.tar.gz",
"has_sig": true,
"md5_digest": "7e583285b1fb8a76305d6d68f4ccc14e",
"packagetype": "sdist",
"python_version": "source",
"size": 27947,
"upload_time": "2016-04-25T22:22:33",
"url": "https://files.pythonhosted.org/packages/94/4a/db842e7a0545de1cdb0439bb80e6e42dfe82aaeaadd4072f2263a4fbed23/funcsigs-1.0.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
Expand Down
Loading

0 comments on commit bf885ac

Please sign in to comment.