adjust ci to use poetry

This commit is contained in:
Robert Kaussow 2020-11-15 21:52:35 +01:00
parent 8f9d40a31e
commit c34d12ab98
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
3 changed files with 92 additions and 152 deletions

View File

@ -3,15 +3,13 @@ local PythonVersion(pyversion='3.5') = {
image: 'python:' + pyversion,
environment: {
PY_COLORS: 1,
SETUPTOOLS_SCM_PRETEND_VERSION: '${DRONE_TAG##v}',
},
commands: [
'pip install pipenv -qq',
'pipenv --bare install --dev --keep-outdated',
'pipenv run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail',
'pip install -qq .',
'docker-tidy --help',
'docker-tidy --version',
'pip install poetry -qq',
'poetry install -q',
'poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail',
'poetry docker-tidy --help',
'poetry docker-tidy --version',
],
depends_on: [
'clone',
@ -28,14 +26,14 @@ local PipelineLint = {
steps: [
{
name: 'flake8',
image: 'python:3.8',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install pipenv -qq',
'pipenv --bare install --dev --keep-outdated',
'pipenv run flake8 ./dockertidy',
'pip install poetry -qq',
'poetry install -q',
'poetry run flake8 ./dockertidy',
],
},
],
@ -44,36 +42,6 @@ local PipelineLint = {
},
};
local PipelineDeps = {
kind: 'pipeline',
name: 'dependencies',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'pipenv',
image: 'python:3.8',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install pipenv -qq',
'pipenv --bare install --keep-outdated',
'pipenv --bare install --dev --keep-outdated',
'pipenv run pipenv-setup check',
],
},
],
depends_on: [
'lint',
],
trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineTest = {
kind: 'pipeline',
name: 'test',
@ -86,9 +54,10 @@ local PipelineTest = {
PythonVersion(pyversion='3.6'),
PythonVersion(pyversion='3.7'),
PythonVersion(pyversion='3.8'),
PythonVersion(pyversion='3.9'),
{
name: 'codecov',
image: 'python:3.8',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
CODECOV_TOKEN: { from_secret: 'codecov_token' },
@ -123,14 +92,14 @@ local PipelineSecurity = {
steps: [
{
name: 'bandit',
image: 'python:3.8',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install pipenv -qq',
'pipenv --bare install --dev --keep-outdated',
'pipenv run bandit -r ./dockertidy -x ./dockertidy/test',
'pip install poetry -qq',
'poetry install -q',
'poetry run bandit -r ./dockertidy -x ./dockertidy/test',
],
},
],
@ -152,12 +121,10 @@ local PipelineBuildPackage = {
steps: [
{
name: 'build',
image: 'python:3.8',
environment: {
SETUPTOOLS_SCM_PRETEND_VERSION: '${DRONE_TAG##v}',
},
image: 'python:3.9',
commands: [
'python setup.py sdist bdist_wheel',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
},
{
@ -183,12 +150,14 @@ local PipelineBuildPackage = {
},
{
name: 'publish-pypi',
image: 'plugins/pypi',
settings: {
username: { from_secret: 'pypi_username' },
password: { from_secret: 'pypi_password' },
repository: 'https://upload.pypi.org/legacy/',
skip_build: true,
image: 'python:3.9',
commands: [
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
environment: {
POETRY_HTTP_BASIC_TESTPYPI_USERNAME: { from_secret: 'pypi_username' },
POETRY_HTTP_BASIC_TESTPYPI_PASSWORD: { from_secret: 'pypi_password' },
},
when: {
ref: ['refs/tags/**'],
@ -213,13 +182,11 @@ local PipelineBuildContainer(arch='amd64') = {
steps: [
{
name: 'build',
image: 'python:3.8',
image: 'python:3.9',
commands: [
'python setup.py bdist_wheel',
'pip install poetry poetry-dynamic-versioning -qq',
'poetry build',
],
environment: {
SETUPTOOLS_SCM_PRETEND_VERSION: '${DRONE_TAG##v}',
},
},
{
name: 'dryrun',
@ -478,7 +445,6 @@ local PipelineNotifications = {
[
PipelineLint,
PipelineDeps,
PipelineTest,
PipelineSecurity,
PipelineBuildPackage,

View File

@ -8,11 +8,11 @@ platform:
steps:
- name: flake8
image: python:3.8
image: python:3.9
commands:
- pip install pipenv -qq
- pipenv --bare install --dev --keep-outdated
- pipenv run flake8 ./dockertidy
- pip install poetry -qq
- poetry install -q
- poetry run flake8 ./dockertidy
environment:
PY_COLORS: 1
@ -22,34 +22,6 @@ trigger:
- refs/tags/**
- refs/pull/**
---
kind: pipeline
name: dependencies
platform:
os: linux
arch: amd64
steps:
- name: pipenv
image: python:3.8
commands:
- pip install pipenv -qq
- pipenv --bare install --keep-outdated
- pipenv --bare install --dev --keep-outdated
- pipenv run pipenv-setup check
environment:
PY_COLORS: 1
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- lint
---
kind: pipeline
name: test
@ -62,65 +34,70 @@ steps:
- name: python35-pytest
image: python:3.5
commands:
- pip install pipenv -qq
- pipenv --bare install --dev --keep-outdated
- pipenv run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
- pip install -qq .
- docker-tidy --help
- docker-tidy --version
- pip install poetry -qq
- poetry install -q
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
- poetry docker-tidy --help
- poetry docker-tidy --version
environment:
PY_COLORS: 1
SETUPTOOLS_SCM_PRETEND_VERSION: ${DRONE_TAG##v}
depends_on:
- clone
- name: python36-pytest
image: python:3.6
commands:
- pip install pipenv -qq
- pipenv --bare install --dev --keep-outdated
- pipenv run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
- pip install -qq .
- docker-tidy --help
- docker-tidy --version
- pip install poetry -qq
- poetry install -q
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
- poetry docker-tidy --help
- poetry docker-tidy --version
environment:
PY_COLORS: 1
SETUPTOOLS_SCM_PRETEND_VERSION: ${DRONE_TAG##v}
depends_on:
- clone
- name: python37-pytest
image: python:3.7
commands:
- pip install pipenv -qq
- pipenv --bare install --dev --keep-outdated
- pipenv run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
- pip install -qq .
- docker-tidy --help
- docker-tidy --version
- pip install poetry -qq
- poetry install -q
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
- poetry docker-tidy --help
- poetry docker-tidy --version
environment:
PY_COLORS: 1
SETUPTOOLS_SCM_PRETEND_VERSION: ${DRONE_TAG##v}
depends_on:
- clone
- name: python38-pytest
image: python:3.8
commands:
- pip install pipenv -qq
- pipenv --bare install --dev --keep-outdated
- pipenv run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
- pip install -qq .
- docker-tidy --help
- docker-tidy --version
- pip install poetry -qq
- poetry install -q
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
- poetry docker-tidy --help
- poetry docker-tidy --version
environment:
PY_COLORS: 1
depends_on:
- clone
- name: python39-pytest
image: python:3.9
commands:
- pip install poetry -qq
- poetry install -q
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
- poetry docker-tidy --help
- poetry docker-tidy --version
environment:
PY_COLORS: 1
SETUPTOOLS_SCM_PRETEND_VERSION: ${DRONE_TAG##v}
depends_on:
- clone
- name: codecov
image: python:3.8
image: python:3.9
commands:
- pip install codecov -qq
- codecov --required -X gcov
@ -153,11 +130,11 @@ platform:
steps:
- name: bandit
image: python:3.8
image: python:3.9
commands:
- pip install pipenv -qq
- pipenv --bare install --dev --keep-outdated
- pipenv run bandit -r ./dockertidy -x ./dockertidy/test
- pip install poetry -qq
- poetry install -q
- poetry run bandit -r ./dockertidy -x ./dockertidy/test
environment:
PY_COLORS: 1
@ -180,11 +157,10 @@ platform:
steps:
- name: build
image: python:3.8
image: python:3.9
commands:
- python setup.py sdist bdist_wheel
environment:
SETUPTOOLS_SCM_PRETEND_VERSION: ${DRONE_TAG##v}
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
- name: checksum
image: alpine
@ -207,13 +183,14 @@ steps:
- refs/tags/**
- name: publish-pypi
image: plugins/pypi
settings:
password:
image: python:3.9
commands:
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
environment:
POETRY_HTTP_BASIC_TESTPYPI_PASSWORD:
from_secret: pypi_password
repository: https://upload.pypi.org/legacy/
skip_build: true
username:
POETRY_HTTP_BASIC_TESTPYPI_USERNAME:
from_secret: pypi_username
when:
ref:
@ -238,11 +215,10 @@ platform:
steps:
- name: build
image: python:3.8
image: python:3.9
commands:
- python setup.py bdist_wheel
environment:
SETUPTOOLS_SCM_PRETEND_VERSION: ${DRONE_TAG##v}
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
- name: dryrun
image: plugins/docker:18-linux-amd64
@ -316,11 +292,10 @@ platform:
steps:
- name: build
image: python:3.8
image: python:3.9
commands:
- python setup.py bdist_wheel
environment:
SETUPTOOLS_SCM_PRETEND_VERSION: ${DRONE_TAG##v}
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
- name: dryrun
image: plugins/docker:18-linux-arm64
@ -394,11 +369,10 @@ platform:
steps:
- name: build
image: python:3.8
image: python:3.9
commands:
- python setup.py bdist_wheel
environment:
SETUPTOOLS_SCM_PRETEND_VERSION: ${DRONE_TAG##v}
- pip install poetry poetry-dynamic-versioning -qq
- poetry build
- name: dryrun
image: plugins/docker:18-linux-arm
@ -642,6 +616,6 @@ depends_on:
---
kind: signature
hmac: 41e4e1996dfd5b429fba2d13465a5a1875affe7f79bbdbcbd39b9449f89bf706
hmac: de4f69305a1dcd9e48b983fb4e6dd38569e363e81dc62cb2d1a61c7b255b5ae3
...

View File

@ -106,7 +106,7 @@ filterwarnings = [
]
[tool.coverage.run]
omit = "**/test/*"
omit = ["**/test/*"]
[build-system]
build-backend = "poetry.core.masonry.api"