Skip to content

Commit 0d9661b

Browse files
committed
Refactor test files to remove unnecessary whitespace and improve readability
- Cleaned up whitespace in test_gremlin.py, test_importer.py, test_server.py, and test_server_patterns.py. - Ensured consistent formatting across test files for better maintainability. - No functional changes were made; only formatting adjustments to enhance code clarity.
1 parent 273dbfe commit 0d9661b

52 files changed

Lines changed: 1214 additions & 1214 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-python-docs.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
release:
55
types: [published] # Trigger when GitHub Release is published
66
# Release tag should contain 'python' (case-insensitive, e.g., v25.9.1-python, v1.0.0-Python)
7-
7+
88
# Allow manual trigger for testing
99
workflow_dispatch:
1010
inputs:
@@ -34,15 +34,15 @@ jobs:
3434
environment:
3535
name: github-pages
3636
url: https://humemai.github.io/arcadedb/
37-
37+
3838
steps:
3939
- name: Check if this is a Python release
4040
if: github.event_name == 'release'
4141
id: check-python-release
4242
run: |
4343
TAG_NAME="${{ github.event.release.tag_name }}"
4444
TAG_LOWER=$(echo "$TAG_NAME" | tr '[:upper:]' '[:lower:]')
45-
45+
4646
if [[ "$TAG_LOWER" == *"python"* ]]; then
4747
echo "✅ This is a Python release: $TAG_NAME"
4848
echo "is-python-release=true" >> $GITHUB_OUTPUT
@@ -51,40 +51,40 @@ jobs:
5151
echo "is-python-release=false" >> $GITHUB_OUTPUT
5252
exit 0
5353
fi
54-
54+
5555
- name: Skip workflow for non-Python releases
5656
if: github.event_name == 'release' && steps.check-python-release.outputs.is-python-release != 'true'
5757
run: |
5858
echo "This is not a Python release, exiting gracefully"
5959
exit 0
60-
60+
6161
- name: Checkout repository
6262
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
6363
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6464
with:
6565
fetch-depth: 0 # Full history for mike versioning
6666
token: ${{ secrets.GITHUB_TOKEN }}
67-
67+
6868
- name: Set up Python
6969
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
7070
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
7171
with:
7272
python-version: '3.11'
7373
cache: 'pip'
74-
74+
7575
- name: Install dependencies
7676
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
7777
working-directory: bindings/python
7878
run: |
7979
pip install --upgrade pip
8080
pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mike
81-
81+
8282
- name: Configure Git
8383
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
8484
run: |
8585
git config user.name "github-actions[bot]"
8686
git config user.email "github-actions[bot]@users.noreply.github.com"
87-
87+
8888
- name: Extract version from release tag or input
8989
if: github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true'
9090
id: version
@@ -96,13 +96,13 @@ jobs:
9696
# Extract version from release tag (v25.9.1-python -> 25.9.1 or v25.9.1.1-python -> 25.9.1.1)
9797
TAG_NAME="${{ github.event.release.tag_name }}"
9898
TAG_LOWER=$(echo "$TAG_NAME" | tr '[:upper:]' '[:lower:]')
99-
99+
100100
# Verify tag contains 'python' (case-insensitive)
101101
if [[ ! "$TAG_LOWER" == *"python"* ]]; then
102102
echo "❌ Release tag should contain 'python' (case-insensitive), got: $TAG_NAME"
103103
exit 1
104104
fi
105-
105+
106106
# Strip 'v' prefix and remove everything after and including '-python' or '-Python', etc.
107107
VERSION="${TAG_NAME#v}" # Remove 'v' prefix
108108
VERSION="${VERSION%%-[Pp][Yy][Tt][Hh][Oo][Nn]*}" # Remove '-python' suffix (case-insensitive)
@@ -111,7 +111,7 @@ jobs:
111111
echo "version=$VERSION" >> $GITHUB_OUTPUT
112112
echo "set_latest=$SET_LATEST" >> $GITHUB_OUTPUT
113113
echo "📦 Deploying documentation version: $VERSION"
114-
114+
115115
- name: Deploy with mike (set as latest)
116116
if: (github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true') && steps.version.outputs.set_latest == 'true'
117117
working-directory: bindings/python
@@ -120,7 +120,7 @@ jobs:
120120
${{ steps.version.outputs.version }} latest \
121121
--title "${{ steps.version.outputs.version }} (latest)"
122122
mike set-default --push latest
123-
123+
124124
- name: Deploy with mike (not latest)
125125
if: (github.event_name != 'release' || steps.check-python-release.outputs.is-python-release == 'true') && steps.version.outputs.set_latest != 'true'
126126
working-directory: bindings/python

.github/workflows/release-python-packages.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ jobs:
1818
run: |
1919
TAG_NAME="${{ github.event.release.tag_name }}"
2020
TAG_LOWER=$(echo "$TAG_NAME" | tr '[:upper:]' '[:lower:]')
21-
21+
2222
if [[ "$TAG_LOWER" == *"python"* ]]; then
2323
echo "✅ This is a Python release: $TAG_NAME"
2424
echo "is-python-release=true" >> $GITHUB_OUTPUT
2525
else
2626
echo "⏭️ Not a Python release (tag: $TAG_NAME), skipping workflow"
2727
echo "is-python-release=false" >> $GITHUB_OUTPUT
2828
fi
29-
29+
3030
# Run tests first to ensure quality
3131
test:
3232
name: Run Tests Before Release
3333
needs: check-release
3434
if: needs.check-release.outputs.is-python-release == 'true'
3535
uses: ./.github/workflows/test-python-bindings.yml
3636
secrets: inherit
37-
37+
3838
build:
3939
needs: test # Wait for tests to pass
4040
name: Build Python Distribution (${{ matrix.distribution }})
@@ -49,19 +49,19 @@ jobs:
4949
environment: pypi-minimal
5050
- distribution: full
5151
environment: pypi-full
52-
52+
5353
steps:
5454
- name: Checkout code
5555
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
56-
56+
5757
- name: Set up Docker Buildx
5858
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
59-
59+
6060
- name: Build ${{ matrix.distribution }} distribution
6161
run: |
6262
cd bindings/python
6363
./build-all.sh ${{ matrix.distribution }}
64-
64+
6565
- name: Upload wheel artifact
6666
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6767
with:

.github/workflows/test-python-bindings.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ on:
66
paths:
77
- 'bindings/python/**'
88
- '.github/workflows/test-python-bindings.yml'
9-
9+
1010
# Run on pushes to branches with "python" in the name
1111
push:
1212
branches:
1313
- '**python**' # Matches: python-embedded, feature-python, python-docs, etc.
1414
- '**Python**' # Case variations
1515
- '**PYTHON**'
16-
16+
1717
# Run before releases (as a required check for python releases)
1818
release:
1919
types: [created, published]
20-
20+
2121
# Allow being called by other workflows (e.g., release workflow)
2222
workflow_call:
23-
23+
2424
# Allow manual trigger
2525
workflow_dispatch:
2626
inputs:
@@ -49,69 +49,69 @@ jobs:
4949
- distribution: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.distribution != 'all' && github.event.inputs.distribution != 'headless' && 'headless' || '' }}
5050
- distribution: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.distribution != 'all' && github.event.inputs.distribution != 'minimal' && 'minimal' || '' }}
5151
- distribution: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.distribution != 'all' && github.event.inputs.distribution != 'full' && 'full' || '' }}
52-
52+
5353
steps:
5454
- name: Checkout code
5555
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
56-
56+
5757
- name: Set up Docker Buildx
5858
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
59-
59+
6060
- name: Build and test ${{ matrix.distribution }} distribution
6161
run: |
6262
cd bindings/python
6363
echo "🔨 Building ${{ matrix.distribution }} distribution..."
6464
./build-all.sh ${{ matrix.distribution }}
6565
env:
6666
DISTRIBUTION: ${{ matrix.distribution }}
67-
67+
6868
- name: Extract wheel for additional testing
6969
run: |
7070
cd bindings/python
7171
mkdir -p test-install
7272
cp dist/*${{ matrix.distribution }}*.whl test-install/ || cp dist/*.whl test-install/
73-
73+
7474
- name: Set up Python for host testing
7575
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
7676
with:
7777
python-version: '3.11'
78-
78+
7979
- name: Install Java (required for JPype)
8080
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
8181
with:
8282
distribution: 'temurin'
8383
java-version: '21'
84-
84+
8585
- name: Install wheel and test dependencies
8686
run: |
8787
cd bindings/python
8888
pip install test-install/*.whl pytest pytest-cov requests
89-
89+
9090
- name: Run pytest on host
9191
id: pytest
9292
run: |
9393
cd bindings/python
9494
echo "🧪 Testing ${{ matrix.distribution }} distribution..."
95-
95+
9696
# Run pytest with verbose output
9797
pytest tests/ -v --tb=short --color=yes 2>&1 | tee pytest-output.txt
98-
98+
9999
# Check results
100100
if grep -q "failed" pytest-output.txt; then
101101
echo "❌ Tests FAILED"
102102
exit 1
103103
elif grep -q "passed" pytest-output.txt || grep -q "skipped" pytest-output.txt; then
104104
echo "✅ Tests PASSED (may include skipped tests based on distribution)"
105-
105+
106106
# Count results
107107
PASSED=$(grep -oP '\d+(?= passed)' pytest-output.txt || echo "0")
108108
SKIPPED=$(grep -oP '\d+(?= skipped)' pytest-output.txt || echo "0")
109109
FAILED=$(grep -oP '\d+(?= failed)' pytest-output.txt || echo "0")
110-
110+
111111
echo "passed=$PASSED" >> $GITHUB_OUTPUT
112112
echo "skipped=$SKIPPED" >> $GITHUB_OUTPUT
113113
echo "failed=$FAILED" >> $GITHUB_OUTPUT
114-
114+
115115
# Exit with error if any failures
116116
if [ "$FAILED" != "0" ]; then
117117
exit 1
@@ -120,35 +120,35 @@ jobs:
120120
echo "⚠️ Unexpected test output"
121121
exit 1
122122
fi
123-
123+
124124
- name: Generate test summary
125125
if: always()
126126
run: |
127127
cd bindings/python
128-
128+
129129
echo "## 🧪 Test Results: ${{ matrix.distribution }}" >> $GITHUB_STEP_SUMMARY
130130
echo "" >> $GITHUB_STEP_SUMMARY
131-
131+
132132
if [ "${{ steps.pytest.outcome }}" = "success" ]; then
133133
echo "✅ **Status**: PASSED" >> $GITHUB_STEP_SUMMARY
134134
else
135135
echo "❌ **Status**: FAILED" >> $GITHUB_STEP_SUMMARY
136136
fi
137-
137+
138138
echo "" >> $GITHUB_STEP_SUMMARY
139139
echo "| Metric | Count |" >> $GITHUB_STEP_SUMMARY
140140
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
141141
echo "| ✅ Passed | ${{ steps.pytest.outputs.passed || 'N/A' }} |" >> $GITHUB_STEP_SUMMARY
142142
echo "| ⏭️ Skipped | ${{ steps.pytest.outputs.skipped || 'N/A' }} |" >> $GITHUB_STEP_SUMMARY
143143
echo "| ❌ Failed | ${{ steps.pytest.outputs.failed || 'N/A' }} |" >> $GITHUB_STEP_SUMMARY
144144
echo "" >> $GITHUB_STEP_SUMMARY
145-
145+
146146
echo "### Expected Behavior by Distribution:" >> $GITHUB_STEP_SUMMARY
147147
echo "" >> $GITHUB_STEP_SUMMARY
148148
echo "- **Headless**: Some tests skipped (no server/Gremlin features)" >> $GITHUB_STEP_SUMMARY
149149
echo "- **Minimal**: Few tests skipped (no Gremlin, has server/Studio)" >> $GITHUB_STEP_SUMMARY
150150
echo "- **Full**: Minimal skipped tests (all features available)" >> $GITHUB_STEP_SUMMARY
151-
151+
152152
- name: Upload test results
153153
if: always()
154154
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
@@ -158,7 +158,7 @@ jobs:
158158
bindings/python/pytest-output.txt
159159
bindings/python/.coverage
160160
retention-days: 7
161-
161+
162162
- name: Upload wheel artifact
163163
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
164164
with:
@@ -177,7 +177,7 @@ jobs:
177177
run: |
178178
echo "## 🎯 Overall Test Summary" >> $GITHUB_STEP_SUMMARY
179179
echo "" >> $GITHUB_STEP_SUMMARY
180-
180+
181181
if [ "${{ needs.test.result }}" = "success" ]; then
182182
echo "✅ **All distributions passed testing!**" >> $GITHUB_STEP_SUMMARY
183183
echo "" >> $GITHUB_STEP_SUMMARY

bindings/python/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ import arcadedb_embedded as arcadedb
4848
with arcadedb.create_database("/tmp/mydb") as db:
4949
# Create schema
5050
db.command("sql", "CREATE DOCUMENT TYPE Person")
51-
51+
5252
# Insert data (requires transaction)
5353
with db.transaction():
5454
db.command("sql", "INSERT INTO Person SET name = 'Alice', age = 30")
55-
55+
5656
# Query data
5757
result = db.query("sql", "SELECT FROM Person WHERE age > 25")
5858
for record in result:
@@ -121,7 +121,7 @@ cd bindings/python/
121121

122122
# Or build specific distribution
123123
./build-all.sh headless # ~94 MB
124-
./build-all.sh minimal # ~97 MB
124+
./build-all.sh minimal # ~97 MB
125125
./build-all.sh full # ~158 MB
126126
```
127127

0 commit comments

Comments
 (0)