Skip to content
Snippets Groups Projects
Commit 8513817c authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch '19-dont_override_source_requirements' into 'master'

fix: prevent override source project dependencies versions with template install

Closes #19

See merge request to-be-continuous/python!26
parents b878ba83 c0c94647
No related branches found
No related tags found
No related merge requests found
...@@ -212,7 +212,7 @@ variables: ...@@ -212,7 +212,7 @@ variables:
if [[ ! -f "poetry.lock" ]]; then if [[ ! -f "poetry.lock" ]]; then
log_warn "Poetry detected but \\e[33;1mpoetry.lock\\e[0m file not found: you shall commit it with your project files" log_warn "Poetry detected but \\e[33;1mpoetry.lock\\e[0m file not found: you shall commit it with your project files"
fi fi
pip install -U poetry pip install poetry
if [[ "$target" == "build" ]]; then if [[ "$target" == "build" ]]; then
log_info "--- Poetry detected: install build only requirements" log_info "--- Poetry detected: install build only requirements"
poetry install --no-dev ${PYTHON_POETRY_EXTRAS:+--extras "$PYTHON_POETRY_EXTRAS"} poetry install --no-dev ${PYTHON_POETRY_EXTRAS:+--extras "$PYTHON_POETRY_EXTRAS"}
...@@ -242,7 +242,7 @@ variables: ...@@ -242,7 +242,7 @@ variables:
if [[ -f "pyproject.toml" ]] && [[ "${PYTHON_POETRY_DISABLED}" != "true" ]]; then if [[ -f "pyproject.toml" ]] && [[ "${PYTHON_POETRY_DISABLED}" != "true" ]]; then
if ! command -v poetry > /dev/null if ! command -v poetry > /dev/null
then then
pip install -U poetry pip install poetry
fi fi
poetry run "$@" poetry run "$@"
else else
...@@ -260,20 +260,20 @@ variables: ...@@ -260,20 +260,20 @@ variables:
function _package(){ function _package(){
if [[ -f "pyproject.toml" ]] && [[ "${PYTHON_POETRY_DISABLED}" != "true" ]]; then if [[ -f "pyproject.toml" ]] && [[ "${PYTHON_POETRY_DISABLED}" != "true" ]]; then
pip install -U poetry pip install poetry
poetry build poetry build
else else
pip install setuptools
python setup.py sdist bdist_wheel python setup.py sdist bdist_wheel
fi fi
} }
function _publish() { function _publish() {
if [[ -f "pyproject.toml" ]] && [[ "${PYTHON_POETRY_DISABLED}" != "true" ]]; then if [[ -f "pyproject.toml" ]] && [[ "${PYTHON_POETRY_DISABLED}" != "true" ]]; then
pip install -U poetry pip install poetry
poetry config repositories.user_defined "$TWINE_REPOSITORY_URL" poetry config repositories.user_defined "$TWINE_REPOSITORY_URL"
poetry publish --username "$TWINE_USERNAME" --password "$TWINE_PASSWORD" --repository user_defined poetry publish --username "$TWINE_USERNAME" --password "$TWINE_PASSWORD" --repository user_defined
else else
pip install -U twine setuptools pip install twine
pip list pip list
twine upload --verbose dist/*.tar.gz twine upload --verbose dist/*.tar.gz
...@@ -283,10 +283,10 @@ variables: ...@@ -283,10 +283,10 @@ variables:
function _release() { function _release() {
if [[ -f "pyproject.toml" ]] && [[ "${PYTHON_POETRY_DISABLED}" != "true" ]]; then if [[ -f "pyproject.toml" ]] && [[ "${PYTHON_POETRY_DISABLED}" != "true" ]]; then
pip install -U poetry pip install poetry
poetry version "${RELEASE_VERSION_PART}" poetry version "${RELEASE_VERSION_PART}"
else else
pip install -U bumpversion pip install bumpversion
release_args release_args
bumpversion "${bumpversion_args}" bumpversion "${bumpversion_args}"
fi fi
...@@ -372,7 +372,7 @@ py-lint: ...@@ -372,7 +372,7 @@ py-lint:
- mkdir -p reports - mkdir -p reports
- chmod o+rwx reports - chmod o+rwx reports
- install_requirements build - install_requirements build
- _pip install -U pylint_gitlab - _pip install pylint_gitlab
- | - |
if ! _run pylint --ignore=.cache --output-format=text ${PYLINT_ARGS} ${PYLINT_FILES:-$(find -type f -name "*.py")} if ! _run pylint --ignore=.cache --output-format=text ${PYLINT_ARGS} ${PYLINT_FILES:-$(find -type f -name "*.py")}
then then
...@@ -427,9 +427,9 @@ py-unittest: ...@@ -427,9 +427,9 @@ py-unittest:
- chmod o+rwx reports - chmod o+rwx reports
- install_requirements test - install_requirements test
# code coverage # code coverage
- _pip install -U coverage - _pip install coverage
# JUnit XML report # JUnit XML report
- _pip install -U unittest-xml-reporting - _pip install unittest-xml-reporting
- _run coverage run -m xmlrunner discover -o "reports/" $UNITTEST_ARGS - _run coverage run -m xmlrunner discover -o "reports/" $UNITTEST_ARGS
- _run coverage report -m - _run coverage report -m
- _run coverage xml -o "reports/coverage.xml" - _run coverage xml -o "reports/coverage.xml"
...@@ -458,7 +458,7 @@ py-pytest: ...@@ -458,7 +458,7 @@ py-pytest:
- mkdir -p reports - mkdir -p reports
- chmod o+rwx reports - chmod o+rwx reports
- install_requirements test - install_requirements test
- _pip install -U pytest pytest-cov coverage - _pip install pytest pytest-cov coverage
- _python -m pytest --junit-xml=reports/TEST-pytests.xml --cov --cov-report term --cov-report xml:reports/coverage.xml ${PYTEST_ARGS} - _python -m pytest --junit-xml=reports/TEST-pytests.xml --cov --cov-report term --cov-report xml:reports/coverage.xml ${PYTEST_ARGS}
coverage: /^TOTAL.+?(\d+\%)$/ coverage: /^TOTAL.+?(\d+\%)$/
artifacts: artifacts:
...@@ -513,7 +513,7 @@ py-bandit: ...@@ -513,7 +513,7 @@ py-bandit:
script: script:
- mkdir -p reports - mkdir -p reports
- chmod o+rwx reports - chmod o+rwx reports
- _pip install -U bandit - _pip install bandit
- | - |
if ! _run bandit ${TRACE+--verbose} ${BANDIT_ARGS} if ! _run bandit ${TRACE+--verbose} ${BANDIT_ARGS}
then then
......
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