Skip to content

Commit

Permalink
Correctly mark package names with versions as remote libraries (#1697)
Browse files Browse the repository at this point in the history
## Changes
Fixes databricks/setup-cli#124

## Tests
Added regression test
  • Loading branch information
andrewnester authored Aug 20, 2024
1 parent 242d4b5 commit 6771ba0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bundle/libraries/local_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) == ""
}
Expand Down
1 change: 1 addition & 0 deletions bundle/libraries/local_path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6771ba0

Please sign in to comment.