Skip to content

Commit 7bcb8c5

Browse files
authored
Merge pull request #63 from AitoDotAI/feature/update-python-version-support
Update Python version support to 3.9+
2 parents 1a664ea + 2e33c00 commit 7bcb8c5

10 files changed

Lines changed: 232 additions & 109 deletions

File tree

.circleci/config.yml

Lines changed: 17 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,16 @@ workflows:
88
commit:
99
jobs:
1010
- run_dependencies_security_check
11-
- run_sdk_and_cli_tests_linux_py_36
12-
- run_sdk_and_cli_tests_linux_py_37:
13-
requires:
14-
- run_sdk_and_cli_tests_linux_py_36
15-
- run_sdk_and_cli_tests_linux_py_38:
16-
requires:
17-
- run_sdk_and_cli_tests_linux_py_36
18-
- run_postgres_tests_linux_py_36
19-
- run_postgres_tests_linux_py_37:
20-
requires:
21-
- run_postgres_tests_linux_py_36
22-
- run_postgres_tests_linux_py_38:
23-
requires:
24-
- run_postgres_tests_linux_py_36
25-
- run_sdk_and_cli_tests_win_py_36
26-
- run_sdk_and_cli_tests_win_py_37:
27-
requires:
28-
- run_sdk_and_cli_tests_win_py_36
29-
- run_sdk_and_cli_tests_win_py_38:
30-
requires:
31-
- run_sdk_and_cli_tests_win_py_36
11+
- run_sdk_and_cli_tests_linux
12+
- run_postgres_tests_linux
13+
- run_sdk_and_cli_tests_win
3214
- run_sdk_and_cli_tests_built_package
3315
- run_postgres_tests_built_package
3416
- run_alter_instance_db_tests:
3517
requires:
36-
- run_sdk_and_cli_tests_linux_py_37
37-
- run_sdk_and_cli_tests_linux_py_38
38-
- run_postgres_tests_linux_py_37
39-
- run_postgres_tests_linux_py_38
40-
- run_sdk_and_cli_tests_win_py_37
41-
- run_sdk_and_cli_tests_win_py_38
18+
- run_sdk_and_cli_tests_linux
19+
- run_postgres_tests_linux
20+
- run_sdk_and_cli_tests_win
4221
- run_sdk_and_cli_tests_built_package
4322
- run_postgres_tests_built_package
4423
- build_docs
@@ -53,12 +32,12 @@ workflows:
5332
commonYAMLStructure:
5433
- &restore_venv_cache_build_and_test
5534
restore_cache:
56-
key: v2-dependencies-{{ checksum "requirements/build.txt" }}-{{ checksum "requirements/test.txt" }}-{{ .Environment.CIRCLE_JOB }}
35+
key: v3-dependencies-{{ checksum "requirements/build.txt" }}-{{ checksum "requirements/test.txt" }}-{{ .Environment.CIRCLE_JOB }}
5736
- &save_venv_cache_build_and_test
5837
save_cache:
5938
paths:
6039
- ./venv
61-
key: v2-dependencies-{{ checksum "requirements/build.txt" }}-{{ checksum "requirements/test.txt" }}-{{ .Environment.CIRCLE_JOB }}
40+
key: v3-dependencies-{{ checksum "requirements/build.txt" }}-{{ checksum "requirements/test.txt" }}-{{ .Environment.CIRCLE_JOB }}
6241
- &create_venv_and_install_build_and_test_dependencies_linux
6342
run:
6443
name: create virtualenv and install dependencies
@@ -70,12 +49,12 @@ commonYAMLStructure:
7049
pip install -r requirements/test.txt
7150
- &restore_venv_cache_deploy_and_test
7251
restore_cache:
73-
key: v2-dependencies-{{ checksum "requirements/deploy.txt" }}-{{ checksum "requirements/test.txt" }}
52+
key: v3-dependencies-{{ checksum "requirements/deploy.txt" }}-{{ checksum "requirements/test.txt" }}
7453
- &save_venv_cache_deploy_and_test
7554
save_cache:
7655
paths:
7756
- ./venv
78-
key: v2-dependencies-{{ checksum "requirements/deploy.txt" }}-{{ checksum "requirements/test.txt" }}
57+
key: v3-dependencies-{{ checksum "requirements/deploy.txt" }}-{{ checksum "requirements/test.txt" }}
7958
- &create_venv_and_install_deploy_and_test_dependencies
8059
run:
8160
name: create virtualenv and install dependencies
@@ -87,12 +66,12 @@ commonYAMLStructure:
8766
pip install -r requirements/test.txt
8867
- &restore_build_doc_venv_cache
8968
restore_cache:
90-
key: v2-dependencies-{{ checksum "requirements/build.txt" }}-{{ checksum "requirements/test.txt" }}-{{ checksum "requirements/docs.txt" }}
69+
key: v3-dependencies-{{ checksum "requirements/build.txt" }}-{{ checksum "requirements/test.txt" }}-{{ checksum "requirements/docs.txt" }}
9170
- &save_build_doc_venv_cache
9271
save_cache:
9372
paths:
9473
- ./venv
95-
key: v2-dependencies-{{ checksum "requirements/build.txt" }}-{{ checksum "requirements/test.txt" }}-{{ checksum "requirements/docs.txt" }}
74+
key: v3-dependencies-{{ checksum "requirements/build.txt" }}-{{ checksum "requirements/test.txt" }}-{{ checksum "requirements/docs.txt" }}
9675
- &create_build_doc_venv
9776
run:
9877
name: create doc virtualenv and install dependencies
@@ -235,7 +214,7 @@ jobs:
235214
- *save_venv_cache_build_and_test
236215
- *install_and_run_safety_check
237216

238-
run_sdk_and_cli_tests_linux_py_36: &run_sdk_and_cli_tests_linux_template
217+
run_sdk_and_cli_tests_linux:
239218
docker:
240219
- image: cimg/python:3.11
241220
working_directory: ~/repo
@@ -247,20 +226,10 @@ jobs:
247226
- *run_sdk_and_cli_tests
248227
- *store_log_files
249228

250-
run_sdk_and_cli_tests_linux_py_37:
251-
<<: *run_sdk_and_cli_tests_linux_template
252-
docker:
253-
- image: circleci/python:3.7
254-
255-
run_sdk_and_cli_tests_linux_py_38:
256-
<<: *run_sdk_and_cli_tests_linux_template
257-
docker:
258-
- image: circleci/python:3.8
259-
260-
run_postgres_tests_linux_py_36: &run_postgres_tests_linux_template
229+
run_postgres_tests_linux:
261230
docker:
262231
- image: cimg/python:3.11
263-
- image: circleci/postgres:9.6
232+
- image: cimg/postgres:13.20
264233
environment:
265234
POSTGRES_DB: circleci_test
266235
POSTGRES_USER: test
@@ -288,31 +257,11 @@ jobs:
288257
- *run_postgres_cli_test
289258
- *store_log_files
290259

291-
run_postgres_tests_linux_py_37:
292-
<<: *run_postgres_tests_linux_template
293-
docker:
294-
- image: circleci/python:3.7
295-
- image: circleci/postgres:9.6
296-
environment:
297-
POSTGRES_DB: circleci_test
298-
POSTGRES_USER: test
299-
POSTGRES_PASSWORD: test_pw
300-
301-
run_postgres_tests_linux_py_38:
302-
<<: *run_postgres_tests_linux_template
303-
docker:
304-
- image: circleci/python:3.8
305-
- image: circleci/postgres:9.6
306-
environment:
307-
POSTGRES_DB: circleci_test
308-
POSTGRES_USER: test
309-
POSTGRES_PASSWORD: test_pw
310-
311-
run_sdk_and_cli_tests_win_py_36: &run_sdk_and_cli_tests_win_template
260+
run_sdk_and_cli_tests_win:
312261
executor:
313262
name: win/default
314263
environment:
315-
PYTHON_VERSION: 3.6.9
264+
PYTHON_VERSION: 3.11.0
316265
working_directory: ~/repo
317266
steps:
318267
- run:
@@ -323,16 +272,6 @@ jobs:
323272
- *run_sdk_and_cli_tests_windows
324273
- *store_log_files
325274

326-
run_sdk_and_cli_tests_win_py_37:
327-
<<: *run_sdk_and_cli_tests_win_template
328-
environment:
329-
PYTHON_VERSION: 3.7.5
330-
331-
run_sdk_and_cli_tests_win_py_38:
332-
<<: *run_sdk_and_cli_tests_win_template
333-
environment:
334-
PYTHON_VERSION: 3.8.0
335-
336275
run_sdk_and_cli_tests_built_package:
337276
docker:
338277
- image: cimg/python:3.11

.github/workflows/docs.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'docs/**'
8+
- 'aito/**'
9+
- 'requirements/docs.txt'
10+
- '.github/workflows/docs.yml'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.11'
31+
32+
- name: Install dependencies
33+
run: |
34+
pip install --upgrade pip
35+
pip install -r requirements/build.txt
36+
pip install -r requirements/docs.txt
37+
38+
- name: Build Sphinx documentation
39+
run: |
40+
cd docs
41+
make html SPHINXOPTS="-W"
42+
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: docs/build/html
47+
48+
deploy:
49+
needs: build
50+
runs-on: ubuntu-latest
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
steps:
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

.readthedocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
version: 2
22

3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.11"
7+
38
python:
4-
version: 3.8
59
install:
610
- requirements: requirements/docs.txt
711

aito/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.5.2"
1+
__version__ = "0.5.3"

do

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,66 @@ case "$COMMAND" in
2020
bash
2121
;;
2222

23+
deploy-docs)
24+
echo "Building and deploying documentation to GitHub Pages..."
25+
set -e
26+
27+
# Check we're at project root
28+
if [[ ! -f aito/__init__.py ]]; then
29+
echo "Error: must be run from project root directory"
30+
exit 1
31+
fi
32+
33+
# Activate virtualenv if present
34+
if [[ -f venv/bin/activate ]]; then
35+
echo "Activating virtual environment..."
36+
source venv/bin/activate
37+
fi
38+
39+
# Check sphinx-build is available
40+
if ! command -v sphinx-build &> /dev/null; then
41+
echo "Error: sphinx-build not found. Install with: pip install -r requirements/docs.txt"
42+
exit 1
43+
fi
44+
45+
# Build docs
46+
echo "Building Sphinx documentation..."
47+
cd docs
48+
make clean html SPHINXOPTS="-W"
49+
cd ..
50+
51+
# Get current branch and commit info
52+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
53+
CURRENT_COMMIT=$(git rev-parse --short HEAD)
54+
VERSION=$(python -c "import aito; print(aito.__version__)")
55+
56+
# Clone gh-pages branch to temp directory
57+
TEMP_DIR=$(mktemp -d)
58+
echo "Cloning gh-pages branch to $TEMP_DIR..."
59+
git clone --branch gh-pages --single-branch --depth 1 "$(git remote get-url origin)" "$TEMP_DIR"
60+
61+
# Clear old content (except .git) and copy new
62+
echo "Updating documentation..."
63+
find "$TEMP_DIR" -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
64+
cp -r docs/build/html/* "$TEMP_DIR/"
65+
touch "$TEMP_DIR/.nojekyll"
66+
67+
# Commit and push
68+
cd "$TEMP_DIR"
69+
git add -A
70+
git commit -m "Deploy docs from $CURRENT_BRANCH ($CURRENT_COMMIT) - v$VERSION" || echo "No changes to commit"
71+
git push origin gh-pages
72+
73+
# Cleanup
74+
cd -
75+
rm -rf "$TEMP_DIR"
76+
77+
echo "Documentation deployed successfully!"
78+
echo "View at: https://aitodotai.github.io/aito-python-tools/"
79+
;;
80+
2381
*)
24-
echo "Usage: $0 {build-dev-docker|run-dev-docker}"
82+
echo "Usage: $0 {build-dev-docker|run-dev-docker|deploy-docs}"
2583
exit 1
2684
;;
2785
esac

docs/source/_static/aito.svg

Lines changed: 63 additions & 19 deletions
Loading

0 commit comments

Comments
 (0)