psycopg2 variant (making pg8000 dependency optional)
bernhardreiter opened this issue · comments
Dear @tk0miya,
thanks for creating test.postgresql as Free Software!
Currently I'm considering using this module for testing some python code.
Looking at the requirements, I've noticed that pg8000 is listed.
(And https://github.com/tk0miya/testing.common.database is not, though needed.)
Browsing the code, I see that pg8000 is only used for a few simple operations.
For a python module that already depends on psycopg2 using testing.postgresql will create a new dependency to pg8000. To me it would be an improvement if you make pg8000 optional, so depending on either psycopg2 or pg8000.
Do you agree? Would you accept a pull request for this?
Best Regards
Surely, testing.postgresql brings additional dependency.
But it is used only for testing. So I believe it does not cause any problem.
Do you have any problem for it?
Rather, I'm worry about the modification goes hard to use this library (ex. interface, installation and so on)
As for dependencies:
The testing.common.database dependency is good of course, because it makes your testing components more modular. My suggestion is to add it to the list of requirements for completeness.
Keeping the db api module dependency open towards using either psycopg2 or pg8000 would be an advantage in my view because it would keep number of development dependencies low. Even if it is only one dependency it make contribute code that needs to be maintained and may bring in other dependencies or limitations in the future. Given that my code inspection was correct that only very simple functionality is used, it should be easy to abstract. The installation should be easier in the future because users of testing.postgresql would not have to care for another depenency if they already have psycopg2 for whatever reason (and not using pip, but system packages for instance).
That's not my favorite. But I don't have strong opnition for that.
So could you send me pull request? I will take a look later.