Skip to content

Commit

Permalink
use PYTHONPATH to fix import issues with CMD
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-aalam committed Jul 19, 2023
1 parent 222119a commit 44ece5c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ci/docker/connector_test_lambda/Dockerfile310
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ RUN yum install -y git
WORKDIR /home/user/snowflake-connector-python
RUN chmod 777 /home/user/snowflake-connector-python
ENV PATH="${PATH}:/opt/python/cp310-cp310/bin/"
ENV PYTHONPATH="${PYTHONPATH}:/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/"

RUN pip3 install -U pip setuptools wheel tox tox-external_wheels

CMD [ "/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/app.handler" ]
CMD [ "app.handler" ]
3 changes: 2 additions & 1 deletion ci/docker/connector_test_lambda/Dockerfile311
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ RUN yum install -y git
WORKDIR /home/user/snowflake-connector-python
RUN chmod 777 /home/user/snowflake-connector-python
ENV PATH="${PATH}:/opt/python/cp311-cp311/bin/"
ENV PYTHONPATH="${PYTHONPATH}:/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/"

RUN pip3 install -U pip setuptools wheel tox tox-external_wheels

CMD [ "/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/app.handler" ]
CMD [ "app.handler" ]
3 changes: 2 additions & 1 deletion ci/docker/connector_test_lambda/Dockerfile38
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ RUN yum install -y git
WORKDIR /home/user/snowflake-connector-python
RUN chmod 777 /home/user/snowflake-connector-python
ENV PATH="${PATH}:/opt/python/cp38-cp38/bin/"
ENV PYTHONPATH="${PYTHONPATH}:/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/"

RUN pip3 install -U pip setuptools wheel tox tox-external_wheels

CMD [ "/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/app.handler" ]
CMD [ "app.handler" ]
3 changes: 2 additions & 1 deletion ci/docker/connector_test_lambda/Dockerfile39
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ RUN yum install -y git
WORKDIR /home/user/snowflake-connector-python
RUN chmod 777 /home/user/snowflake-connector-python
ENV PATH="${PATH}:/opt/python/cp39-cp39/bin/"
ENV PYTHONPATH="${PYTHONPATH}:/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/"

RUN pip3 install -U pip setuptools wheel tox tox-external_wheels

CMD [ "/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/app.handler" ]
CMD [ "app.handler" ]
2 changes: 1 addition & 1 deletion ci/docker/connector_test_lambda/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

LOGGER = logging.getLogger(__name__)
REPO_PATH = "/home/user/snowflake-connector-python"
PY_SHORT_VER = f"{sys.version_info[0]}{sys.version_info[1]}"
PY_SHORT_VER = f"{sys.version_info[0]}{sys.version_info[1]}" # 38, 39, 310, 311
ARCH = "x86" # x86, aarch64


Expand Down

0 comments on commit 44ece5c

Please sign in to comment.