containerbuildsystem / cachi2

GNU General Public License v3.0
5 stars 20 forks source link

Support configurable index urls for pip and private registry auth (not just) for pip #551

Closed chmeliik closed 1 month ago

chmeliik commented 1 month ago

TLDR:

Run new test with:

make test-integration TEST_LOCAL_PYPISERVER=true TOX_ARGS='-k custom_index'

Maintainers will complete the following section

Note: if the contribution is external (not from an organization member), the CI pipeline will not run automatically. After verifying that the CI is safe to run:

chmeliik commented 1 month ago

This should be everything that's needed for cachi2 to support custom PyPI servers, including auth.

Auth is done via .netrc, same as pip: https://pip.pypa.io/en/stable/topics/authentication/#netrc-support. Pip also supports keyring auth but the docs make it sound rather strange. Doesn't seem worth supporting.

Let me know if you would like an ADR for any of this :saluting_face:

TODO: make the integration test run in CI, ideally without copy-pasting most of the Makefile target

taylormadore commented 1 month ago

Wow, this did indeed end up being quite straightforward. LGTM so far :+1:

chmeliik commented 1 month ago

I've made the CI work with the new int. test, should be ready for review

chmeliik commented 1 month ago

One more small improvement: used contextlib.ExitStack to make absolutely sure the process get .terminate()-ed before python starts waiting for it to clean it up

chmeliik commented 1 month ago

Just a rebase, will address comments in next force-push