Skip to content

Commit

Permalink
dlt requirements check also accepts url with pointer to branch, tag, …
Browse files Browse the repository at this point in the history
…or commit
  • Loading branch information
willi-mueller committed Jul 9, 2024
1 parent 9af1836 commit 55a098e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion check-requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"E.g. dlt>=0.3.5,<0.4.0"
)


def has_url_with_pin(dlt_req: Requirement) -> bool:
"""Checks if the url contains a reference to a branch, tag, or commit"""
return dlt_req.url is not None and "@" in dlt_req.url


for source in source_dirs:
req_path = source.joinpath("requirements.txt")
if not req_path.is_file():
Expand Down Expand Up @@ -54,7 +60,7 @@
)
error = True
continue
if not dlt_req.specifier:
if not dlt_req.specifier and not has_url_with_pin(dlt_req):
print(
f"ERROR: Source {source.name} dlt requirement '{dlt_req}' has no version constraint. {error_msg_suffix}"
)
Expand Down

0 comments on commit 55a098e

Please sign in to comment.