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

feat(dev): Install postgresql on Apple M1 to build psycopg2-binary #28607

Merged
merged 8 commits into from
Sep 23, 2021

Conversation

armenzg
Copy link
Member

@armenzg armenzg commented Sep 15, 2021

Create a new target which installs different libraries via brew depending on the context.

For instance, on Apple M1 machines it should installed a couple more libraries.

In the future, the bootstrap script and documentation should be using this target.

Fixes #28606

Create a new target which installs different libraries via brew depending on the context.

For instance, on Apple M1 machines it should installed a couple more libraries.

In the future, the bootstrap script and documentation should be using this target.

Fixes #28606
@armenzg armenzg self-assigned this Sep 15, 2021
@armenzg armenzg added this to the Apple M1 Python support milestone Sep 15, 2021
@armenzg armenzg added the Component: Developer Environment This covers issues related to setting up a developer's environment label Sep 15, 2021
@armenzg armenzg changed the title feat(dev): Add make prerequisites target feat(dev): Install postgreqsl on Apple M1 to build psycopg2-binary Sep 21, 2021
psycopg2-binary==2.8.6
psycopg2-binary==2.8.6; python_version == '3.6'
# This removes needing to set CPPFLAGS & LDFLAGS
psycopg2-binary==2.9.1; python_version > '3.8'
Copy link
Member Author

Choose a reason for hiding this comment

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

If I don't do this, I would have to do this somewhere in install-py-dev:

CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include" \
    LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/python@3.8/lib" \
    pip install psycopg2-binary==2.8.6

Copy link
Member

Choose a reason for hiding this comment

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

You won't be installing this on 3.8.

Ignoring psycopg2-binary: markers 'python_version == "3.6"' don't match your environment
Ignoring psycopg2-binary: markers 'python_version > "3.8"' don't match your environment

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! It was a last second commit that introduced the problem. I've corrected this and tested it out.

@@ -24,7 +24,7 @@ jobs:
fail-fast: false
env:
PIP_DISABLE_PIP_VERSION_CHECK: on
# Make the environment more similar to what Mac defaults to
# Make the environment more similar to hat Mac defaults to
Copy link
Member

Choose a reason for hiding this comment

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

mistake?

@@ -35,7 +35,9 @@ Pillow==8.2.0; python_version == '3.6'
Pillow==8.3.1; python_version > '3.6'
progressbar2==3.32.0
python-rapidjson==1.4
psycopg2-binary==2.8.6
psycopg2-binary==2.8.6; python_version == '3.6'
# This removes needing to set CPPFLAGS & LDFLAGS
Copy link
Member

Choose a reason for hiding this comment

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

Should we note that this only affects local development since we only support 3.6 in prod atm?

@armenzg armenzg changed the title feat(dev): Install postgreqsl on Apple M1 to build psycopg2-binary feat(dev): Install postgresql on Apple M1 to build psycopg2-binary Sep 23, 2021
@armenzg armenzg merged commit 3f71db8 into master Sep 23, 2021
@armenzg armenzg deleted the armenzg/dev/make-prerequisites branch September 23, 2021 12:29
@armenzg armenzg linked an issue Sep 23, 2021 that may be closed by this pull request
vuluongj20 pushed a commit that referenced this pull request Sep 30, 2021
…28607)

Create a new target which installs different libraries via brew depending on the context.

For instance, on Apple M1 machines it should installed a couple more libraries.
This helps to install the psycopg2-binary package since there's no wheel for it.
We also upgrade the version of it in order to avoid needing to set some CPPFLAGS & LDFLAGS.

In the future, the bootstrap script and documentation should be using this target.

Fixes #28606
armenzg added a commit that referenced this pull request Oct 1, 2021
For the incompatibility issue with Django visit [this issue][incompatible],

In this PR, we're going to downgrade to the compatible 2.8.6 version (thus, matching
the Python 3.6 version), removing the need to install `postgresql` (this means partially
reverting #28607) and instead installing a wheel I built on my machine that I have stored
in GC storage.

Fixes #28958

[incompatible]: psycopg/psycopg2#1293
armenzg added a commit that referenced this pull request Oct 6, 2021
For the incompatibility issue with Django visit [this issue][incompatible],

In this PR, we're going to downgrade to the compatible 2.8.6 version (thus, matching
the Python 3.6 version), removing the need to install `postgresql` (this means partially
reverting #28607) and instead installing a wheel I built on my machine that I have stored
in GC storage.

Fixes #28958

[incompatible]: psycopg/psycopg2#1293
armenzg added a commit that referenced this pull request Oct 7, 2021
For the incompatibility issue with Django visit [this issue][incompatible],

In this PR, we're going to downgrade to the compatible 2.8.6 version (thus, matching
the Python 3.6 version), removing the need to install `postgresql` (this means partially
reverting #28607) and instead installing a wheel I built on my machine that I have stored
in GC storage.

Fixes #28958

[incompatible]: psycopg/psycopg2#1293
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: Developer Environment This covers issues related to setting up a developer's environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add make prerequisites target psycogbinary2 does not install for Apple's M1
3 participants