Skip to content

Commit 05f38f9

Browse files
pradyunsgewdurbin
andauthored
Rephrase the search XMLRPC disable error (#12173)
* Rephrase the search XMLRPC disable error This reflects the current state of the service more accurately and also serves as a friendlier error message for "pip search" runs. * Rephrase the sentence as suggested in reviews * remove xmlrpc search implementation altogether * update documentation, include references regarding deprecations Co-authored-by: Ee Durbin <[email protected]>
1 parent 28f06a5 commit 05f38f9

File tree

3 files changed

+231
-681
lines changed

3 files changed

+231
-681
lines changed

docs/api-reference/xml-rpc.rst

Lines changed: 188 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
PyPI's XML-RPC methods
33
======================
44

5-
.. note::
5+
.. warning::
66
The XML-RPC API will be deprecated in the future. Use of this API is not
77
recommended, and existing consumers of the API should migrate to the RSS
88
and/or JSON APIs instead.
@@ -41,166 +41,217 @@ Example usage (Python 3)::
4141

4242
.. _changes-to-legacy-api:
4343

44-
Changes to Legacy API
44+
Changes to XMLRPC API
4545
---------------------
4646

47-
``package_releases`` As Warehouse does not support the concept of hidden
48-
releases, the `show_hidden` flag now controls whether the latest version or all
49-
versions are returned.
47+
- ``search`` Permanently deprecated and disabled due to excessive traffic
48+
driven by unidentified traffic, presumably automated. `See historical
49+
incident <https://status.python.org/incidents/grk0k7sz6zkp>`_.
5050

51-
``release_data`` The `stable_version` flag is always an empty string. It was
52-
never fully supported anyway.
51+
- ``package_releases`` As Warehouse does not support the concept of hidden
52+
releases, the `show_hidden` flag now controls whether the latest version or
53+
all versions are returned.
5354

54-
``release_downloads`` and ``top_packages`` No longer supported. Use
55-
`Google BigQuery
56-
<https://mail.python.org/pipermail/distutils-sig/2016-May/028986.html>`_
57-
instead (`guidance
58-
<https://packaging.python.org/guides/analyzing-pypi-package-downloads/>`_,
59-
`tips <https://langui.sh/2016/12/09/data-driven-decisions/>`_).
55+
- ``release_data`` The `stable_version` flag is always an empty string. It was
56+
never fully supported anyway.
6057

61-
Package querying
62-
----------------
58+
- ``release_downloads`` and ``top_packages`` No longer supported. Use
59+
:doc:`Google BigQuery <bigquery-datasets>` instead (`guidance
60+
<https://packaging.python.org/guides/analyzing-pypi-package-downloads/>`_,
61+
`tips <https://langui.sh/2016/12/09/data-driven-decisions/>`_).
6362

64-
``list_packages()``
65-
Retrieve a list of the package names registered with the package index.
66-
Returns a list of name strings.
6763

68-
``package_releases(package_name, show_hidden=False)``
69-
Retrieve a list of the releases registered for the given `package_name`,
70-
ordered by version.
64+
.. _changelog-since:
7165

72-
If `show_hidden` is `False` (the default), only the latest version is
73-
returned. Otherwise, all versions are returned.
66+
Mirroring Support
67+
-----------------
7468

75-
``package_roles(package_name)``
76-
Retrieve a list of `[role, user]` for a given `package_name`.
77-
Role is either `Maintainer` or `Owner`.
69+
.. note::
70+
XML-RPC methods for mirroring support are currently the only methods we
71+
consider fully supported, until an improved mechanism for mirroring is
72+
implemented. Users of these methods should **certainly** subscribe to the
73+
pypi-announce_ mailing list to ensure they are aware of changes or
74+
deprecations related to these methods.
7875

79-
``user_packages(user)``
80-
Retrieve a list of `[role, package_name]` for a given `user`.
81-
Role is either `Maintainer` or `Owner`.
76+
``changelog(since, with_ids=False)``
77+
++++++++++++++++++++++++++++++++++++
8278

83-
``release_urls(package_name, release_version)``
84-
Retrieve a list of download URLs for the given `release_version`.
85-
Returns a list of dicts with the following keys:
86-
87-
* filename
88-
* packagetype ('sdist', 'bdist_wheel', etc)
89-
* python_version (required version, or 'source', or 'any')
90-
* size (an ``int``)
91-
* md5_digest
92-
* digests (a dict with two keys, "md5" and "sha256")
93-
* has_sig (a boolean)
94-
* upload_time_iso_8601 (a ``DateTime`` object)
95-
* comment_text
96-
* downloads (always says "-1")
97-
* url
79+
Retrieve a list of `[name, version, timestamp, action]`, or `[name,
80+
version, timestamp, action, id]` if `with_ids=True`, since the given
81+
`since`. All `since` timestamps are UTC values. The argument is a
82+
UTC integer seconds since the epoch (e.g., the ``timestamp`` method
83+
to a ``datetime.datetime`` object).
9884

99-
``release_data(package_name, release_version)``
100-
Retrieve metadata describing a specific `release_version`.
101-
Returns a dict with keys for:
102-
103-
* name
104-
* version
105-
* stable_version (always an empty string or None)
106-
* bugtrack_url
107-
* package_url
108-
* release_url
109-
* docs_url (URL of the packages.python.org docs if they've been supplied)
110-
* home_page
111-
* download_url
112-
* project_url
113-
* author
114-
* author_email
115-
* maintainer
116-
* maintainer_email
117-
* summary
118-
* description (string, sometimes the entirety of a ``README``)
119-
* license
120-
* keywords
121-
* platform
122-
* classifiers (list of classifier strings)
123-
* requires
124-
* requires_dist
125-
* provides
126-
* provides_dist
127-
* obsoletes
128-
* obsoletes_dist
129-
* requires_python
130-
* requires_external
131-
* _pypi_ordering
132-
* _pypi_hidden
133-
* downloads (``{'last_day': 0, 'last_week': 0, 'last_month': 0}``)
134-
135-
If the release does not exist, an empty dictionary is returned.
85+
``changelog_last_serial()``
86+
+++++++++++++++++++++++++++
13687

137-
``search(spec[, operator])``
138-
Search the package database using the indicated search `spec`.
139-
140-
Returns at most 100 results.
141-
142-
The `spec` may include any of the keywords described in the above list
143-
(except 'stable_version' and 'classifiers'), for example:
144-
{'description': 'spam'} will search description fields. Within the spec, a
145-
field's value can be a string or a list of strings (the values within the
146-
list are combined with an OR), for example: {'name': ['foo', 'bar']}. Valid
147-
keys for the spec dict are listed here. Invalid keys are ignored:
148-
149-
* name
150-
* version
151-
* author
152-
* author_email
153-
* maintainer
154-
* maintainer_email
155-
* home_page
156-
* license
157-
* summary
158-
* description
159-
* keywords
160-
* platform
161-
* download_url
162-
163-
Arguments for different fields are combined using either "and" (the default)
164-
or "or". Example: `search({'name': 'foo', 'description': 'bar'}, 'or')`.
165-
The results are returned as a list of dicts `{'name': package name,
166-
'version': package release version, 'summary': package release summary}`
88+
Retrieve the last event's serial id (an ``int``).
89+
90+
``changelog_since_serial(since_serial)``
91+
++++++++++++++++++++++++++++++++++++++++
92+
93+
Retrieve a list of `(name, version, timestamp, action, serial)` since the
94+
event identified by the given ``since_serial``. All timestamps are UTC
95+
values.
96+
97+
``list_packages_with_serial()``
98+
+++++++++++++++++++++++++++++++
99+
100+
Retrieve a dictionary mapping package names to the last serial for each
101+
package.
102+
103+
104+
Package querying
105+
----------------
106+
107+
``package_roles(package_name)``
108+
+++++++++++++++++++++++++++++++
109+
110+
Retrieve a list of `[role, user]` for a given `package_name`.
111+
Role is either `Maintainer` or `Owner`.
112+
113+
``user_packages(user)``
114+
+++++++++++++++++++++++
115+
116+
Retrieve a list of `[role, package_name]` for a given `user`.
117+
Role is either `Maintainer` or `Owner`.
167118

168119
``browse(classifiers)``
169-
Retrieve a list of `[name, version]` of all releases classified with all of
170-
the given classifiers. `classifiers` must be a list of Trove classifier
171-
strings.
120+
+++++++++++++++++++++++
121+
122+
Retrieve a list of `[name, version]` of all releases classified with all of
123+
the given classifiers. `classifiers` must be a list of Trove classifier
124+
strings.
172125

173126
``updated_releases(since)``
174-
Retrieve a list of package releases made since the given timestamp. The
175-
releases will be listed in descending release date.
127+
+++++++++++++++++++++++++++
128+
129+
Retrieve a list of package releases made since the given timestamp. The
130+
releases will be listed in descending release date.
176131

177132
``changed_packages(since)``
178-
Retrieve a list of package names where those packages have been changed
179-
since the given timestamp. The packages will be listed in descending date
180-
of most recent change.
133+
+++++++++++++++++++++++++++
181134

182-
.. _changelog-since:
135+
Retrieve a list of package names where those packages have been changed
136+
since the given timestamp. The packages will be listed in descending date
137+
of most recent change.
183138

184-
Mirroring Support
185-
-----------------
186139

187-
``changelog(since, with_ids=False)``
188-
Retrieve a list of `[name, version, timestamp, action]`, or `[name,
189-
version, timestamp, action, id]` if `with_ids=True`, since the given
190-
`since`. All `since` timestamps are UTC values. The argument is a
191-
UTC integer seconds since the epoch (e.g., the ``timestamp`` method
192-
to a ``datetime.datetime`` object).
140+
``list_packages()``
141+
+++++++++++++++++++
193142

194-
``changelog_last_serial()``
195-
Retrieve the last event's serial id (an ``int``).
143+
.. warning::
144+
Migrate to using the :doc:`Simple API <legacy>`.
196145

197-
``changelog_since_serial(since_serial)``
198-
Retrieve a list of `(name, version, timestamp, action, serial)` since the
199-
event identified by the given ``since_serial``. All timestamps are UTC
200-
values.
146+
Retrieve a list of the package names registered with the package index.
147+
Returns a list of name strings.
201148

202-
``list_packages_with_serial()``
203-
Retrieve a dictionary mapping package names to the last serial for each
204-
package.
149+
``package_releases(package_name, show_hidden=False)``
150+
+++++++++++++++++++++++++++++++++++++++++++++++++++++
151+
152+
.. warning::
153+
Migrate to using the :doc:`json`.
154+
155+
Retrieve a list of the releases registered for the given `package_name`,
156+
ordered by version.
157+
158+
If `show_hidden` is `False` (the default), only the latest version is
159+
returned. Otherwise, all versions are returned.
160+
161+
``release_urls(package_name, release_version)``
162+
+++++++++++++++++++++++++++++++++++++++++++++++
163+
164+
.. warning::
165+
Migrate to using the :doc:`json`.
166+
167+
Retrieve a list of download URLs for the given `release_version`.
168+
Returns a list of dicts with the following keys:
169+
170+
* filename
171+
* packagetype ('sdist', 'bdist_wheel', etc)
172+
* python_version (required version, or 'source', or 'any')
173+
* size (an ``int``)
174+
* md5_digest
175+
* digests (a dict with two keys, "md5" and "sha256")
176+
* has_sig (a boolean)
177+
* upload_time_iso_8601 (a ``DateTime`` object)
178+
* comment_text
179+
* downloads (always says "-1")
180+
* url
181+
182+
``release_data(package_name, release_version)``
183+
+++++++++++++++++++++++++++++++++++++++++++++++
184+
185+
.. warning::
186+
Migrate to using the :doc:`json`.
187+
188+
Retrieve metadata describing a specific `release_version`.
189+
Returns a dict with keys for:
190+
191+
* name
192+
* version
193+
* stable_version (always an empty string or None)
194+
* bugtrack_url
195+
* package_url
196+
* release_url
197+
* docs_url (URL of the packages.python.org docs if they've been supplied)
198+
* home_page
199+
* download_url
200+
* project_url
201+
* author
202+
* author_email
203+
* maintainer
204+
* maintainer_email
205+
* summary
206+
* description (string, sometimes the entirety of a ``README``)
207+
* license
208+
* keywords
209+
* platform
210+
* classifiers (list of classifier strings)
211+
* requires
212+
* requires_dist
213+
* provides
214+
* provides_dist
215+
* obsoletes
216+
* obsoletes_dist
217+
* requires_python
218+
* requires_external
219+
* _pypi_ordering
220+
* _pypi_hidden
221+
* downloads (``{'last_day': 0, 'last_week': 0, 'last_month': 0}``)
222+
223+
If the release does not exist, an empty dictionary is returned.
224+
225+
226+
Deprecated Methods
227+
------------------
228+
229+
.. warning::
230+
The following methods are permanently deprecated and will return a
231+
`RuntimeError`
232+
233+
``package_data(package_name, version)``
234+
+++++++++++++++++++++++++++++++++++++++
235+
236+
Deprecated in favor of ``release_data``, :doc:`json` should be used.
237+
238+
``package_urls(package_name, version)``
239+
+++++++++++++++++++++++++++++++++++++++
240+
241+
Deprecated in favor of ``release_urls``, :doc:`json` should be used.
242+
243+
``top_packages(num=None)``
244+
++++++++++++++++++++++++++
245+
246+
Use :doc:`Google BigQuery <bigquery-datasets>`
247+
instead (`guidance <https://packaging.python.org/guides/analyzing-pypi-package-downloads/>`_,
248+
`tips <https://langui.sh/2016/12/09/data-driven-decisions/>`_).
249+
250+
``search(spec[, operator])``
251+
++++++++++++++++++++++++++++
252+
253+
Permanently deprecated and disabled due to excessive traffic
254+
driven by unidentified traffic, presumably automated. `See historical incident
255+
<https://status.python.org/incidents/grk0k7sz6zkp>`_.
205256

206257
.. _pypi-announce: https://mail.python.org/mailman3/lists/pypi-announce.python.org/

0 commit comments

Comments
 (0)