Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report using non-recommended "dependency signage" #468

Open
aecorn opened this issue Nov 18, 2024 · 0 comments
Open

Report using non-recommended "dependency signage" #468

aecorn opened this issue Nov 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@aecorn
Copy link
Contributor

aecorn commented Nov 18, 2024

Many users find dependency-resolution hard.
My recommendations are usually (that ssb-project build does not cover):

  1. Run poetry lock
  2. Replace all dependencies from ^ to >=

I was wondering the right way to "recommend" this in the organization, and I think a warning during ssb-project build could be the best place to encourage right "signage".

Here is some example-code of what I mean.

import subprocess

def check_deps_group(group: str) -> None:
    deps = subprocess.check_output((f"grep -A 10 '\[{group}\]' pyproject.toml"), shell=True).decode("utf8").split("\n")
    deps = [x for x in deps if x and not x.startswith("[") and "build-backend" not in x]
    for line in deps:
        vers_dep = line.split('"')[-2]
        if ">=" not in vers_dep:
            print(f"Dependency {line}, does not use recommended signage '>=', consider changing it?")

check_deps_group("tool.poetry.dependencies")
check_deps_group("tool.poetry.group.dev.dependencies")

image

@arneso-ssb @krlono @rachelekren

@aecorn aecorn added the enhancement New feature or request label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant