diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0ae33af --- /dev/null +++ b/.drone.yml @@ -0,0 +1,30 @@ +kind: pipeline +name: default + +steps: +- name: test + image: python:3.7-alpine + commands: + - pip install -r dev-requirements.txt + - which make || apk add make + - make test +- name: build + image: python:3.7-alpine + commands: + - which make || apk add make + - pip install -r dev-requirements.txt + - make build +- name: upload + image: python:3.7-alpine + environment: + TWINE_USERNAME: + from_secret: TWINE_USERNAME + TWINE_PASSWORD: + from_secret: TWINE_PASSWORD + commands: + - which make || apk add make + - pip install -r dev-requirements.txt + - make upload + when: + event: + - tag diff --git a/Makefile b/Makefile index f02a96f..498339e 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,24 @@ -.PHONY: test dist test_upload upload +VERSION ?= $(shell grep '__version__' cloudbender/__init__.py | cut -d' ' -f3 | cut -d'-' -f1 | sed -e 's/"//g') +PACKAGE_FILE := dist/cloudbender-$(VERSION)-py2.py3-none-any.whl + +.PHONY: test build test_upload upload all + +all: test build test: - tox + flake8 --ignore=E501 cloudbender tests + TEST=True pytest --log-cli-level=DEBUG clean: - rm -rf .tox .cache .coverage .eggs cloudbender.egg-info .pytest_cache dist + rm -rf .cache .coverage .eggs cloudbender.egg-info .pytest_cache dist -dist: +build: $(PACKAGE_FILE) + +$(PACKAGE_FILE): python setup.py bdist_wheel --universal -test_upload: clean dist +test_upload: $(PACKAGE_FILE) twine upload --repository-url https://test.pypi.org/legacy/ dist/cloudbender-*.whl -upload: clean dist +upload: $(PACKAGE_FILE) twine upload dist/cloudbender-*.whl diff --git a/README.md b/README.md index 18185f0..91eb7ee 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://drone.zero-downtime.net/api/badges/ZeroDownTime/CloudBender/status.svg)](https://drone.zero-downtime.net/ZeroDownTime/CloudBender) + # CloudBender # About diff --git a/cloudbender/__init__.py b/cloudbender/__init__.py index eda037c..65c33b7 100644 --- a/cloudbender/__init__.py +++ b/cloudbender/__init__.py @@ -1,8 +1,8 @@ import logging -__author__ = 'Stefan Reimer' -__email__ = 'stefan@zero-downtimet.net' -__version__ = '0.5.1' +__author__ = "Stefan Reimer" +__email__ = "stefan@zero-downtimet.net" +__version__ = "0.5.1" # Set up logging to ``/dev/null`` like a library is supposed to. diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000..39f9a48 --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,9 @@ +boto3 +Jinja2 +oyaml +click +pyminifier +cfn-lint +flake8 +pytest +twine diff --git a/requirements.txt b/requirements.txt index 17b923a..dcdd514 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,5 @@ boto3 Jinja2 oyaml click -pytest -semver pyminifier cfn-lint diff --git a/setup.py b/setup.py index 6775967..78142a4 100644 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ setup( packages=find_packages(), include_package_data=True, entry_points={'console_scripts': [ "cloudbender = cloudbender.cli:cli" ]}, - install_requires=['boto3', 'Jinja2', 'oyaml', 'click', 'cfn-lint', 'pyminifier', 'semver'], + install_requires=['boto3', 'Jinja2', 'oyaml', 'click', 'cfn-lint', 'pyminifier'], tests_require=["pytest-cov", "moto", "mock", 'pytest'], cmdclass={"test": PyTest}, classifiers=[ diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 93b5668..0000000 --- a/tox.ini +++ /dev/null @@ -1,19 +0,0 @@ -# Tox configuration -[tox] -# List the environment that will be run by default -envlist = flake8, py36 - -[testenv] -commands = python setup.py -q test - -# Settings specific to the flake8 environment -[testenv:flake8] -# The command to run: -commands = flake8 cloudbender/ tests/ -# We only need flake8 when linting, we do not care about the project dependencies -deps = flake8 - -[flake8] -show-source = True -exclude = .venv,.tox,dist,doc,build,*.egg,.test,system -ignore = E501