refactor: simplify pypi and npm URL rewriting — single remote, no redundant config keys
- npm: remove npm_files_url/npm_files_remote; rewrite uses base_url and remote name directly (same approach as helm) - npm: replace hardcoded .tgz extension check with immutable_patterns match - pypi: collapse pypi + pypi-files into a single remote (base_url points to files.pythonhosted.org); simple/ requests are transparently fetched from pypi.org with no extra config required - pypi: remove pypi_files_url/pypi_files_remote from pypi and pypi-gitea - pypi: rewrite check now uses immutable_patterns (consistent with npm) - Update README for both pypi and npm sections - Update tests and fixtures to reflect single-remote pypi config
This commit is contained in:
+5
-15
@@ -73,30 +73,20 @@ TEST_REMOTES = {
|
||||
"cache": {"immutable_ttl": 0, "mutable_ttl": 0},
|
||||
},
|
||||
"pypi-test": {
|
||||
"base_url": "https://pypi.org",
|
||||
"type": "remote",
|
||||
"package": "pypi",
|
||||
"pypi_files_url": "https://files.pythonhosted.org",
|
||||
"pypi_files_remote": "pypi-files-test",
|
||||
"cache": {"immutable_ttl": 0, "mutable_ttl": 600},
|
||||
},
|
||||
"pypi-files-test": {
|
||||
"base_url": "https://files.pythonhosted.org",
|
||||
"type": "remote",
|
||||
"package": "generic",
|
||||
"package": "pypi",
|
||||
"immutable_patterns": [
|
||||
"packages/.*\\.whl$",
|
||||
"packages/.*\\.whl\\.metadata$",
|
||||
"packages/.*\\.tar\\.gz$",
|
||||
r"packages/.*\.whl$",
|
||||
r"packages/.*\.whl\.metadata$",
|
||||
r"packages/.*\.tar\.gz$",
|
||||
],
|
||||
"cache": {"immutable_ttl": 0, "mutable_ttl": 0},
|
||||
"cache": {"immutable_ttl": 0, "mutable_ttl": 600},
|
||||
},
|
||||
"npm-test": {
|
||||
"base_url": "https://registry.npmjs.org",
|
||||
"type": "remote",
|
||||
"package": "npm",
|
||||
"npm_files_url": "https://registry.npmjs.org",
|
||||
"npm_files_remote": "npm-test",
|
||||
"immutable_patterns": [r"\.tgz$"],
|
||||
"mutable_patterns": [r"^(?!.*\.tgz$).*"],
|
||||
"cache": {"immutable_ttl": 0, "mutable_ttl": 600},
|
||||
|
||||
Reference in New Issue
Block a user