Skip to content

Commit b8eb5b8

Browse files
authored
Merge pull request #41 from Jibola/run-lint
Make lint fixes provided by pre-commit
2 parents ed1c6a2 + 121bab5 commit b8eb5b8

File tree

15 files changed

+39
-20
lines changed

15 files changed

+39
-20
lines changed

.evergreen/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ buildvariants:
187187
- rhel87-small
188188
tasks:
189189
- name: test-llama-index
190-
190+
191191
- name: test-docarray-rhel
192192
display_name: DocArray RHEL
193193
expansions:
@@ -210,4 +210,4 @@ buildvariants:
210210
run_on:
211211
- rhel87-small
212212
tasks:
213-
- name: test-autogen
213+
- name: test-autogen

.evergreen/provision-atlas.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ PYTHON_BINARY=$(find_python3)
77
# Should be called from src
88
EVERGREEN_PATH=$(pwd)/.evergreen
99
TARGET_DIR=$(pwd)/$DIR
10-
PING_ATLAS=$EVERGREEN_PATH/ping_atlas.py
1110
SCAFFOLD_SCRIPT=$EVERGREEN_PATH/scaffold_atlas.py
12-
DEPLOYMENT_NAME=$DIR
1311

1412
set -ex
1513
mkdir atlas

.evergreen/scaffold_atlas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def upload_data(db: Database, filename: Path) -> None:
3636
loaded_collection = json.load(f)
3737

3838
logger.info(
39-
"Loading %s to Atlas database %s in colleciton %s",
39+
"Loading %s to Atlas database %s in collection %s",
4040
filename.name,
4141
db.name,
4242
collection_name,

.evergreen/utils.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ setup_local_atlas() {
8080
*)
8181
echo "Unrecognized state $STATE"
8282
sleep 1
83-
esac
83+
esac
8484
done
8585

8686
echo "container did not get healthy within 120 seconds, quitting"
@@ -92,14 +92,14 @@ setup_local_atlas() {
9292
wait "$CONTAINER_ID"
9393
EXPOSED_PORT=$(podman inspect --format='{{ (index (index .NetworkSettings.Ports "27017/tcp") 0).HostPort }}' "$CONTAINER_ID")
9494
export CONN_STRING="mongodb://127.0.0.1:$EXPOSED_PORT/?directConnection=true"
95+
# shellcheck disable=SC2154
9596
echo "CONN_STRING=mongodb://127.0.0.1:$EXPOSED_PORT/?directConnection=true" > $workdir/src/.evergreen/.local_atlas_uri
9697
}
9798

9899
fetch_local_atlas_uri() {
100+
# shellcheck disable=SC2154
99101
. $workdir/src/.evergreen/.local_atlas_uri
100102

101103
export CONN_STRING=$CONN_STRING
102104
echo "$CONN_STRING"
103105
}
104-
105-

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
python -m pip install -U pip pre-commit
2727
- name: Run linters
2828
run: |
29-
pre-commit run --hook-stage=manual --all-files
29+
pre-commit run --hook-stage=manual --all-files

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ xunit-results/
4949

5050
# Miscellaneous
5151
.DS_Store
52-

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Within each subdirectory you should expect to have:
3030
The general layout of this repo looks like this:
3131

3232
```bash
33-
├── LICENSE # License Agreeement
33+
├── LICENSE # License Agreement
3434
├── README.md # This Document
3535
├── langchain-python # Folder scoped for one Integration
3636
│ └── run.sh # Script that executes test

autogen/run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66

77
set -x
88

9+
# shellcheck disable=SC2154
910
. $workdir/src/.evergreen/utils.sh
1011
PYTHON_BINARY=$(find_python3)
1112
$PYTHON_BINARY -c "import sys; print(f'Python version found: {sys.version_info}')"
1213

1314
# Create and activate an isolated python venv environment
1415
$PYTHON_BINARY -m venv venv
15-
source venv/bin/activate
16+
. venv/bin/activate
1617
# Install autogen with extras
1718
$PYTHON_BINARY -m pip install .[test,"retrievechat-mongodb"]
1819

1920

2021
# Run tests. Sensitive variables in Evergreen come from Evergreen project: ai-ml-pipeline-testing/
22+
# shellcheck disable=SC2154
2123
MONGODB_URI=$autogen_mongodb_uri \
2224
MONGODB_DATABASE="autogen_test_db" \
2325
$PYTHON_BINARY -m pytest -v test/agentchat/contrib/vectordb/test_mongodb.py

chatgpt-retrieval-plugin/run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
set -x
66

7+
# shellcheck disable=SC2154
78
. $workdir/src/.evergreen/utils.sh
89

910
PYTHON_BINARY=$(find_python3)
@@ -14,13 +15,14 @@ $PYTHON_BINARY -m pip install -U pip poetry
1415
# Create a package specific poetry environment
1516
$PYTHON_BINARY -m poetry env use $PYTHON_BINARY
1617
# Activate the poetry env, which itself does not include poetry
17-
source $($PYTHON_BINARY -m poetry env info --path)/bin/activate
18+
. "$($PYTHON_BINARY -m poetry env info --path)/bin/activate"
1819
# Recreate the poetry lock file
1920
$PYTHON_BINARY -m poetry lock --no-update
2021
# Install from pyproject.toml into package specific environment
2122
$PYTHON_BINARY -m poetry install --with dev
2223

2324
# Run tests. Sensitive variables in Evergreen come from Evergeen project: ai-ml-pipeline-testing/
25+
# shellcheck disable=SC2154
2426
OPENAI_API_KEY=$openai_api_key \
2527
DATASTORE="mongodb-atlas" \
2628
BEARER_TOKEN="staylowandkeepmoving" \

docarray/run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55

66
set -x
77

8+
# shellcheck disable=SC2154
89
. $workdir/src/.evergreen/utils.sh
910
PYTHON_BINARY=$(find_python3)
1011
$PYTHON_BINARY -c "import sys; print(f'Python version found: {sys.version_info}')"
1112

1213
# Create and activate an isolated python venv environment
1314
$PYTHON_BINARY -m venv venv
14-
source venv/bin/activate
15+
. venv/bin/activate
1516
# Install Poetry
1617
pip install -U pip poetry
1718
# Recreate the poetry lock file
@@ -21,6 +22,7 @@ poetry install --with dev --extras mongo
2122

2223

2324
# Run tests. Sensitive variables in Evergreen come from Evergeen project: ai-ml-pipeline-testing/
25+
# shellcheck disable=SC2154
2426
MONGODB_URI=$docarray_mongodb_uri \
2527
MONGODB_DATABASE="docarray_test_db" \
26-
pytest -v tests/index/mongo_atlas
28+
pytest -v tests/index/mongo_atlas

langchain-python/run.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
# WORKING_DIR = src/langchain-python/langchain
44
set -x
55

6+
# shellcheck disable=SC2154
67
. $workdir/src/.evergreen/utils.sh
78

89
PYTHON_BINARY=$(find_python3)
910

11+
# shellcheck disable=SC2164
1012
cd libs/partners/mongodb
1113

1214
$PYTHON_BINARY -m venv venv_pipeline
@@ -18,7 +20,10 @@ poetry lock --no-update
1820

1921
poetry install --with test --with test_integration
2022

21-
export MONGODB_ATLAS_URI=$(fetch_local_atlas_uri)
23+
MONGODB_ATLAS_URI=$(fetch_local_atlas_uri)
24+
25+
export MONGODB_ATLAS_URI
26+
# shellcheck disable=SC2154
2227
export OPENAI_API_KEY=$openai_api_key
2328

2429
make test

llama-index-python-kvstore/run.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22

33
set -x
44

5+
# shellcheck disable=SC2154
56
. $workdir/src/.evergreen/utils.sh
67

78
CONN_STRING=$(fetch_local_atlas_uri)
89
PYTHON_BINARY=$(find_python3)
910
$PYTHON_BINARY -c "import sys; print(f'Python version found: {sys.version_info}')"
1011

1112
# cd to the MongoDB integration. It has its own project
13+
# shellcheck disable=SC2164
1214
cd llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-mongodb
13-
15+
1416
# Install Poetry into base python
1517
$PYTHON_BINARY -m pip install -U pip poetry
1618
# Create a package specific poetry environment
1719
$PYTHON_BINARY -m poetry env use $PYTHON_BINARY
1820
# Activate the poetry env, which itself does not include poetry
19-
source $($PYTHON_BINARY -m poetry env info --path)/bin/activate
21+
. "$($PYTHON_BINARY -m poetry env info --path)/bin/activate"
2022
# PYTHON-4522: Will fix requirement in llama-index repo
2123
$PYTHON_BINARY -m poetry add motor
2224
# Recreate the poetry lock file
@@ -25,6 +27,7 @@ $PYTHON_BINARY -m poetry lock --no-update
2527
$PYTHON_BINARY -m poetry install --with dev
2628

2729
# Run tests. Sensitive variables in Evergreen come from Evergreen project: ai-ml-pipeline-testing/
30+
# shellcheck disable=SC2154
2831
OPENAI_API_KEY=$openai_api_key \
2932
MONGODB_URI=$CONN_STRING \
3033
MONGODB_DATABASE="llama_index_test_db" \

llama-index-python-vectorstore/run.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,29 @@
22

33
set -x
44

5+
# shellcheck disable=SC2154
56
. $workdir/src/.evergreen/utils.sh
67

78
PYTHON_BINARY=$(find_python3)
89
$PYTHON_BINARY -c "import sys; print(f'Python version found: {sys.version_info}')"
910

1011
# cd to the MongoDB integration. It has its own project
12+
# shellcheck disable=SC2164
1113
cd llama-index-integrations/vector_stores/llama-index-vector-stores-mongodb
1214

1315
# Install Poetry into base python
1416
$PYTHON_BINARY -m pip install -U pip poetry
1517
# Create a package specific poetry environment
1618
$PYTHON_BINARY -m poetry env use $PYTHON_BINARY
1719
# Activate the poetry env, which itself does not include poetry
18-
source $($PYTHON_BINARY -m poetry env info --path)/bin/activate
20+
. "$($PYTHON_BINARY -m poetry env info --path)/bin/activate"
1921
# Recreate the poetry lock file
2022
$PYTHON_BINARY -m poetry lock --no-update
2123
# Install from pyproject.toml into package specific environment
2224
$PYTHON_BINARY -m poetry install --with dev
2325

2426
# Run tests. Sensitive variables in Evergreen come from Evergreen project: ai-ml-pipeline-testing/
27+
# shellcheck disable=SC2154
2528
MONGODB_URI=$(fetch_local_atlas_uri) \
2629
OPENAI_API_KEY=$openai_api_key \
2730
MONGODB_DATABASE="llama_index_test_db" \

semantic-kernel-csharp/run.sh

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

33
set -x
44

5+
# shellcheck disable=SC2154
56
. $workdir/src/.evergreen/utils.sh
67
# WORKING_DIR = src/semantic-kernel-csharp/semantic-kernel
78

@@ -20,4 +21,4 @@ sed -i -e 's/"MongoDB Atlas cluster is required"/null/g' dotnet/src/IntegrationT
2021
# Run tests
2122
echo "Running MongoDBMemoryStoreTests"
2223
MongoDB__ConnectionString=$(fetch_local_atlas_uri) \
23-
$DOTNET_SDK_PATH/dotnet test dotnet/src/IntegrationTests/IntegrationTests.csproj --filter SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBMemoryStoreTests
24+
$DOTNET_SDK_PATH/dotnet test dotnet/src/IntegrationTests/IntegrationTests.csproj --filter SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBMemoryStoreTests

semantic-kernel-python/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
set -x
44

5+
# shellcheck disable=SC2154
56
. $workdir/src/.evergreen/utils.sh
67

78
CONN_STRING=$(fetch_local_atlas_uri)
89
PYTHON_BINARY=$(find_python3)
910

1011
# WORKING_DIR = src/semantic-kernel-python/semantic-kernel
12+
# shellcheck disable=SC2164
1113
cd python
1214

1315
# Temporary solution until https://github.com/microsoft/semantic-kernel/issues/9067 resolves
@@ -19,6 +21,7 @@ make install-python
1921
make install-sk
2022
make install-pre-commit
2123

24+
# shellcheck disable=SC2154
2225
OPENAI_API_KEY=$openai_api_key \
2326
OPENAI_ORG_ID="" \
2427
AZURE_OPENAI_DEPLOYMENT_NAME="" \
@@ -28,6 +31,7 @@ OPENAI_API_KEY=$openai_api_key \
2831
Python_Integration_Tests=1 \
2932
uv run pytest tests/integration/connectors/memory/test_mongodb_atlas.py -k test_collection_knn
3033

34+
# shellcheck disable=SC2154
3135
OPENAI_API_KEY=$openai_api_key \
3236
OPENAI_ORG_ID="" \
3337
AZURE_OPENAI_DEPLOYMENT_NAME="" \

0 commit comments

Comments
 (0)