Repository: pypi/warehouse

Issue:
Implement DOAP
Determine if we need to keep DOAP or if we can get rid of it. If keeping it then we need to implement it. See some discussion on #58.



Discussion:
My guess is no one knows what DOAP is. I've seen it on PyPI and had no clue and looked it up one time and concluded that it was something that was in vogue a long time ago and never really caught on?

Believe it or not, I've had people ping me about it only very recently, so
it's being used. No idea how much though, or for what purpose.

On Sat, 14 Mar 2015 at 20:10 Marc Abramowitz notifications@github.com
wrote:

> My guess is no one knows what DOAP is. I've seen it on PyPI and had no
> clue and looked it up one time and concluded that it was something that was
> in vogue a long time ago and never really caught on?
> 
> —
> Reply to this email directly or view it on GitHub
> https://github.com/pypa/warehouse/issues/391#issuecomment-80190363.


Resolving patch:
diff --git a/warehouse/legacy/api/pypi.py b/warehouse/legacy/api/pypi.py
--- a/warehouse/legacy/api/pypi.py
+++ b/warehouse/legacy/api/pypi.py
@@ -720,6 +720,11 @@ def doc_upload(request):
     )
 
 
+@view_config(route_name="legacy.api.pypi.doap")
+def doap(request):
+    return _exc_with_message(HTTPGone, "DOAP is no longer supported.")
+
+
 @forbidden_view_config(request_param=":action")
 def forbidden_legacy(exc, request):
     # We're not going to do anything amazing here, this just exists to override
diff --git a/warehouse/routes.py b/warehouse/routes.py
--- a/warehouse/routes.py
+++ b/warehouse/routes.py
@@ -68,6 +68,7 @@ def includeme(config):
         "submit_pkg_info",
     )
     config.add_pypi_action_route("legacy.api.pypi.doc_upload", "doc_upload")
+    config.add_pypi_action_route("legacy.api.pypi.doap", "doap")
 
     # Legacy XMLRPC
     config.add_xmlrpc_endpoint(


Test patch:
diff --git a/tests/functional/legacy_api/test_removed.py b/tests/functional/legacy_api/test_removed.py
--- a/tests/functional/legacy_api/test_removed.py
+++ b/tests/functional/legacy_api/test_removed.py
@@ -26,3 +26,8 @@ def test_remove_doc_upload(webtest):
         "410 Uploading documentation is no longer supported, we recommend "
         "using https://readthedocs.org/."
     )
+
+
+def test_doap(webtest):
+    resp = webtest.get("/pypi?:action=doap&name=foo&version=1.0", status=410)
+    assert resp.status == "410 DOAP is no longer supported."
diff --git a/tests/unit/legacy/api/test_pypi.py b/tests/unit/legacy/api/test_pypi.py
--- a/tests/unit/legacy/api/test_pypi.py
+++ b/tests/unit/legacy/api/test_pypi.py
@@ -1223,6 +1223,13 @@ def test_doc_upload(pyramid_request):
     )
 
 
+def test_doap(pyramid_request):
+    resp = pypi.doap(pyramid_request)
+
+    assert resp.status_code == 410
+    assert resp.status == "410 DOAP is no longer supported."
+
+
 def test_forbidden_legacy():
     exc, request = pretend.stub(), pretend.stub()
     resp = pypi.forbidden_legacy(exc, request)
diff --git a/tests/unit/test_routes.py b/tests/unit/test_routes.py
--- a/tests/unit/test_routes.py
+++ b/tests/unit/test_routes.py
@@ -101,6 +101,7 @@ def add_xmlrpc_endpoint(endpoint, pattern, header):
         pretend.call("legacy.api.pypi.submit", "submit"),
         pretend.call("legacy.api.pypi.submit_pkg_info", "submit_pkg_info"),
         pretend.call("legacy.api.pypi.doc_upload", "doc_upload"),
+        pretend.call("legacy.api.pypi.doap", "doap"),
     ]
 
     assert config.add_xmlrpc_endpoint.calls == [