<div dir="ltr"><div>Just one thought:</div><div>I assume $PULP_BASE_ADDR is the part without "pulp/api/v3/". So why should you include the "pulp_python" segment? You could just host it as e.g. "<a href="http://localhost/pypi/foo/simple">http://localhost/pypi/foo/simple</a>". The interfaces provided there should not be in any way specific to pulp_anything.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 18, 2021 at 11:44 PM Gerrod Ubben <<a href="mailto:gubben@redhat.com">gubben@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hey everyone,</div><div><br></div><div>I am currently working on the long-awaited Twine upload support [0] for pulp_python. To add this functionality a new upload endpoint is needed.  Since this new endpoint will need to be able to accept POST requests I plan to make the Python endpoints apart of the Pulp API.  <br></div><div><br></div><div><font size="4">Proposed change: Have Python endpoints available at "/pulp_python/pypi/{base_path}/"</font></div><div><span><table dir="ltr" style="table-layout:fixed;font-size:10pt;font-family:Arial;width:0px;border-collapse:collapse;border:medium none" cellspacing="0" cellpadding="0" border="1"><colgroup><col width="100"><col width="380"><col width="388"><col width="191"></colgroup><tbody><tr style="height:21px"><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">API</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">Current Location</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">New Location</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">Description</td></tr><tr style="height:21px"><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">simple</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">$PULP_CONTENT_ADDR/pulp/content/{base_path}/simple/</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">$PULP_BASE_ADDR/pulp_python/pypi/{base_path}/simple/</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">Used for installing packages</td></tr><tr style="height:21px"><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">pypi</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">$PULP_CONTENT_ADDR/pulp/content/{base_path}/pypi/</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">$PULP_BASE_ADDR/pulp_python/pypi/{base_path}/pypi/</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">Used for syncing repositories</td></tr><tr style="height:21px"><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">upload</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)"><br></td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">$PULP_BASE_ADDR/pulp_python/pypi/{base_path}/legacy/<br><i>*$PULP_BASE_ADDR/pulp_python/pypi/{base_path}/simple/</i></td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;border:1px solid rgb(204,204,204)">Used for uploading packages</td></tr></tbody></table></span></div><div><br></div><div>The current Python endpoints will still be available at their present locations (and will be used as the backbone for the new locations) and the new upload endpoint will be available at '/legacy/' since the default PyPI endpoint Twine uses is '<a href="https://upload.pypi.org/legacy/" target="_blank">https://upload.pypi.org/legacy/</a>'. Pip stores its index URLs in a 'pip.conf' file [1]  and Twine stores its index URLs in the '.pypirc' file [2], so to have an easy setup across all Python tools I am thinking of also having the upload functionality available at the simple URL. This way one URL can be used for the Pulp Python index across all the Python tooling. <br></div><div><br></div><div>An example workflow with these new changes:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>pulp python repository create --name foo</div><div>pulp python distribution create --name foo --base-path foo --repository foo</div><div>export PULP_PYTHON_INDEX=$PULP_BASE_ADDR/pulp_python/pypi/foo/simple/ </div><div>twine upload --repository-url $PULP_PYTHON_INDEX dist/* --skip-existing</div><div>pip install -i $PULP_PYTHON_INDEX pulpcore<br></div></blockquote><div><br></div><div>Do these changes concern anyone? Would a different name for the upload endpoint be preferred? Should the simple endpoint also support uploading packages? I plan on having this feature fully complete and ready for review by the end of the week, May 21st. Any feedback before then would be appreciated. <br></div><div><br></div><div>[0] <a href="https://github.com/pulp/pulp_python/pull/367" target="_blank">https://github.com/pulp/pulp_python/pull/367</a></div><div>[1] <a href="https://pip.pypa.io/en/stable/user_guide/#configuration" target="_blank">https://pip.pypa.io/en/stable/user_guide/#configuration</a></div><div>[2] <a href="https://packaging.python.org/specifications/pypirc/" target="_blank">https://packaging.python.org/specifications/pypirc/</a></div><div><br></div><div>Thanks,</div><div>Gerrod<br></div></div>
_______________________________________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://listman.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://listman.redhat.com/mailman/listinfo/pulp-dev</a><br>
</blockquote></div>