Skip to content

Python 3.9 to 3.12 #1231

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

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
90bbe62
python version updated from 3.9 into 3.12
jaseemjaskp Apr 4, 2025
e427427
x2text-service updated with uv and python version 3.12
jaseemjaskp Apr 7, 2025
5055a8b
x2text-service docker file updated
jaseemjaskp Apr 7, 2025
2df712d
Unstract packages updated with uv
jaseemjaskp Apr 7, 2025
da851eb
Runner updated with uv
jaseemjaskp Apr 8, 2025
d5714aa
Promptservice updated with uv
jaseemjaskp Apr 8, 2025
90f91d4
Platform service updated with uv
jaseemjaskp Apr 8, 2025
fb2fc04
backend service updated with uv
jaseemjaskp Apr 8, 2025
57d7cc1
root pyproject.toml file updated
jaseemjaskp Apr 8, 2025
bdbe612
sdk version updated in services
jaseemjaskp Apr 9, 2025
96fc927
unstract package modules updated based on sdk version:
jaseemjaskp Apr 9, 2025
d3f5fd9
docker file update
jaseemjaskp Apr 9, 2025
e980495
pdm lock workflow modified to support uv
jaseemjaskp Apr 9, 2025
8744c50
Docs updated based on uv support
jaseemjaskp Apr 9, 2025
79e8a63
merge conflicts resoved
jaseemjaskp Apr 10, 2025
6bf3701
lock automation updated
jaseemjaskp Apr 10, 2025
7e8da08
snowflake module version updated into 3.14.0
jaseemjaskp Apr 10, 2025
84caaf3
tox updated to support UV
jaseemjaskp Apr 10, 2025
12b36f9
tox updated to support UV
jaseemjaskp Apr 10, 2025
7d2619e
tox updated with pytest
jaseemjaskp Apr 10, 2025
21b1ead
tox updated with pytest-md-report
jaseemjaskp Apr 10, 2025
97c6921
tox updated with module requirements
jaseemjaskp Apr 10, 2025
7e599ce
python migration from 3.9 to 3.12
jaseemjaskp Apr 10, 2025
0afbe6e
tox updated with module requirements
jaseemjaskp Apr 10, 2025
04955bb
runner updated
jaseemjaskp Apr 10, 2025
bf8f589
Commit uv.lock changes
jaseemjaskp Apr 10, 2025
0a16efa
runner updated
jaseemjaskp Apr 10, 2025
27d35ca
Merge branch 'python-3.9-to-3.12' of github.com:Zipstack/unstract int…
jaseemjaskp Apr 10, 2025
b3203f7
Commit uv.lock changes
jaseemjaskp Apr 10, 2025
373cb1a
pytest.ini added
jaseemjaskp Apr 10, 2025
2393821
Merge branch 'python-3.9-to-3.12' of github.com:Zipstack/unstract int…
jaseemjaskp Apr 10, 2025
5953687
x2text-service docker file updated
jaseemjaskp Apr 10, 2025
13a5bf6
pytest.ini removed
jaseemjaskp Apr 10, 2025
794d491
environment updated to test
jaseemjaskp Apr 10, 2025
d6a013d
docformatter commented on pre-commit
jaseemjaskp Apr 10, 2025
d18b3b9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 10, 2025
572a1cc
some pre-commit issues ignored
jaseemjaskp Apr 10, 2025
29b0928
Merge branch 'python-3.9-to-3.12' of github.com:Zipstack/unstract int…
jaseemjaskp Apr 10, 2025
886df16
some pre-commit issues ignored
jaseemjaskp Apr 10, 2025
8109203
some pre-commit issues ignored
jaseemjaskp Apr 10, 2025
1329cff
some pre-commit issues ignored
jaseemjaskp Apr 10, 2025
a2a7795
some pre-commit issues ignored
jaseemjaskp Apr 10, 2025
dcec514
pre-commit updates
jaseemjaskp Apr 10, 2025
eb818dc
un used import removed from platfrom service controller
jaseemjaskp Apr 10, 2025
d31a596
tox issue fixed
jaseemjaskp Apr 10, 2025
2d14dd9
tox issue fixed
jaseemjaskp Apr 10, 2025
ab0a991
docker files updated
jaseemjaskp Apr 10, 2025
ed51709
backend dockerfile updated
jaseemjaskp Apr 10, 2025
e1f1548
open installation issue fixed
jaseemjaskp Apr 10, 2025
4f901e0
Merge branch 'main' into python-3.9-to-3.12
jaseemjaskp Apr 10, 2025
94e13dc
Tools docker file updated with base python version 3.12
jaseemjaskp Apr 10, 2025
8f43782
python version updated into min 3.12 in pyproject.toml
jaseemjaskp Apr 10, 2025
826277f
linting issue fixed
jaseemjaskp Apr 10, 2025
bf9b19d
uv version upgraded into 0.6.14
jaseemjaskp Apr 10, 2025
2966039
Merge branch 'main' into python-3.9-to-3.12
chandrasekharan-zipstack Apr 11, 2025
a007363
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 11, 2025
24258d9
migrations excluded from ruff
jaseemjaskp Apr 11, 2025
9ce2ebe
added PoethePoet task runner
jaseemjaskp Apr 11, 2025
5248d19
Merge branch 'main' into python-3.9-to-3.12
chandrasekharan-zipstack Apr 12, 2025
f6ea3a5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 12, 2025
949bb70
feat: Added poe tasks for services (#1248)
chandrasekharan-zipstack Apr 12, 2025
0000161
updated tool-sidecar to uv and python to 3.12.9
muhammad-ali-e Apr 12, 2025
6b878b7
minor updates in pyproject descreption
muhammad-ali-e Apr 12, 2025
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
82 changes: 41 additions & 41 deletions .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,44 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Cache tox environments
uses: actions/cache@v4
with:
path: .tox/
key: ${{ runner.os }}-tox-${{ hashFiles('**/pyproject.toml', '**/tox.ini') }}
restore-keys: |
${{ runner.os }}-tox-

- name: Install tox
run: pip install tox

- name: Run tox
id: tox
run: |
tox

- name: Render the report to the PR
uses: marocchino/sticky-pull-request-comment@v2
with:
header: runner-test-report
recreate: true
path: runner-report.md

- name: Output reports to the job summary when tests fail
shell: bash
run: |
if [ -f "runner-report.md" ]; then
echo "<details><summary>Runner Test Report</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "runner-report.md" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
fi
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Cache tox environments
uses: actions/cache@v4
with:
path: .tox/
key: ${{ runner.os }}-tox-${{ hashFiles('**/pyproject.toml', '**/tox.ini') }}
restore-keys: |
${{ runner.os }}-tox-

- name: Install tox
run: pip install tox

- name: Run tox
id: tox
run: |
tox

- name: Render the report to the PR
uses: marocchino/sticky-pull-request-comment@v2
with:
header: runner-test-report
recreate: true
path: runner-report.md

- name: Output reports to the job summary when tests fail
shell: bash
run: |
if [ -f "runner-report.md" ]; then
echo "<details><summary>Runner Test Report</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "runner-report.md" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
fi
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Automate pdm.lock
name: Automate uv.lock

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, review_requested]
branches: [main]
paths:
- '**/pyproject.toml'
- "**/pyproject.toml"
workflow_dispatch:
inputs:
directories:
description: 'Comma-separated list of directories to update'
description: "Comma-separated list of directories to update"
required: false
default: '' # Run for all dirs specified in docker/scripts/pdm-lock-gen/pdm-lock.sh
default: "" # Run for all dirs specified in docker/scripts/uv-lock-gen/uv-lock.sh

jobs:
update_pdm_lock:
name: Update PDM lock in all directories
update_uv_lock:
name: Update UV lock in all directories
runs-on: ubuntu-latest

permissions:
Expand All @@ -29,29 +29,31 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: Set up Python
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: "3.12.9"

- name: Install PDM
run: python -m pip install pdm==2.16.1
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
# Install a specific version of uv.
version: "0.6.11"

- name: Generate PDM lockfiles
- name: Generate UV lockfiles
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
chmod +x ./docker/scripts/pdm-lock-gen/pdm-lock.sh
chmod +x ./docker/scripts/uv-lock-gen/uv-lock.sh

# Get the input from the workflow or use the default value
dirs="${{ github.event.inputs.directories }}"

# Check if directories input is empty
if [[ -z "$dirs" ]]; then
# No directories input given, run the script without arguments (process all directories)
echo "No directories specified, running on all dirs listed in docker/scripts/pdm-lock-gen/pdm-lock.sh"
echo "No directories specified, running on all dirs listed in docker/scripts/uv-lock-gen/uv-lock.sh"

./docker/scripts/pdm-lock-gen/pdm-lock.sh
./docker/scripts/uv-lock-gen/uv-lock.sh
else
# Convert comma-separated list into an array of directories
IFS=',' read -r -a dir_array <<< "$dirs"
Expand All @@ -60,13 +62,13 @@ jobs:
echo "Processing specified directories: ${dir_array[*]}"

# Pass directories as command-line arguments to the script
./docker/scripts/pdm-lock-gen/pdm-lock.sh "${dir_array[@]}"
./docker/scripts/uv-lock-gen/uv-lock.sh "${dir_array[@]}"
fi
shell: bash

- name: Commit pdm.lock changes
- name: Commit uv.lock changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Commit pdm.lock changes
commit_user_name: pdm-lock-automation[bot]
commit_user_email: pdm[email protected]
commit_message: Commit uv.lock changes
commit_user_name: uv-lock-automation[bot]
commit_user_email: uv[email protected]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ backend/pluggable_apps/*

# FE Plugins
frontend/src/plugins/*
frontend/public/llm-whisperer/

# Tool registry
unstract/tool-registry/tool_registry_config/*.json
Expand Down
152 changes: 49 additions & 103 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

default_language_version:
python: python3.9
python: python3.12
default_stages:
- pre-commit

ci:
skip:
- hadolint-docker # Fails in pre-commit CI

- hadolint-docker # Fails in pre-commit CI
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand Down Expand Up @@ -39,70 +34,67 @@ repos:
- id: forbid-new-submodules
- id: mixed-line-ending
- id: no-commit-to-branch
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: ["-d", "relaxed"]
# language: system
# - repo: https://github.com/rhysd/actionlint
# rev: v1.6.27
# hooks:
# - id: actionlint-docker
# args: [-ignore, 'label ".+" is unknown']
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
args: [--config=pyproject.toml, -l 88]
# language: system
exclude: |
(?x)^(
unstract/flags/src/unstract/flags/evaluation_.*\.py|
)$
- repo: https://github.com/pycqa/flake8
rev: 7.1.0
hooks:
- id: flake8
args: [--max-line-length=88]
exclude: |
(?x)^(
.*migrations/.*\.py|
core/tests/.*|
unstract/flags/src/unstract/flags/evaluation_.*\.py|
)$
- repo: https://github.com/pycqa/isort
rev: 5.13.2

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: isort
files: "\\.(py)$"
args:
[
"--profile",
"black",
"--filter-files",
--settings-path=pyproject.toml,
]
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/hadialqattan/pycln
rev: v2.5.0
rev: v2.4.0
hooks:
- id: pycln
entry: uv run pycln
args: [--config=pyproject.toml]
# - repo: https://github.com/pycqa/docformatter
# rev: v1.7.5
# hooks:
# - id: docformatter

- repo: https://github.com/pycqa/docformatter
rev: v1.7.5
hooks:
- id: docformatter
language: python

- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.17.0
hooks:
- id: pyupgrade
entry: pyupgrade --py39-plus --keep-runtime-typing
types:
- python

# - repo: https://github.com/astral-sh/uv-pre-commit
# rev: 0.6.11
# hooks:
# - id: uv-lock

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
language: system
entry: uv run mypy .
pass_filenames: false
additional_dependencies: []

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.42.0
hooks:
- id: markdownlint
args: [--disable, MD013]
- id: markdownlint-fix
args: [--disable, MD013]

- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.4
rev: v8.18.2
hooks:
- id: gitleaks

- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: htmlhint

- repo: https://github.com/hadolint/hadolint
rev: v2.12.1-beta
hooks:
Expand All @@ -114,49 +106,3 @@ repos:
- --ignore=DL3018
- --ignore=SC1091
files: Dockerfile$
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
# - repo: https://github.com/pre-commit/mirrors-eslint
# rev: "v9.0.0-beta.2" # Use the sha / tag you want to point at
# hooks:
# - id: eslint
# args: [--config=frontend/.eslintrc.json]
# files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
# types: [file]
# additional_dependencies:
# - [email protected]
# - [email protected]
# - [email protected]
# - [email protected]
# - [email protected]
# - [email protected]
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: htmlhint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
- id: markdownlint
args: [--disable, MD013]
- id: markdownlint-fix
args: [--disable, MD013]
- repo: https://github.com/pdm-project/pdm
rev: 2.16.1
hooks:
- id: pdm-lock-check
# - repo: local
# hooks:
# - id: run-mypy
# name: Run mypy
# entry: sh -c 'pdm run mypy .'
# language: system
# pass_filenames: false
# - id: check-django-migrations
# name: Check django migrations
# entry: sh -c 'pdm run docker/scripts/check_django_migrations.sh'
# language: system
# types: [python] # hook only runs if a python file is staged
# pass_filenames: false
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.6
3.12.9
Loading