Skip to content

Commit

Permalink
Major cleanup
Browse files Browse the repository at this point in the history
Changes done:
- python3 compatible
- black autoformat
- isort import order
- pipenv for dependency management
- migrate from deprecated travis-ci.org to circleci
  • Loading branch information
mhemeryck committed Mar 15, 2019
1 parent ea2b094 commit f6b7a61
Show file tree
Hide file tree
Showing 22 changed files with 1,022 additions and 574 deletions.
74 changes: 74 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
version: 2
references:
restore_caches: &restore_caches
restore_cache:
keys:
- source-{{ .Branch }}
- deps-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
install_deps: &install_deps
run:
name: Install dependencies
command: |
pipenv install --dev --ignore-pipfile --deploy
jobs:
build:
docker:
- image: circleci/python:3.7.2

steps:
- checkout
- *restore_caches
- *install_deps
- save_cache:
key: source-{{ .Branch }}
paths:
- ".git"
- save_cache:
key: deps-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
paths:
- "/home/circleci/.local/share/virtualenvs/"
lint:
docker:
- image: circleci/python:3.7.2

steps:
- checkout
- *restore_caches
- *install_deps
- run:
name: Black autoformat check
command: |
pipenv run black --check .
- run:
name: Isort import order check
command: |
pipenv run isort -c
test:
docker:
- image: circleci/python:3.7.2

steps:
- checkout
- *restore_caches
- *install_deps
- run:
name: Unit tests
command: |
pipenv run py.test
- run:
name: Coverage upload
command: |
pipenv run coveralls
workflows:
version: 2
build_test:
jobs:
- build
- lint:
requires:
- build
- test:
requires:
- build
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[run]
branch = True

[report]
fail_under = 100
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 88
select = C,E,F,W,B,B950
ignore = E501,E203
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[settings]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
combine_as_imports=True
line_length=88
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Martijn Hemeryck
Copyright (c) 2019 Martijn Hemeryck

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 18 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pytest = "*"
black = "==18.9b0"
pytest-cov = "*"
isort = "*"
coveralls = "*"

[packages]
factory-boy = "*"
pytest-socket = "*"

[requires]
python_version = "3.7"
Loading

0 comments on commit f6b7a61

Please sign in to comment.