Cleanup Makefile, introduce drone.io support, remove tox

This commit is contained in:
Stefan Reimer 2019-06-18 16:48:39 +00:00
parent bf0c3b41fc
commit ef4fc7a0f7
8 changed files with 59 additions and 31 deletions

30
.drone.yml Normal file
View File

@ -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

View File

@ -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: test:
tox flake8 --ignore=E501 cloudbender tests
TEST=True pytest --log-cli-level=DEBUG
clean: 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 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 twine upload --repository-url https://test.pypi.org/legacy/ dist/cloudbender-*.whl
upload: clean dist upload: $(PACKAGE_FILE)
twine upload dist/cloudbender-*.whl twine upload dist/cloudbender-*.whl

View File

@ -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 # CloudBender
# About # About

View File

@ -1,8 +1,8 @@
import logging import logging
__author__ = 'Stefan Reimer' __author__ = "Stefan Reimer"
__email__ = 'stefan@zero-downtimet.net' __email__ = "stefan@zero-downtimet.net"
__version__ = '0.5.1' __version__ = "0.5.1"
# Set up logging to ``/dev/null`` like a library is supposed to. # Set up logging to ``/dev/null`` like a library is supposed to.

9
dev-requirements.txt Normal file
View File

@ -0,0 +1,9 @@
boto3
Jinja2
oyaml
click
pyminifier
cfn-lint
flake8
pytest
twine

View File

@ -2,7 +2,5 @@ boto3
Jinja2 Jinja2
oyaml oyaml
click click
pytest
semver
pyminifier pyminifier
cfn-lint cfn-lint

View File

@ -55,7 +55,7 @@ setup(
packages=find_packages(), packages=find_packages(),
include_package_data=True, include_package_data=True,
entry_points={'console_scripts': [ "cloudbender = cloudbender.cli:cli" ]}, 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'], tests_require=["pytest-cov", "moto", "mock", 'pytest'],
cmdclass={"test": PyTest}, cmdclass={"test": PyTest},
classifiers=[ classifiers=[

19
tox.ini
View File

@ -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