A way to pre-configure a map of package names to module names#333
A way to pre-configure a map of package names to module names#333fpgmaas merged 4 commits intofpgmaas:mainfrom akeeman:patch-1
Conversation
Codecov Report
@@ Coverage Diff @@
## main #333 +/- ##
=======================================
- Coverage 91.8% 91.1% -0.8%
=======================================
Files 29 29
Lines 955 991 +36
Branches 201 212 +11
=======================================
+ Hits 877 903 +26
- Misses 50 56 +6
- Partials 28 32 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
Thanks for opening the PR! I think the added functionality looks good. I was not able yet to test is locally successfully. Do you have a good example package that can be used for testing? I recall encountering this issue in the past, but I do not recall with which package. For now, I tried cheating a bit and just switching [tool.deptry.package_module_name_map]
click = [
"tomli",
]
tomli = [
"click",
]But because we also still look for metadata, this results in: so my hacky local test that does not really work :) If you would be so kind to add unit tests and documentation, I would be happy to review and merge! |
|
Good examples are packages that have a prefix |
I think it's OK to look for metedata for other uses. As far as I can see the only use case is the 'publicly' available property |
|
A small formatting issue in the CI/CD, otherwise; looks good to me! I really appreciate you taking the time to add this feature! |
|
There you go! Pre-commit found some more stuff. |
PR Checklist
docsis updatedDescription of changes
Adding a pre-configured map between package names and module names, so not installed modules don't produce errors when a package name doesn't auto-convert to the module name. E.g. package name
foo-pythonis translated to modulefoo_python, but it's actually calledfoo.Fixes #332
Before adding tests & docs, let's see if this is an acceptable problem & solution direction.