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

update python #411

Merged
merged 3 commits into from
Dec 11, 2024
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Python 3.12 Setup
- name: Python 3.13 Setup
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: 3.13
- name: Install dependencies
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ You'll need to replace `police-data-trust-api-1` with the name of the container
docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c0cf******** police-data-trust-api "/bin/sh -c '/wait &…" About a minute ago Up About a minute 0.0.0.0:5001->5001/tcp police-data-trust-api-1
5e6f******** postgres:16 "docker-entrypoint.s…" 3 days ago Up About a minute 0.0.0.0:5432->5432/tcp police-data-trust-db-1
5e6f******** postgres:17 "docker-entrypoint.s…" 3 days ago Up About a minute 0.0.0.0:5432->5432/tcp police-data-trust-db-1
dacd******** police-data-trust-web "docker-entrypoint.s…" 3 days ago Up About a minute 0.0.0.0:3000->3000/tcp police-data-trust-web-1
```

Expand Down
4 changes: 2 additions & 2 deletions backend/scraper/notebooks/cpdp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"import numpy as np\n",
"import pandas as pd\n",
"import sqlalchemy\n",
"import psycopg2\n",
"import psycopg\n",
"from IPython.display import display, HTML\n",
"from collections import namedtuple\n",
"from backend.database import db, Incident, Officer, Accusation, Victim\n",
Expand Down Expand Up @@ -350,7 +350,7 @@
" try:\n",
" insert_bulk(dicts, OrmClass)\n",
" except sqlalchemy.exc.IntegrityError as e:\n",
" if isinstance(e.orig, psycopg2.errors.UniqueViolation):\n",
" if isinstance(e.orig, psycopg.errors.UniqueViolation):\n",
" print(f\"Already created {OrmClass.__name__} records\")\n",
" else:\n",
" raise e\n",
Expand Down
1 change: 0 additions & 1 deletion backend/scraper/notebooks/mpv.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"import numpy as np\n",
"import pandas as pd\n",
"from flask_sqlalchemy import SQLAlchemy\n",
"import psycopg2\n",
"from itertools import zip_longest\n",
"from typing import List\n",
"import requests\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Install all of the following programs onto your computer:

**Required:**

- [Python 3.12](https://www.python.org/downloads/)
- [Python 3.13](https://www.python.org/downloads/)
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) (first time setup guide [here](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup))
- [Postgres](https://www.postgresql.org/) _(see installation instructions below)_
- _(OSX only)_ [Homebrew](https://brew.sh/)
Expand Down
6 changes: 3 additions & 3 deletions requirements/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# psycopg2 requires postgres development files in order to compile the
# psycopg requires postgres development files in order to compile the
# requirements, so this image starts with the same image as the database
# containers and installs the same version of python as the api containers

FROM postgres:16 as base
FROM postgres:17 as base

RUN apt-get update && apt-get install -y \
make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
Expand All @@ -15,7 +15,7 @@ SHELL ["bash", "-lc"]
RUN curl https://pyenv.run | bash && \
echo 'export PATH="$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc

ENV PYTHON_VERSION=3.12.5
ENV PYTHON_VERSION=3.13.0
RUN pyenv install ${PYTHON_VERSION} && pyenv global ${PYTHON_VERSION}
RUN pip install -U pip-tools

Expand Down
2 changes: 1 addition & 1 deletion requirements/_core.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bcrypt==3.2.2
bcrypt
black
boto3
celery
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev_unix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ babel==2.14.0
# via
# flask-babelex
# jupyterlab-server
bcrypt==3.2.2
bcrypt==4.2.0
# via -r requirements/_core.in
beautifulsoup4==4.12.3
# via nbconvert
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev_windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ babel==2.14.0
# via
# flask-babelex
# jupyterlab-server
bcrypt==3.2.2
bcrypt==4.2.0
# via -r requirements/_core.in
beautifulsoup4==4.12.3
# via nbconvert
Expand Down
2 changes: 1 addition & 1 deletion requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ babel==2.14.0
# via
# flask-babelex
# jupyterlab-server
bcrypt==3.2.2
bcrypt==4.2.0
# via -r requirements/_core.in
beautifulsoup4==4.12.3
# via nbconvert
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.12.5
python-3.13.0
Loading