Skip to content

Commit

Permalink
Let travis take care of releases on pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-k committed Aug 29, 2018
1 parent 04c9bc2 commit 2dfacbd
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 22 deletions.
69 changes: 48 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,59 @@
language: python
sudo: false
python:
- "3.4"
- "3.5"
- "3.6"
matrix:
- "3.6"
- "3.5"
- "3.4"

install:
- pip install -U pip wheel setuptools
- pip install coveralls
- pip install -r requirements/dev.txt
- pip install -r doc/requirements.txt
script:
- pytest --cov-report term-missing --cov=rohrpost tests
- cd doc && make html
after_success:
- coveralls

stages:
- lint
- test
- name: release
if: branch = master

jobs:
include:
- python: "3.7"
dist: xenial
sudo: required
- python: "3.7"

- stage: lint
python: "3.7"
dist: xenial
sudo: required
install: pip install black==18.6b4
script: black --check --verbose rohrpost
install: pip install -r requirements/dev.txt
script:
- pylava .
- isort -rc -c .
- black --check --verbose rohrpost
after_success: true
install:
- pip install -U pip wheel setuptools
- pip install coveralls
- pip install -r requirements/dev.txt
- pip install -r doc/requirements.txt
script:
- pylava .
- isort -rc -c .
- pytest --cov-report term-missing --cov=rohrpost tests
- cd doc && make html
after_success:
- coveralls

- stage: release
script: skip
before_deploy: ./check_version.sh
deploy:
provider: pypi
user: axsemantics
on:
repo: axsemantics/rohrpost
branch: master
tags: true
python: 3.6
distributions: sdist bdist_wheel
password:
secure: LzdFj1FLt6I1C9/ZmGZgkSkitAb3SwZMeygTaiapsEacLiPSLdvVe8Cw6pERKqy2uh3lNi6GaTwAvPKFK4dKzNyG8xzMNW9MheD7joyHlhTy9XLCV8FXQdXUQYK/zIAkLKHVxfcZYo3eeT/LL25rXuJYT2vVwIEVrYX2WfoDQAGH3f/VK5fUmW1uC3Voz1ey48WfruZYQv3NDy4rXRgopNvl3AIbAhpCj7RvWFdp28ABDiUlUzlJx7PWizg2bN8kPdSDxdIDFvrKqLgpv+ni9PQ2MPs+v8gI1wChBXFbVIsrCSZ6xZBKECGWvBVpQiUte1MoJDvxPOg3jPb5kMX2vqSoo22Uf542Owr+VZlfAEkc5oY7mSeEPFk7j3uQzS8cVOlGi5zzJfs1zr2r0YxlkOnvTde3gkmCgefJMUMLZPew3c5x7ecEFs41y7EYmnoeTWCx1N6vC17rC0RKqbSJT9002Ex2LqZ8tgxrORJ4fCajFMGF61mtGBAjc2yXDWBp2/HA8IfSZ3mkJf8rzXZz68VvIaPQylqvbXXusuikYpYZEgX3DTPDbpYx2kB7svAbzAloQvylbE98TAcx1m1KYS2YganlIs4BcAwTXgyMsCfbe5kzEDnr8XC1lbE/dilY+CXeLgN19fWCNTJt3goQATYba5X6PFl3JLZdYR9IJWs=

cache:
directories:
- $HOME/.cache/pip
directories:
- $HOME/.cache/pip
8 changes: 8 additions & 0 deletions check_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

VERSION="$(grep -oP -m1 "__version__\s=\s['\"]\K[^'\"]+" rohrpost/__init__.py)"

if [ "${TRAVIS_TAG}" != "v${VERSION}" ]; then
echo "Tag (${TRAVIS_TAG}) and version (${VERSION}) do not match."
exit 1
fi
1 change: 1 addition & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
black==18.6b4
isort==4.3.*
pylava==0.1.*
pytest==3.7.*
Expand Down
2 changes: 2 additions & 0 deletions rohrpost/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__version__ = '0.0.1'
VERSION = __version__
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from setuptools import setup
from rohrpost import __version__

setup(
name = 'rohrpost',
version = '0.0.0',
version = __version__,

description = 'rohrpost WebSocket protocol for ASGI',

Expand Down

0 comments on commit 2dfacbd

Please sign in to comment.