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: Python 3.10 #14360

Merged
merged 5 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
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.9.16
python-version: 3.10.7
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

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

- uses: syphar/restore-virtualenv@v1
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.16
python-version: 3.10.7
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9.16']
python-version: ['3.10.7']
clickhouse-server-image: ['clickhouse/clickhouse-server:22.8']
segment: ['FOSS', 'EE']
person-on-events: [false, true]
Expand Down Expand Up @@ -329,7 +329,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.16
python-version: 3.10.7
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
Expand Down Expand Up @@ -419,7 +419,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.16
python-version: 3.10.7
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- name: Install SAML (python3-saml) dependencies
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci-plugin-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.16
python-version: 3.10.7
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.16
python-version: 3.10.7
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}

- uses: syphar/restore-virtualenv@v1
Expand All @@ -197,6 +197,12 @@ jobs:
- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-backend-tests.outputs.cache-hit != 'true'

- name: Install SAML (python3-saml) dependencies
run: |
sudo apt-get update
sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl
if: steps.cache-backend-tests.outputs.cache-hit != 'true'

- name: Install python dependencies
if: steps.cache-backend-tests.outputs.cache-hit != 'true'
run: |
Expand Down
3 changes: 1 addition & 2 deletions posthog/tasks/exports/csv_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ def add_query_params(url: str, params: Dict[str, str]) -> str:
for key, value in params.items():
update_params.append((key, value))

# mypy bug ? https://github.com/python/typeshed/issues/4234
encodedQueryParams = urlencode(update_params, quote_via=quote) # type: ignore
encodedQueryParams = urlencode(update_params, quote_via=quote)
parsed = parsed._replace(query=encodedQueryParams)
return urlunparse(parsed)

Expand Down
5 changes: 3 additions & 2 deletions production.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ RUN corepack enable && \
#
# ---------------------------------------------------------
#
FROM python:3.9.16-slim-bullseye AS posthog-build
FROM python:3.10.7-slim-bullseye AS posthog-build
WORKDIR /code
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand All @@ -90,6 +90,7 @@ RUN apt-get update && \
"libpq-dev" \
"libxmlsec1" \
"libxmlsec1-dev" \
"libffi-dev" \
"pkg-config" \
&& \
rm -rf /var/lib/apt/lists/* && \
Expand Down Expand Up @@ -129,7 +130,7 @@ RUN apt-get update && \
#
# ---------------------------------------------------------
#
FROM python:3.9.16-slim-bullseye
FROM python:3.10.7-slim-bullseye
WORKDIR /code
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV PYTHONUNBUFFERED 1
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ flake8-import-order==0.18.1
flake8-logging-format==0.7.5
flake8-print==5.0.0
pip-tools==6.6.2
mypy==0.931
mypy==0.981
mypy-extensions==0.4.3
datamodel-code-generator==0.16.1
djangorestframework-stubs==1.4.0
Expand Down
13 changes: 3 additions & 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.9
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile requirements-dev.in
Expand Down Expand Up @@ -123,9 +123,7 @@ idna==2.8
# requests
# urllib3
importlib-resources==5.10.2
# via
# -c requirements.txt
# openapi-spec-validator
# via openapi-spec-validator
inflect==5.6.2
# via datamodel-code-generator
iniconfig==1.1.1
Expand Down Expand Up @@ -154,7 +152,7 @@ markupsafe==1.1.1
# via jinja2
mccabe==0.7.0
# via flake8
mypy==0.931
mypy==0.981
# via
# -r requirements-dev.in
# django-stubs
Expand Down Expand Up @@ -327,7 +325,6 @@ types-requests==2.26.1
typing-extensions==4.4.0
# via
# -c requirements.txt
# black
# django-stubs
# djangorestframework-stubs
# jsonschema-spec
Expand All @@ -353,10 +350,6 @@ wrapt==1.14.1
# via
# -c requirements.txt
# deprecated
zipp==3.1.0
# via
# -c requirements.txt
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.9.16
python-3.10.7
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why we are not on the latest 3.10 patch? 3.10.10 was released on Feb 8th.

Copy link
Contributor

Choose a reason for hiding this comment

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

Miscellaneous bugfixes in the changelog from 3.10.7 to 3.10.10 as far as I can tell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, no reason, just Google lied to me when I searched latest python version 😔