Newer
Older
cache:
key: "project-${CI_JOB_NAME}"
paths:
- .cache/pip
- .venv
key:
files:
- poetry.lock
- test -e $HOME/.poetry/bin/ || curl -sSL https://install.python-poetry.org | python3 -
- poetry --version
- poetry config virtualenvs.in-project true
- git remote rm origin && git remote add origin https://${ACCESS_TOKEN_NAME}:${ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
- if [ ${var+TRIGGER_PYPI_NAME} ]; then echo "Pipeline triggered by ${TRIGGER_PYPI_NAME}"; poetry update ${TRIGGER_PYPI_NAME}; fi
- poetry install -vv
# - poetry export -f requirements.txt --output requirements.txt
# - sed '/^zeroc-ice/,/^[z.*]/{/z.*/!d}' requirements.txt | grep -v zeroc-ice > nozice.txt
# - pip install -r nozice.txt --no-deps && pip install pytest black mypy
- poetry run mypy . --exclude 'setup\.py$'
# We can remove the flag once this is resolved https://github.com/pypa/setuptools/issues/2345
- poetry version ${BUMP_RULE}
- git config --global user.email ${GITLAB_USER_EMAIL}
- git config --global user.name ${GITLAB_USER_NAME}
- git add pyproject.toml poetry.lock
# - git pull && git push -o ci.skip origin HEAD:master && poetry publish --build --username ${PYPI_USER} --password ${PYPI_PASSWORD}
- echo "TRIGGER_PYPI_NAME=$(cat pyproject.toml | grep '^name =' | head -n 1 | cut -f3 -d' ' | tr -d \")" >> build.env
artifacts:
reports:
dotenv: build.env
needs:
job: Unit test
## Custom stages ##