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

chore: update to python 3.11.6 #18482

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# experience as rich as possible. Perhaps later down the line it might be worth
# rolling our own
#
FROM mcr.microsoft.com/vscode/devcontainers/python:3.10-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/python:3.11-bullseye

# Make sure all exit codes on pipes cause failures
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand All @@ -32,6 +32,7 @@
netcat brotli curl \
&& rm -rf /var/lib/apt/lists/*

# hadolint ignore=DL3004
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
Expand All @@ -45,7 +46,7 @@
# install pnpm globally, this container doesn't expose a supported shell to the pnpm installer
# so `RUN curl -fsSL https://get.pnpm.io/install.sh | sh -` fails
# see https://github.com/pnpm/pnpm/issues/4495
RUN npm install --global pnpm \

Check warning on line 49 in .devcontainer/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in npm. Instead of `npm install <package>` use `npm install <package>@<version>`
&& SHELL=bash pnpm setup \
&& source /root/.bashrc

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Run Django tests
inputs:
python-version:
required: true
description: Python version, e.g. 3.10.10
description: Python version, e.g. 3.11.4
clickhouse-server-image:
required: true
description: ClickHouse server image tag, e.g. clickhouse/clickhouse-server:latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10.10
python-version: 3.11.6
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10.10
python-version: 3.11.6
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
id: cache-backend-tests
with:
custom_cache_key_element: v1-
custom_cache_key_element: v1

- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-backend-tests.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -181,13 +181,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10.10
python-version: 3.11.6
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
id: cache-backend-tests
with:
custom_cache_key_element: v1-
custom_cache_key_element: v1

- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-backend-tests.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.10.10']
python-version: ['3.11.6']
clickhouse-server-image: ['clickhouse/clickhouse-server:23.6.1.1524']
segment: ['FOSS', 'EE']
person-on-events: [false, true]
Expand Down Expand Up @@ -325,13 +325,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10.10
python-version: 3.11.6
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
id: cache-backend-tests
with:
custom_cache_key_element: v1-
custom_cache_key_element: v1

- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-backend-tests.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-hobby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11.6'
cache: 'pip' # caching pip dependencies
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
- name: Get python deps
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-plugin-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ jobs:
if: needs.changes.outputs.plugin-server == 'true'
uses: actions/setup-python@v4
with:
python-version: 3.10.10
python-version: 3.11.6
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
if: needs.changes.outputs.plugin-server == 'true'
id: cache-backend-tests
with:
custom_cache_key_element: v1-
custom_cache_key_element: v1

- uses: syphar/restore-pip-download-cache@v1
if: needs.changes.outputs.plugin-server == 'true' && steps.cache-backend-tests.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -215,13 +215,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10.10
python-version: 3.11.6
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
id: cache-backend-tests
with:
custom_cache_key_element: v1-
custom_cache_key_element: v1

- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-backend-tests.outputs.cache-hit != 'true'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ jobs:
export PR_NUM=${{ github.event.number }}
export BRANCH_NAME=${{ github.head_ref }}
export RELEASE_NAME=posthog
# branch name but with no forward slashes
export NAMESPACE=pr-$PR_NUM-${BRANCH_NAME//\//-}
# and no full stops
export NAMESPACE=${NAMESPACE//./-}
export NAMESPACE=${NAMESPACE:0:38}
export NAMESPACE=${NAMESPACE%%-}
export HOSTNAME=$NAMESPACE
Expand Down
1 change: 1 addition & 0 deletions .run/Celery.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<env name="SKIP_SERVICE_VERSION_REQUIREMENTS" value="1" />
</envs>
<option name="SDK_HOME" value="$PROJECT_DIR$/env/bin/python" />
<option name="SDK_NAME" value="Python 3.11 (posthog)" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/env/bin" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
Expand Down
4 changes: 2 additions & 2 deletions .run/PostHog.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
<env name="BILLING_SERVICE_URL" value="https://billing.dev.posthog.dev" />
<env name="CAPTURE_TIME_TO_SEE_DATA" value="0" />
<env name="CLICKHOUSE_SECURE" value="False" />
Expand All @@ -14,15 +15,14 @@
<env name="KEA_VERBOSE_LOGGING" value="false" />
<env name="PRINT_SQL" value="1" />
<env name="PYDEVD_USE_CYTHON" value="NO" />
<env name="PYTHONUNBUFFERED" value="1" />
<env name="SESSION_RECORDING_KAFKA_COMPRESSION" value="gzip" />
<env name="SESSION_RECORDING_KAFKA_HOSTS" value="localhost" />
<env name="SESSION_RECORDING_KAFKA_MAX_REQUEST_SIZE_BYTES" value="524288" />
<env name="SKIP_SERVICE_VERSION_REQUIREMENTS" value="1" />
<env name="REPLAY_EVENTS_NEW_CONSUMER_RATIO" value="1" />
</envs>
<option name="SDK_HOME" value="$PROJECT_DIR$/env/bin/python" />
<option name="SDK_NAME" value="Python 3.10 (posthog)" />
<option name="SDK_NAME" value="Python 3.11 (posthog)" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
Expand Down
1 change: 1 addition & 0 deletions posthog/clickhouse/client/escape.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,6 @@ def escape_param_for_clickhouse(param: Any) -> str:
revision="placeholder server_info value",
display_name="placeholder server_info value",
timezone="UTC",
used_revision="placeholder server_info value",
)
return escape_param(param, context=context)
2 changes: 1 addition & 1 deletion production-unit.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# Compile and install Node.js dependencies.
COPY ./plugin-server/package.json ./plugin-server/pnpm-lock.yaml ./plugin-server/tsconfig.json ./
COPY ./plugin-server/patches/ ./patches/
RUN apt-get update && \

Check warning on line 50 in production-unit.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get install -y --no-install-recommends \
"make" \
"g++" \
Expand Down Expand Up @@ -81,7 +81,7 @@
#
# ---------------------------------------------------------
#
FROM python:3.10.10-slim-bullseye AS posthog-build
FROM python:3.11.6-slim-bullseye AS posthog-build
WORKDIR /code
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand All @@ -89,7 +89,7 @@
# We install those dependencies on a custom folder that we will
# then copy to the last image.
COPY requirements.txt ./
RUN apt-get update && \

Check warning on line 92 in production-unit.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get install -y --no-install-recommends \
"build-essential" \
"git" \
Expand Down Expand Up @@ -121,7 +121,7 @@
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Fetch the GeoLite2-City database that will be used for IP geolocation within Django.
RUN apt-get update && \

Check warning on line 124 in production-unit.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get install -y --no-install-recommends \
"ca-certificates" \
"curl" \
Expand All @@ -143,7 +143,7 @@

# Install OS runtime dependencies.
# Note: please add in this stage runtime dependences only!
RUN apt-get update && \

Check warning on line 146 in production-unit.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check notice on line 146 in production-unit.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Delete the apt-get lists after installing something
apt-get install -y --no-install-recommends \
"chromium" \
"chromium-driver" \
Expand All @@ -153,7 +153,7 @@
"libxml2"

# Install NodeJS 18.
RUN apt-get install -y --no-install-recommends \

Check warning on line 156 in production-unit.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
"curl" \
&& \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
Expand Down Expand Up @@ -210,5 +210,5 @@
# Expose the port from which we serve OpenMetrics data.
EXPOSE 8001
COPY unit.json /docker-entrypoint.d/unit.json
USER root

Check warning on line 213 in production-unit.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Last USER should not be root
CMD ["./bin/docker"]
4 changes: 2 additions & 2 deletions production.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# Compile and install Node.js dependencies.
COPY ./plugin-server/package.json ./plugin-server/pnpm-lock.yaml ./plugin-server/tsconfig.json ./
COPY ./plugin-server/patches/ ./patches/
RUN apt-get update && \

Check warning on line 66 in production.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get install -y --no-install-recommends \
"make" \
"g++" \
Expand Down Expand Up @@ -97,7 +97,7 @@
#
# ---------------------------------------------------------
#
FROM python:3.10.10-slim-bullseye AS posthog-build
FROM python:3.11.6-slim-bullseye AS posthog-build
WORKDIR /code
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand All @@ -105,7 +105,7 @@
# We install those dependencies on a custom folder that we will
# then copy to the last image.
COPY requirements.txt ./
RUN apt-get update && \

Check warning on line 108 in production.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get install -y --no-install-recommends \
"build-essential" \
"git" \
Expand Down Expand Up @@ -137,7 +137,7 @@
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Fetch the GeoLite2-City database that will be used for IP geolocation within Django.
RUN apt-get update && \

Check warning on line 140 in production.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
apt-get install -y --no-install-recommends \
"ca-certificates" \
"curl" \
Expand All @@ -152,14 +152,14 @@
#
# ---------------------------------------------------------
#
FROM python:3.10.10-slim-bullseye
FROM python:3.11.6-slim-bullseye
WORKDIR /code
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV PYTHONUNBUFFERED 1

# Install OS runtime dependencies.
# Note: please add in this stage runtime dependences only!
RUN apt-get update && \

Check notice on line 162 in production.Dockerfile

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Delete the apt-get lists after installing something
apt-get install -y --no-install-recommends \
"chromium" \
"chromium-driver" \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 120
target-version = ['py310']
target-version = ['py311']

[tool.isort]
profile = "black"
Expand Down
11 changes: 1 addition & 10 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements-dev.in
Expand Down Expand Up @@ -90,8 +90,6 @@ docopt==0.6.2
# via pytest-watch
email-validator==2.0.0.post2
# via pydantic
exceptiongroup==1.1.2
# via pytest
faker==17.5.0
# via -r requirements-dev.in
fakeredis[lua]==2.11.0
Expand Down Expand Up @@ -293,13 +291,6 @@ toml==0.10.1
# via
# coverage
# datamodel-code-generator
tomli==1.2.3
# via
# black
# build
# mypy
# pyproject-hooks
# pytest
types-freezegun==1.1.10
# via -r requirements-dev.in
types-markdown==3.3.9
Expand Down
7 changes: 5 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# - `pip-compile --rebuild requirements.in`
# - `pip-compile --rebuild requirements-dev.in`
#
yarl>=1.8.1
frozenlist>=1.3.1
lxml>=4.9.0
aiohttp>=3.8.4
aioboto3==11.1
antlr4-python3-runtime==4.13.1
Expand All @@ -13,7 +16,7 @@ boto3-stubs[s3]
brotli==1.1.0
celery==5.3.4
celery-redbeat==2.1.1
clickhouse-driver==0.2.4
clickhouse-driver==0.2.6
clickhouse-pool==0.5.3
cryptography==37.0.2
defusedxml==0.6.0
Expand Down Expand Up @@ -57,7 +60,7 @@ pickleshare==0.7.5
Pillow==9.2.0
posthoganalytics==3.0.1
prance==0.22.2.22.0
psycopg2-binary==2.9.7
psycopg2-binary==2.9.9
pyarrow==12.0.1
pydantic==2.3.0
pyjwt==2.4.0
Expand Down
20 changes: 11 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements.in
Expand Down Expand Up @@ -102,7 +102,7 @@ click-plugins==1.1.1
# via celery
click-repl==0.3.0
# via celery
clickhouse-driver==0.2.4
clickhouse-driver==0.2.6
# via
# -r requirements.in
# clickhouse-pool
Expand Down Expand Up @@ -210,8 +210,9 @@ drf-spectacular==0.24.2
# via -r requirements.in
filelock==3.12.0
# via snowflake-connector-python
frozenlist==1.3.0
frozenlist==1.4.0
# via
# -r requirements.in
# aiohttp
# aiosignal
future==0.18.3
Expand Down Expand Up @@ -285,8 +286,9 @@ kombu==5.3.2
# via
# -r requirements.in
# celery
lxml==4.6.5
lxml==4.9.3
# via
# -r requirements.in
# python3-saml
# toronado
# xmlsec
Expand Down Expand Up @@ -356,7 +358,7 @@ protobuf==4.22.1
# grpcio-status
# proto-plus
# temporalio
psycopg2-binary==2.9.7
psycopg2-binary==2.9.9
# via -r requirements.in
ptyprocess==0.6.0
# via pexpect
Expand Down Expand Up @@ -401,7 +403,6 @@ python-dateutil==2.8.2
# celery-redbeat
# google-cloud-bigquery
# posthoganalytics
# temporalio
python-dotenv==0.21.0
# via webdriver-manager
python-statsd==2.1.0
Expand Down Expand Up @@ -452,8 +453,6 @@ rsa==4.9
# via google-auth
ruamel-yaml==0.17.21
# via prance
ruamel-yaml-clib==0.2.7
# via ruamel-yaml
s3transfer==0.6.0
# via boto3
selenium==4.1.5
Expand Down Expand Up @@ -563,9 +562,12 @@ wsproto==1.1.0
# via trio-websocket
xmlsec==1.3.13
# via python3-saml
yarl==1.7.2
yarl==1.9.2
# via aiohttp
zipp==3.17.0
# via
# -r requirements.in
# aiohttp
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
Expand Down
Loading