Skip to content
Snippets Groups Projects
Commit 62833b5f authored by Krzysztof Mochocki's avatar Krzysztof Mochocki
Browse files

Use PYPROJECT_DIR during poetry install

parent c044f6f6
No related branches found
No related tags found
1 merge request!39Add copying of dist, if build happened in different directory
Pipeline #104285 passed
...@@ -22,10 +22,9 @@ variables: ...@@ -22,10 +22,9 @@ variables:
.configuration_template: .configuration_template:
extends: .job-defaults extends: .job-defaults
image: "${PYTHON_IMAGE}" image: "${PYTHON_IMAGE}"
variables:
PYPROJECT_DIR: "$(pwd)"
before_script: before_script:
- if [ -z "${PYPROJECT_DIR}" ]; then PYPROJECT_DIR="$(pwd)"; else echo "using - ${PYPROJECT_DIR}"; fi
- poetry -C "${PYPROJECT_DIR}" env use python3 # create virtualenv if not exists - poetry -C "${PYPROJECT_DIR}" env use python3 # create virtualenv if not exists
- source $(poetry -C "${PYPROJECT_DIR}" env info --path)/bin/activate # activate that virtualenv - source $(poetry -C "${PYPROJECT_DIR}" env info --path)/bin/activate # activate that virtualenv
- python3 -V - python3 -V
...@@ -37,7 +36,7 @@ variables: ...@@ -37,7 +36,7 @@ variables:
extends: .configuration_template extends: .configuration_template
before_script: before_script:
- !reference [.configuration_template, before_script] - !reference [.configuration_template, before_script]
- poetry install - poetry -C "${PYPROJECT_DIR}" install
- pip list - pip list
...@@ -45,11 +44,13 @@ variables: ...@@ -45,11 +44,13 @@ variables:
.pre_commit_checks_template: .pre_commit_checks_template:
extends: .project_develop_configuration_template extends: .project_develop_configuration_template
variables:
PRE_COMMIT_CONFIG: "${PYPROJECT_DIR}/.pre-commit-config.yaml"
script: script:
- pushd . && cd /tmp && poetry self update && popd # Bump poetry version so `poetry lock --no-update` will use the latest one; doing it in different directory to avoid `poetry.lock` and `pyproject.toml` changes - pushd . && cd /tmp && poetry self update && popd # Bump poetry version so `poetry lock --no-update` will use the latest one; doing it in different directory to avoid `poetry.lock` and `pyproject.toml` changes
- poetry -V - poetry -C "${PYPROJECT_DIR}" -V
- echo -e "${TXT_BLUE}Checking all files with pre-commit hooks...${TXT_CLEAR}" && - echo -e "${TXT_BLUE}Checking all files with pre-commit hooks...${TXT_CLEAR}" &&
pre-commit run --all-files pre-commit run --config ${PRE_COMMIT_CONFIG} --all-files
artifacts: artifacts:
when: always when: always
expire_in: 1 week expire_in: 1 week
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment