-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature request: An option to check
to ignore development dependencies
#87
Comments
Looks like I can work around this; this is a little quirky. poetry install --no-dev
poetry run pip install pylic
poetry run pylic check |
Hi @bruceadams Thanks a lot for raising this issue! Indeed, you're right, that tracking a specific subset of dependencies is not directly supported by This has the advantage to be simple regarding the API, but also easy to understand by the user (I hope at least 😄 ) But your issue is still totally valid. This would be especially useful once [tool.poetry.group.production.dependencies]
httpx = "*"
pendulum = "*"
[tool.poetry.group.dev.dependencies]
pytest = "^6.0.0"
pytest-mock = "*"
[tool.pylic]
safe_licenses = ["..."]
unsafe_packages = ["..."]
check_only_groups = ["production"] # defaults to all groups if not set This is just from the top of my head, so this might be not (easily) possible. I'm thinking e.g. about packages that are installed as dependencies from I will give this more thought, in the meantime you're stuck with creating an environment where only the packages are installed you want to license check and then install and run Happy for input or solution attemps! Cheers 🙂 |
My problem is: I need to fail on GPL-like licenses, but only if they appear in my main dependencies. I use What might be both understandable and practical to implement is another option in the |
That sounds like a reasonable proposal and as you said would fit into the existing structure along the |
The problem I see with e.g. Also in your situation you probably still want to allow e.g. Since Also Does this make sense? Still I'm giving this more thought and the discussion is still wide open 🙂 |
It will always be somewhat awkward to license check only production dependencies as Regarding separate license sets it might make sense to somehow have a similar grouping concept to Either something inside Something along those lines... At least this would allow you to split the licenses into distinctive sets for development and production. |
Your concern with my proposed I can imagine a slightly more complex approach that still fits into How about two additional configuration items:
Where the licenses listed in |
Great stuff! This is what I had in mind with Also I'm not sure if we want to start simple with a specific solution (e.g But it feels like we're slowly converging towards a solution! |
What about the following API: Current usage and "base" scenario[tool.pylic]
safe_licenses = [
"Apache Software License",
"Apache License 2.0",
"...",
]
unsafe_packages = [
"somPackage",
] Checking the licenses would still be done via Using the new grouping feature[tool.pylic] # this is equal to [tool.pylic.default]
safe_licenses = [
"Apache License 2.0",
"GPL-2.0",
"...",
]
unsafe_packages = [
"somePackage",
]
[tool.pylic.prod]
safe_licenses = [
"Apache Software License",
"MIT",
"MIT License",
"...",
] Checking the licenses of your production dependencies would then be possible via
Would that be something that you could be excited about @bruceadams ? Or would you prefer another API? |
This sounds good! In your example, I am unsure how |
This would work the same as it's working now. As an example:
poetry install
poetry run pylic check
poetry install --no-dev
poetry run pip install pylic
poetry run pylic check --only prod Regarding the [tool.poetry]
name = "test"
version = "0.1.0"
description = ""
[tool.poetry.dependencies]
python = "^3.9"
black = "^22.1.0"
pylic = {version = "^2.2.0", optional = true}
[tool.poetry.dev-dependencies]
pytest = "^5.2"
[tool.poetry.extras]
pylic = ["pylic"]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api" This would mean
poetry install -E pylic
poetry run pylic check
poetry install --no-dev -E pylic
poetry run pylic check --only prod But as one most probably uses Did this help? 🙂 |
hey @bruceadams we recently added the |
Some internal projects I work on, the big concern is licenses on dependencies that we use at runtime. We are more flexible about licenses for development dependencies. I would love to be about to use
pylic check
with an option to ignore development dependencies, much likepoetry show --no-dev
.The text was updated successfully, but these errors were encountered: