diff --git a/ci/pex-build.template.yml b/ci/pex-build.template.yml
index a0e60d3d412f939e61a94495e813ae88e1956889..a527478e141bbd0845d1b93ef26227f02c63935e 100644
--- a/ci/pex-build.template.yml
+++ b/ci/pex-build.template.yml
@@ -3,9 +3,11 @@
     image: python:3.10
     script:
         - pip install build twine poetry pytest
-        - poetry build --with test ${PEX_PATH}
-        - pip install ${PEX_PATH}
-        - NAME=$(awk -F' = ' '/^\[tool.poetry\]/ { project = 1; next } /^\[.*\]/ { project = 0 } project && $1 == "name" { gsub(/"/, "", $2); print $2 }' ${PEX_PATH}/pyproject.toml)
-        - VERSION=$(sed -n 's/^__version__ = "\(.*\)\"$/\1/p' ${PEX_PATH}/*/__init__.py)
+        - WD=$PWD
+        - cd ${PEX_PATH}
+        - poetry install --with test;cd -
+        - NAME=$(awk -F' = ' '/^\[tool.poetry\]/ { project = 1; next } /^\[.*\]/ { project = 0 } project && $1 == "name" { gsub(/"/, "", $2); print $2 }' pyproject.toml)
+        - VERSION=$(sed -n 's/^__version__ = "\(.*\)\"$/\1/p' */__init__.py)
         - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${PEX_PATH}/dist/${NAME}-${VERSION}-py3-none-any.whl "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/${NAME}/${VERSION}/${NAME}-${VERSION}-py3-none-any.whl"'
-        - pytest ${PEX_PATH}/test
\ No newline at end of file
+        - pytest test
+        - cd $WD
\ No newline at end of file