-
Notifications
You must be signed in to change notification settings - Fork 93
Dependencies: Isolate pyodbc
package
#296
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
base: main
Are you sure you want to change the base?
Conversation
odbc = [ | ||
"pyodbc==5.1.0", | ||
"pyodbc==5.2.0", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requirements-dev.txt
said 5.2.0 would be fine, so we used it without much ado.
pyodbc
package
3797de9
to
9a20b45
Compare
Per package metadata definition, it is an optional "extra" dependency. Let's make it a reality, and also let CI cover the scenarios well.
fixed in #298 |
Hi @turtleDev. Feel free to close this PR if you don't have a need. Our advise however is to revert GH-298 and use this patch instead, because it also takes care about relevant software testing matters, and also takes a clean approach instead of mixing concerns. |
ruff==0.11.4 | ||
hatchling==1.27.0 | ||
build==1.2.1 | ||
pyodbc==5.2.0 | ||
twine==6.0.1 | ||
testcontainers[postgres,mysql]==4.8.2 | ||
pytest-xdist[psutil]==3.6.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing pyodbc
here is absolutely crucial so that its presence will not negatively mask any operations on the code base to make it work without.
hey @amotl it's not a (high) priority right now for us. There are some rough edges around ingestr that we plan to refactor down the road. Thanks for the contribution though! I would like to invite you to join our slack community. You can get a better picture of what we're working on and as an alternate platform for discussions around ingestr. |
Hi @turtleDev. Then let's keep the PR open for the future refactorings you are referring to, that could lead to corresponding quality improvements? Thanks for the invite, I may join your Slack, but in general I try to keep distraction low and productivity high, and there is already another Slack I need to deal with ;]. On the other hand, let me know if you would like to receive support on ingestr in any way to polyfill the capacities if it's currently a low priority for you. 1 Let's put the PR back into draft mode? Footnotes
|
About
The most recent release v0.13.64 made the pyodbc package a strict requirement. This patch relaxes that again by isolating the dependency into a dedicated module which is only imported at runtime when MSSQL is selected.
Synopsis
The application will not fail when the pyodbc package is not installed.
Details
The isolation is accompanied by a minor testing/CI reorg to cover both situations well. Introducing a dedicated
full
extra which bundles all the extra dependency groups into a single entrypoint has been approved in other polyglot code bases in the past.It is well suited to cover two scenarios to verify if the package works with all extras, and without any extras. Of course, this paradigm can be made more granular when there is demand. As a common best practice, discriminating between minimal vs. full is good enough.
References
ModuleNotFoundError: No module named 'pyodbc'
#293