-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update install script (#17851)
Fixed script
- Loading branch information
1 parent
84a27d5
commit 301ab02
Showing
1 changed file
with
24 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Install scripts for M1 Macs | ||
# See https://github.com/PostHog/posthog/issues/2916 | ||
# NB: use cryptography==3.4.7 | ||
## NOTE: This is a helper script to simplify the process of getting setup on macOS. If in doubt check https://posthog.com/handbook/engineering/developing-locally | ||
|
||
# Set ld flags to use OpenSSL installed with brew | ||
export LDFLAGS="-L$(brew --prefix openssl)/lib" | ||
export CPPFLAGS="-I$(brew --prefix openssl)/include" | ||
set -e | ||
|
||
# Use system OpenSSL instead of BoringSSL for GRPC | ||
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 | ||
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 | ||
echo "Attempting to install all dependencies and setup virtualenv..." | ||
echo "" | ||
|
||
pip cache purge | ||
pip install -r requirements.txt | ||
# Ensure we are in a directory ending with "posthog" | ||
if [[ "$PWD" != *"/posthog" ]]; then | ||
echo "Please run this script from a directory ending with 'posthog'" | ||
exit 1 | ||
fi | ||
|
||
if [[ $* == *--reset* ]]; then | ||
rm -rf env/ | ||
fi | ||
|
||
python3.10 -m venv env | ||
source env/bin/activate | ||
|
||
brew install openssl | ||
CFLAGS="-I /opt/homebrew/opt/openssl/include $(python3.10-config --includes)" LDFLAGS="-L /opt/homebrew/opt/openssl/lib" GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pip install -r requirements.txt | ||
|
||
pip install -r requirements-dev.txt | ||
|
||
echo "" | ||
echo "🚀 Done!" |