Correctly mark package names with versions as remote libraries (#1697)

## Changes
Fixes https://github.com/databricks/setup-cli/issues/124

## Tests
Added regression test
This commit is contained in:
Andrew Nester 2024-08-20 11:33:03 +02:00 committed by GitHub
parent 242d4b51ed
commit 6771ba09a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -66,6 +66,11 @@ func IsLibraryLocal(dep string) bool {
}
func isPackage(name string) bool {
// If the dependency has ==, it's a package with version
if strings.Contains(name, "==") {
return true
}
// If the dependency has no extension, it's a PyPi package name
return path.Ext(name) == ""
}

View File

@ -54,6 +54,7 @@ func TestIsLibraryLocal(t *testing.T) {
{path: "-r /Workspace/my_project/requirements.txt", expected: false},
{path: "s3://mybucket/path/to/package", expected: false},
{path: "dbfs:/mnt/path/to/package", expected: false},
{path: "beautifulsoup4==4.12.3", expected: false},
}
for i, tc := range testCases {