7
7
CONN_STRING=$( $atlas deployments connect $DIR --connectWith connectionString)
8
8
PYTHON_BINARY=$( find_python3)
9
9
10
+
10
11
# WORKING_DIR = src/semantic-kernel-python/semantic-kernel
11
12
cd python
12
13
13
- $PYTHON_BINARY -m venv .
14
- source ./bin/activate
15
14
16
- pip install poetry
17
- pip install pytest
18
- pip install grpcio
19
- poetry install
15
+ # Install Poetry into base python
16
+ $PYTHON_BINARY -m pip install -U pip poetry
17
+ # Create a package specific poetry environment
18
+ $PYTHON_BINARY -m poetry env use $PYTHON_BINARY
19
+ # Activate the poetry env, which itself does not include poetry
20
+ source $( $PYTHON_BINARY -m poetry env info --path) /bin/activate
21
+ # Recreate the poetry lock file
22
+ $PYTHON_BINARY -m poetry lock --no-update
23
+ # Install from pyproject.toml into package specific environment
24
+ $PYTHON_BINARY -m poetry install --with dev
25
+
26
+ # Create .env file
27
+ python -c " from dotenv import set_key; set_key('.env', 'OPENAI_API_KEY', '$openai_api_key ')"
28
+ python -c " from dotenv import set_key; set_key('.env', 'MONGODB_ATLAS_CONNECTION_STRING', '$CONN_STRING ')"
20
29
21
30
# Workaround to test vector search first
22
31
OPENAI_API_KEY=$openai_api_key \
@@ -26,7 +35,7 @@ AZURE_OPENAI_ENDPOINT="" \
26
35
AZURE_OPENAI_API_KEY=" " \
27
36
MONGODB_ATLAS_CONNECTION_STRING=$CONN_STRING \
28
37
Python_Integration_Tests=1 \
29
- poetry run pytest tests/integration/connectors/memory/test_mongodb_atlas.py -k test_collection_knn
38
+ $PYTHON_BINARY -m poetry run pytest tests/integration/connectors/memory/test_mongodb_atlas.py -k test_collection_knn
30
39
31
40
# Stored in evergreen VARIABLES
32
41
OPENAI_API_KEY=$openai_api_key \
@@ -36,4 +45,4 @@ AZURE_OPENAI_ENDPOINT="" \
36
45
AZURE_OPENAI_API_KEY=" " \
37
46
MONGODB_ATLAS_CONNECTION_STRING=$CONN_STRING \
38
47
Python_Integration_Tests=1 \
39
- poetry run pytest tests/integration/connectors/memory/test_mongodb_atlas.py
48
+ $PYTHON_BINARY -m poetry run pytest tests/integration/connectors/memory/test_mongodb_atlas.py
0 commit comments