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

View File

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

View File

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