-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use psycopg2-binary dep for Postgres and Redshift when v2.8 comes out #1221
Comments
Tentatively including this in the 0.14.1 milestone, but it may make sense to push this to a minor release since the upgrade path might be non-trivial. It sounds like we'll need to run uninstall Last: it sounds like |
I've done far more reading on this than I'd like, and what I think I want to do is require My reasoning is that on macos and windows especially, building psycopg2 locally requires a bunch of headers that the average user is realistically just never going to install. Since so far the wheels have been working fine for us, I don't think it's very reasonable to change that and require you to have a compiler toolchain + libpq headers. On the other hand, on Linux it's apparently reasonably likely to get mystery segfaults when openssl versions change or whatever. I've never experienced that on our docker images but I'm willing to believe it - this poor guy wouldn't have gone through all this nonsense unless he had a compelling reason! So we probably need to at least provide some way to let those users get psycopg2 installed. I'm not sure exactly how to do this but I do know that setup.py provides a few ways to pass flags along. The real painful part is that we have to pass those arguments through to our plugins, if provided. I think the easiest thing to do is probably to just use environment variables to decide if we should dynamically set the install_requires=[
'{} >=2.8.2, <2.9'.format(os.getenv('DBT_PSYCOPG2_PACKAGE', 'psycopg2-binary')),
...
] Then if you know better, you can always set There are two big downsides here:
The way I see it we don't have much choice but to default to |
@beckjake do you think we should do this for 0.14.1? Or should we hold off for 0.15.0? |
I feel pretty comfortable with it on 0.14.1 if we feel good about the pain of changing dependencies on a minor release. I've been using it locally since this issue got written and everything seems fine. |
Ok - I recall you mentioning that |
We can test it out, but I would guess upgrades end in users who have both the old |
@beckjake I think I want to kick this out of the 0.14.1 milestone. I think your ideas here are good ones, but I have so little faith in pip doing the right for us thing here, and it would be really unfortunate if we bricked a lot of dbt installations in weird ways in a bugfix/patch release. Let's re-prioritize this for 0.15.0 -- that should give us some time to explore (and test) the approaches you've outlined in your comment above. |
Ok, further progress on this:
The current plan is that we're going to install |
The
psycopg2
dep currently ships as a wheel, but version 2.8 will revert psycopg2 back to being source-only. This won't be a problem for dbt, as we've set the upper bound of psycopg2 to 2.8.When the 2.8 release eventually comes out, we should upgrade and switch dbt to use the psycopg2-binary dep instead.
Information about releases here.
And info about the binary release here.
The text was updated successfully, but these errors were encountered: