Skip to content

Commit

Permalink
Circle ci (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
tammoippen authored Jan 24, 2019
1 parent 0774b67 commit b74f0fc
Show file tree
Hide file tree
Showing 9 changed files with 289 additions and 71 deletions.
265 changes: 265 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
version: 2.1

commands:
tester:
description: "Test geohash-hilbert given a certain python version."
steps:
- checkout

- run:
name: Set PATH.
command: |
echo 'export PATH=$HOME/.local/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- restore_cache:
key: v1-geohash-hilbert-{{ .Environment.CIRCLE_STAGE }}-{{ checksum "pyproject.toml" }}-{{ checksum "setup.cfg" }}

- run:
name: Pre-install
command: |
pip install --user poetry virtualenv
virtualenv venv
- run:
name: Install
command: |
. venv/bin/activate
poetry install
if [ $WITH_CYTHON -eq 1 ]; then
pip install cython
cythonize -i geohash_hilbert/*.pyx
fi
poetry show
python -c 'import geohash_hilbert as ghh; print(ghh._hilbert.CYTHON_AVAILABLE)'
- save_cache:
key: v1-geohash-hilbert-{{ .Environment.CIRCLE_STAGE }}-{{ checksum "pyproject.toml" }}-{{ checksum "setup.cfg" }}
paths:
- ~/app/venv
- ~/app/poetry.lock

- store_artifacts:
path: ~/app/poetry.lock
destination: poetry.lock

- run:
name: Style
command: |
. venv/bin/activate
poetry run flake8
- run:
name: Test
command: |
. venv/bin/activate
poetry run pytest
- run:
name: Build sdist
command: poetry build -vvv -f sdist

- store_artifacts:
path: ~/app/dist
destination: dist

- store_artifacts:
path: ~/app/cov_html
destination: cov_html

- run:
name: Coverage
command: |
. venv/bin/activate
poetry run coveralls
executors:
python:
working_directory: ~/app
parameters:
image:
type: string
with_cython:
type: integer
environment:
WITH_CYTHON: << parameters.with_cython >>
docker:
- image: << parameters.image >>

jobs:
test_2_7:
executor:
name: python
image: "circleci/python:2.7.15"
with_cython: 0
steps:
- tester
test_2_7_cython:
executor:
name: python
image: "circleci/python:2.7.15"
with_cython: 1
steps:
- tester
test_2_7_pypy:
executor:
name: python
image: "pypy:2-6.0.0"
with_cython: 0
steps:
- tester
test_2_7_pypy_cython:
executor:
name: python
image: "pypy:2-6.0.0"
with_cython: 1
steps:
- tester
test_3_5:
executor:
name: python
image: "circleci/python:3.5.6"
with_cython: 0
steps:
- tester
test_3_5_cython:
executor:
name: python
image: "circleci/python:3.5.6"
with_cython: 1
steps:
- tester
test_3_5_pypy:
executor:
name: python
image: "pypy:3-6.0.0"
with_cython: 0
steps:
- tester
test_3_5_pypy_cython:
executor:
name: python
image: "pypy:3-6.0.0"
with_cython: 1
steps:
- tester
test_3_6:
executor:
name: python
image: "circleci/python:3.6.8"
with_cython: 0
steps:
- tester
test_3_6_cython:
executor:
name: python
image: "circleci/python:3.6.8"
with_cython: 1
steps:
- tester
test_3_7:
executor:
name: python
image: "circleci/python:3.7.2"
with_cython: 0
steps:
- tester
test_3_7_cython:
executor:
name: python
image: "circleci/python:3.7.2"
with_cython: 1
steps:
- tester

deploy_job:
docker:
- image: circleci/python:3.6.8
description: "Deploy geohash-hilbert to pypi."
steps:
- checkout

- run:
name: Set PATH.
command: |
echo 'export PATH=$HOME/.local/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- run:
name: Pre-install
command: |
pip install --user poetry
poetry build -vvv -f sdist
poetry publish -vvv -n -u tammoippen -p $PYPI_PASS
workflows:
version: 2.1
test_and_deploy:
jobs:
- test_2_7:
filters:
tags:
only: /.*/
- test_2_7_cython:
filters:
tags:
only: /.*/
- test_2_7_pypy:
filters:
tags:
only: /.*/
- test_2_7_pypy_cython:
filters:
tags:
only: /.*/
- test_3_5:
filters:
tags:
only: /.*/
- test_3_5_cython:
filters:
tags:
only: /.*/
- test_3_5_pypy:
filters:
tags:
only: /.*/
- test_3_5_pypy_cython:
filters:
tags:
only: /.*/
- test_3_6:
filters:
tags:
only: /.*/
- test_3_6_cython:
filters:
tags:
only: /.*/
- test_3_7:
filters:
tags:
only: /.*/
- test_3_7_cython:
filters:
tags:
only: /.*/
- deploy_job:
requires:
- test_2_7
- test_2_7_cython
- test_2_7_pypy
- test_2_7_pypy_cython
- test_3_5
- test_3_5_cython
- test_3_5_pypy
- test_3_5_pypy_cython
- test_3_6
- test_3_6_cython
- test_3_7
- test_3_7_cython
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*/
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ pyproject.lock
poetry.lock
.hypothesis/
.vscode/
pip-wheel-metadata/
.benchmarks/
57 changes: 0 additions & 57 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
geohash-hilbert
===============

[![Build Status](https://travis-ci.org/tammoippen/geohash-hilbert.svg?branch=master)](https://travis-ci.org/tammoippen/geohash-hilbert)
[![CircleCI](https://circleci.com/gh/tammoippen/geohash-hilbert.svg?style=svg)](https://circleci.com/gh/tammoippen/geohash-hilbert)
[![Coverage Status](https://coveralls.io/repos/github/tammoippen/geohash-hilbert/badge.svg?branch=master)](https://coveralls.io/github/tammoippen/geohash-hilbert?branch=master)
[![Tested CPython Versions](https://img.shields.io/badge/cpython-2.7%2C%203.5%2C%203.6%2C%20nightly-brightgreen.svg)](https://img.shields.io/badge/cpython-2.7%2C%203.5%2C%203.6%2C%20nightly-brightgreen.svg)
[![Tested PyPy Versions](https://img.shields.io/badge/pypy-2.7%2C%203.5-brightgreen.svg)](https://img.shields.io/badge/pypy-2.7%2C%203.5-brightgreen.svg)
[![Tested CPython Versions](https://img.shields.io/badge/cpython-2.7%2C%203.5%2C%203.6%2C%203.7-brightgreen.svg)](https://img.shields.io/badge/cpython-2.7%2C%203.5%2C%203.6%2C%203.7-brightgreen.svg)
[![Tested PyPy Versions](https://img.shields.io/badge/pypy-2.7--6.0.0%2C%203.5--6.0.0-brightgreen.svg)](https://img.shields.io/badge/pypy-2.7--6.0.0%2C%203.5--6.0.0-brightgreen.svg)
[![PyPi version](https://img.shields.io/pypi/v/geohash-hilbert.svg)](https://pypi.python.org/pypi/geohash-hilbert)
[![PyPi license](https://img.shields.io/pypi/l/geohash-hilbert.svg)](https://pypi.python.org/pypi/geohash-hilbert)

Expand Down
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

[tool.poetry]

name = "geohash-hilbert"
version = "1.3.0"
version = "1.3.1"
description = "Geohash a lng/lat coordinate using the hilbert curve."
authors = ["Tammo Ippen <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -41,7 +37,9 @@ python = "~2.7 || ^3.5"

[tool.poetry.dev-dependencies]

coveralls = "^1.5.1"
flake8 = "^3.5.0"
flake8-bugbear = { version = "^18.8.0", python = "^3.5" }
flake8-commas = "^2.0.0"
flake8-comprehensions = "^1.4.1"
flake8-import-order = "^0.18"
Expand All @@ -55,5 +53,8 @@ pytest-cov = "^2.5.1"
pytest-flake8 = "^1.0.2"
pytest-mccabe = "^0.1"
pytest-pythonpath = "^0.7.3"
python-coveralls = "^2.9.1"
six = "^1.11.0"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
8 changes: 6 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
[flake8]
application_import_names = geohash_hilbert
max-line-length = 159
max-complexity = 10
import-order-style = google
exclude =
.venv/
venv/

[tool:pytest]
python_paths = .
addopts = --cov=geohash_hilbert --cov-report=term-missing --flake8 --mccabe -v
addopts = --cov=geohash_hilbert --cov-report term-missing --cov-report html:cov_html --mccabe -v

[bdist_wheel]
universal = 0

[metadata]
description-file = README.md
license_file = LICENSE.txt
description-file = README.md
Loading

0 comments on commit b74f0fc

Please sign in to comment.