Skip to content
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 instead of psycopg2-binary. #6858

Merged
merged 2 commits into from
Nov 10, 2022
Merged

Conversation

Ayrx
Copy link
Contributor

@Ayrx Ayrx commented Sep 18, 2022

This PR changes DefectDojo to use the psycopg2 package instead of psycopg2-binary.

This fixes a problem with running DefectDojo on aarch64 machines, with the main motivation here being able to do dev work on an Apple Silicon Macbook.

The psycopg2 package also recommends build from source instead of relying on the binary package.

The binary package is a practical choice for development and testing but in production it is advised to use the package built from sources.

@Maffooch
Copy link
Contributor

There was some talk about moving to psycopg3 recently. That may be the better approach here

@mtesauro
Copy link
Contributor

I agree with @Maffooch - if we're going to change how we handle that dependency, might as well upgrade to psycopg3

@Ayrx
Copy link
Contributor Author

Ayrx commented Sep 28, 2022

I'm not familiar enough with the DefectDojo codebase to make that change, since I believe the APIs aren't compatible, so someone else will have to take that on. :)

@devGregA
Copy link
Contributor

@Ayrx thank you for your PR, we're going to work internally on going to psycops3, so I think adding the binary is moving in the wrong direction.

@devGregA devGregA added this to the 2.16.0 milestone Sep 30, 2022
@Ayrx
Copy link
Contributor Author

Ayrx commented Oct 1, 2022

It occured to me that you will have the same issue with psyocpg3. The recommended installation method for production sites is the local installation method which still requires libpq-dev.

https://www.psycopg.org/psycopg3/docs/basic/install.html#local-installation

@damiencarol
Copy link
Contributor

damiencarol commented Oct 7, 2022

@Ayrx so? are you modifying your PR to switch to psyocpg3 or we abandon this PR?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link
Contributor

@Maffooch Maffooch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

psycopg3 is not ready for Django yet, so this is a good step in the right direction :)

@mtesauro
Copy link
Contributor

Thanks @Maffooch for doing the research on this 👍

Copy link
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@mtesauro mtesauro merged commit 29074eb into DefectDojo:dev Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants