The PyPA recommended tool for installing Python packages.
91
Build a Python tool that downloads packages from Python package indexes that require authentication. Your tool should support three authentication methods: credentials embedded in URLs, .netrc configuration files, and system keyring services. The tool should automatically use the appropriate authentication method based on what's available.
.netrc for matching host entries.netrc doesn't provide credentials, attempt to retrieve them from the system keyringProvides Python package installation and download functionality with multi-domain authentication support.
Input:
example-packagehttps://user:pass@private-pypi.example.com/simple/./downloads/Expected Behavior:
Input:
example-packagehttps://private-pypi.example.com/simple/machine private-pypi.example.com
login netrc-user
password netrc-pass./downloads/Expected Behavior:
Input:
example-packagehttps://user1:pass1@index1.example.com/simple/https://index2.example.com/simple/./downloads/Expected Behavior:
Create the following files:
multi_index_downloader.py - Main implementation filetest_multi_index_downloader.py - Test file containing the three test cases aboveYour implementation should demonstrate proper use of the package's authentication capabilities across multiple domains and credential sources.
Install with Tessl CLI
npx tessl i tessl/pypi-pipevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10