Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@

### Bundles
* Updated the internal lakeflow-pipelines template to use an "src" layout ([#3671](https://github.com/databricks/cli/pull/3671)).
* Fix for pip flags with equal sign being incorrectly treated as local file names ([#3766](https://github.com/databricks/cli/pull/3766))

### API Changes
2 changes: 2 additions & 0 deletions acceptance/bundle/environments/dependencies/databricks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ resources:
- "beautifulsoup4>=1.0.0,~=1.2.0,<2.0.0"
- "beautifulsoup4[security, tests] ~= 4.12.3"
- "requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip"
- "--find-links=/Workspace/Users/test"

pipelines:
test_pipeline:
Expand All @@ -49,3 +50,4 @@ resources:
- "test_package>=2.0.1"
- "beautifulsoup4>=1.0.0,~=1.2.0,<2.0.0"
- "requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip"
- "--find-links=/Workspace/Users/test"
12 changes: 8 additions & 4 deletions acceptance/bundle/environments/dependencies/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Deployment complete!
"/Workspace/Users/[email protected]/test-package.whl",
"beautifulsoup4>=1.0.0,~=1.2.0,<2.0.0",
"beautifulsoup4[security, tests] ~= 4.12.3",
"requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip"
"requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip",
"--find-links=/Workspace/Users/test"
]
}
},
Expand Down Expand Up @@ -71,7 +72,8 @@ Deployment complete!
"test_package==2.0.1",
"test_package>=2.0.1",
"beautifulsoup4>=1.0.0,~=1.2.0,<2.0.0",
"requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip"
"requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip",
"--find-links=/Workspace/Users/test"
]
},
"name": "Test Pipeline"
Expand All @@ -96,7 +98,8 @@ Deployment complete!
"/Workspace/Users/[email protected]/test-package.whl",
"beautifulsoup4>=1.0.0,~=1.2.0,<2.0.0",
"beautifulsoup4[security, tests] ~= 4.12.3",
"requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip"
"requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip",
"--find-links=/Workspace/Users/test"
]
}
},
Expand Down Expand Up @@ -124,6 +127,7 @@ Deployment complete!
"test_package==2.0.1",
"test_package>=2.0.1",
"beautifulsoup4>=1.0.0,~=1.2.0,<2.0.0",
"requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip"
"requests[security] @ https://github.com/psf/requests/archive/refs/heads/main.zip",
"--find-links=/Workspace/Users/test"
]
}
2 changes: 1 addition & 1 deletion bundle/libraries/local_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func containsPipFlag(input string) bool {
// Trailing space means the the flag takes an argument or there's multiple arguments in input
// Alternatively it could be a flag with no argument and no space after it
// For example: -r myfile.txt or --index-url http://myindexurl.com or -i
re := regexp.MustCompile(`(^|\s+)--?[a-zA-Z0-9-]+(\s+|$)`)
re := regexp.MustCompile(`(^|\s+)--?[a-zA-Z0-9-]+(([\s|=]+)|$)`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think you only need ([\s=]|$) -- either a space, an =, or the end of the string.

More than one space or = doesn't change the result.

return re.MatchString(input)
}

Expand Down
6 changes: 6 additions & 0 deletions bundle/libraries/local_path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ func TestIsLibraryLocal(t *testing.T) {
{path: "-e some/local/path", expected: false},
{path: "-i http://myindexurl.com", expected: false},
{path: "--index-url http://myindexurl.com", expected: false},
{path: "--index-url http://myindexurl.com", expected: false},
{path: "-i", expected: false},
{path: "--index-url", expected: false},
{path: "-i -e", expected: false},
{path: "--find-links=/Workspace/Users/test", expected: false},
{path: "--find-links = /Workspace/Users/test.whl", expected: false},
{path: "--find-links =/Workspace/Users/test.whl", expected: false},
{path: "--find-links = /Workspace/Users/test.whl", expected: false},
{path: "--find-links /Workspace/Users/test", expected: false},

// Check the possible version specifiers as in PEP 440
// https://peps.python.org/pep-0440/#public-version-identifiers
Expand Down
Loading