pypi / warehouse

The Python Package Index
https://pypi.org
Apache License 2.0
3.6k stars 963 forks source link

Add ability to configure a redirect for documentation previously hosted by PyPI #3417

Open ewdurbin opened 6 years ago

ewdurbin commented 6 years ago

582 was closed by #3413, but only completes one half of the work.

we still should provide the ability for users to configure a redirect from files.pythonhosted.org/<project.name> to some new URL.

icemac commented 6 years ago

I'd like to have the redirect, too, so older links to the documentation of a package do not get broken without the possibility to tell where the documentation is hosted nowadays.

brainwane commented 6 years ago

I asked Eric Holscher @ericholscher for his comments:

It's something that will likely take work on my side, if we want to allow them to upload/redirect. We have pydoc.io, which we're still working on, but it would be an obvious home for docs people want to upload to pypi.

Think there's some more info here: #509 #582

I think the big thing to prioritize is some way to auth pypi users. We'd need to do Oauth or something similar to verify identity of pypi users in order for people to "claim" packages. I've thought about some janky method like confirming the email address in the setup.py, but I'd really like it to be Oauth.

ewdurbin commented 5 years ago

https://github.com/pypa/conveyor/pull/3 implements the necessary infrastructure to support this.

It reads/parses a redirects.txt from the root of the bucket which contains a \n joined set of JSON redirect configurations:

{"project_name": "clandestined", "include_path": false, "base_uri": "https://ernest.ly"}
{"project_name": "pypi-docs-proxy", "include_path": true, "base_uri": "https://ernest.ly"}

To implement this feature in Warehouse we will need to create a form that allows users with documentation hosted on pythonhosted.org to specify the above parameters and store it in the warehouse db.

A warehouse task should periodically generate and publish the full redirects.txt to the root of the configured DOCS_BACKEND. Conveyor will poll this periodically and then update it's redirects.

brainwane commented 5 years ago

We talked about this today & would love help from a volunteer on this!

So: please go ahead and grab this issue! Just comment and say that you're starting to work on it, and link in a comment to your work-in-progress branch once you start.

As always, if you have questions along the way as you work on this, please feel free to ask them here, in #pypa-dev on Freenode, or the pypa-dev mailing list.

pchtsp commented 5 years ago

I'm sorry to highjack this thread but I'm going crazy trying to manually add a redirect on our old docs (https://pythonhosted.org/PuLP/) to our new documentation (http://coin-or.github.io/pulp/) following this stackoverflow's instructions but I can't for the life of me find any option in all of pypi to upload or delete the documentation. I'm maintainer in the PuLP project.

Am I supposed to be owner of the project to see this option? Has it been taken down? Is there anyway to update the current documentation in pypi to manually add a simple redirect? What are our current alternatives to redirect people from one site to the other?

Thanks!

Franco

ewdurbin commented 5 years ago

@pchtsp the feature has not yet been implemented in warehouse. conveyor, which serves pythonhosted.org still has support for the protocol described in https://github.com/pypa/warehouse/issues/3417#issuecomment-475664303 if/when it is implemented.

pchtsp commented 5 years ago

@ewdurbin thanks for the answer.

So, if I understood correctly, our current alternatives are (1) taking down the documentation completely from pythonhoste or (2) leave the documentation in its current state.

Unless / until the functionality is added to the pypi site, there is no way of modifyig the current version of the docs that are hosted in pythonhosted.

Is this accurate?

Thanks again!

ewdurbin commented 5 years ago

That is correct @pchtsp.