Skip to content

Commit

Permalink
Merge pull request #115 from Bladrak/auto_publish
Browse files Browse the repository at this point in the history
Automate package publish through CI
  • Loading branch information
Bladrak authored Apr 26, 2018
2 parents 8909eda + 437d313 commit bc72fe2
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,33 @@ jobs:
steps:
- checkout
- run: make test
deploy:
docker:
- image: bladrak/thumbor-dev:latest
steps:
- checkout
- run:
name: init .pypirc
command: |
echo -e "[pypi]" >> ~/.pypirc
echo -e "username = $PYPI_USERNAME" >> ~/.pypirc
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
- run: make install
- run: make publish

workflows:
version: 2
build_and_deploy:
jobs:
- build:
filters:
tags:
only: /.*/
- deploy:
requires:
- build
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ reinstall:
pip install . --quiet

setup:
@pip install -e .[tests] --quiet
pip install -e .[tests]

setup_docs:
@pip install -r docs/requirements.txt
pip install -r docs/requirements.txt

build_docs:
@cd docs && make html
cd docs && make html

docs: setup_docs build_docs
python -mwebbrowser file:///`pwd`/docs/_build/html/index.html

test: setup
@pyvows -c -l tc_aws
pyvows -c -l tc_aws

publish:
python setup.py register -r pypi
python setup.py sdist upload -r pypi
python setup.py bdist_wheel upload -r pypi
39 changes: 37 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,51 @@
# coding: utf-8

import os
import sys
import re

from setuptools import setup, find_packages
from setuptools.command.install import install

def version():
"""retrieve version from tag name"""
tag = os.getenv('CIRCLE_TAG', '1')

if re.match('\d+(\.\d+)*', tag):
return tag

info = "Git tag: {0} does not match the version pattern of this app".format(
tag
)
sys.exit(info)

def readme():
"""print long description"""
with open('Readme.md') as f:
return f.read()

setup(
name='tc_aws',
version='6.2.3',
version=version(),
description='Thumbor AWS extensions',
long_description=readme(),
author='Thumbor-Community & William King',
author_email='willtrking@gmail.com',
author_email='h.briand@gmail.com', # Original author email is: willtrking@gmail.com
zip_safe=False,
include_package_data=True,
packages=find_packages(),
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Internet",
"Topic :: Image Processing",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
],
keywords='thumbor aws',
install_requires=[
'python-dateutil',
'thumbor>=6.0.0,<7',
Expand Down

0 comments on commit bc72fe2

Please sign in to comment.