Skip to content

Commit

Permalink
Exclude dependencies that are tagged with > in requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Mar 4, 2025
1 parent 6c5695c commit dda92ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- ".github/workflows/version.yml"

jobs:
check-python-version:
dependencies:
runs-on: thevickypedia-lite
steps:
- uses: actions/checkout@v4
Expand Down
14 changes: 9 additions & 5 deletions dev_scripts/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,15 @@ def get_package_and_version(
# Define the pattern for splitting at special characters and capturing the version
pattern = r"([=<>#@])"
split_result = re.split(pattern, input_string, maxsplit=1)
# Now extract the version from the remaining part of the string
# noinspection RegExpUnnecessaryNonCapturingGroup,RegExpRedundantEscape,RegExpSimplifiable
version_match = re.search(r"[\d]+\.[\d]+(?:\.[\d]+)?(?:[\.\*]*)", input_string)
version = version_match.group(0) if version_match else None
return dict(package_name=split_result[0].strip(), current_version=version)
pkg_name = split_result[0].strip()
if split_result[1] == ">":
version = ".".join(split_result[-1].lstrip("=").split(".")[:-1]) + ".*"
else:
# Now extract the version from the remaining part of the string
# noinspection RegExpUnnecessaryNonCapturingGroup,RegExpRedundantEscape,RegExpSimplifiable
version_match = re.search(r"[\d]+\.[\d]+(?:\.[\d]+)?(?:[\.\*]*)", input_string)
version = version_match.group(0) if version_match else None
return dict(package_name=pkg_name, current_version=version)


def read_requirements(
Expand Down

0 comments on commit dda92ae

Please sign in to comment.