Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ venv.bak/

# mypy
.mypy_cache/

.vscode
.idea
51 changes: 51 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.1
hooks:
- id: check-ast
- id: check-symlinks
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-json
- id: check-yaml
- id: detect-private-key
- id: double-quote-string-fixer
- id: trailing-whitespace
- id: no-commit-to-branch # No (direct) commits to master
- repo: https://github.com/asottile/add-trailing-comma
rev: v1.0.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.18
hooks:
- id: isort
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.6
hooks:
- id: forbid-crlf
files: \.md$
- id: remove-crlf
files: \.md$
- repo: local
hooks:
- id: lint
name: tox lint
entry: tox -e lint
language: system
- id: doclint
name: tox doclint
entry: tox -e doclint
language: system
- id: mypy
name: tox mypy
entry: tox -e mypy
language: system
types: [python]
- id: tests
name: tox tests
entry: tox -e tests
language: system
types: [python, yaml]
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
dist: xenial
env:
global:
- CC_TEST_REPORTER_ID=$TEST_REPORTER_ID
language: python
os:
- linux
python:
- '3.7'
install:
- python -m pip install -U pip setuptools pipenv
- pipenv install --dev
- python -m pip install -e .
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
> ./cc-test-reporter
- chmod +x ./cc-test-reporter
- "./cc-test-reporter before-build"
script:
- tox -e lint
- tox -e isort
- tox -e mypy
- tox -e tests
after_script:
- coverage xml -o coverage.xml
- "./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code $TRAVIS_TEST_RESULT"
deploy:
- provider: script
script: ci-scripts/semantic-release.sh
on:
branch: master
notifications:
slack:
rooms:
- secure: XU8s7FeivT74v46HKBHxCeAx/RA+cbVzufJjAtAVvAcuz1/cCySUjLWJCHzsSjPBoff7BKxPO2Sxlxb+FmgTGKEX48rqJM5ZAR3IrVeDseix64030ANOd3KRvnZYTPvqF9ovtV6d0GhbO/BAc4XNfx47RsG31LLRQcZnaAL2x7J2C1KsvmMG1ckQoYVZJgxQszUZm4NTlGRjiCd2EbZIfdeo33Wm0vPSgHprSe8z0Ov0sk5SLDJRSZh1z6TrchfxmXZLmi19oOB+vkEMJtvyDgxF1x/tT3aMmD/jB9qt7RR+11RigLTVrq5ANKQ10NFE+TsOd8ZwjZ3Ng1Ont2HmdExltNsI0goynx1nKlaHOnDmJ8xOp/XF1k8EsVkyWFCTywjZGIV2nNzC60qd4q719l7gnsV11nnaEc2IrfREV43Hq3C5CfhkLwZCm77ePSW0ckzFN1iucjvh8SCPf75p+WwtegAgNHB+jjHWLEA1R1/kcYwHHL2w4MLPxt5y0DdwMxjGYNWW1Eys7rpK6U1qSqhe6z/3b+YRM+YXekvojEnxz9KU51ZbqxqPplkTeiRmYW+GYiks7MXdOwcSFrTDcttEJY/xd9zN71rWNzTmAfzTJgSI51JJpq13uJuUJzTqTXpT7lI5nDjnl2dUZyrQzdUyqzbIoqttFW2TOT8hzKY=
on_success: always # change: send a notification when the build status changes.
on_failure: always # always: always send a notification.
template:
- "Repo `%{repository_slug}` *%{result}* build (<%{build_url}|#%{build_number}>) for commit (<%{compare_url}|%{commit}>) on branch `%{branch}`."
- "Execution time: *%{duration}*"
- "Message: %{message}"
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include README.md
include CHANGELOG.md
recursive-exclude tests *
99 changes: 99 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
.PHONY: help clean clean-pyc clean-build list test test-dbg test-cov test-all coverage docs release sdist install install-dev install-ci lint mypy isort isort-check

project-name = pycon_schemas

version-var := "__version__ = "
version-string := $(shell grep $(version-var) $(project-name)/version.py)
version := $(subst __version__ = ,,$(version-string))

help:
@echo "install - install"
@echo "install-dev - install also development dependencies"
@echo "clean - clean all below"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-tox - clean tox cache"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test-cov - run tests with the default Python and report coverage"
@echo "test-dbg - run tests and debug with pdb"
@echo "develop - run tests in loop mode"
@echo "deploy - deploy"
@echo "mypy - check type hinting with mypy"
@echo "isort - sort imports"
@echo "isort-check - check if your imports are correctly sorted"
@echo "build - create the distribution package"
@echo "release - package a release in wheel and tarball, requires twine"

install:
python -m pip install pipenv
pipenv install
python -m pip install .

install-ci:
python -m pip install pipenv
pipenv install --dev
python -m pip install -e .

install-dev: install-ci
pre-commit install

clean: clean-build clean-pyc clean-caches

clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -fr *.egg-info
rm -fr *.spec

clean-pyc:
pyclean $(project-name)
find . -name '*~' -exec rm -f {} +
find . -name __pycache__ -exec rm -rf {} +
find . -name '*.log*' -delete
find . -name '*_cache' -exec rm -rf {} +
find . -name '*.egg-info' -exec rm -rf {} +

clean-caches:
rm -rf .tox
rm -rf .pytest_cache

testloop:
pytest --color=yes -s -f $(project-name)

lint:
tox -e lint

test:
tox -e tests

mypy:
tox -e mypy

isort-check:
tox -e isort

isort:
isort -rc $(project-name)

test-cov:
py.test --cov-report term-missing --cov=$(project-name)

test-dbg:
py.test --pdb

develop:
py.test --color=yes -f

coverage:
pytest --cov=hansel
coverage report -m

build:
python setup.py sdist bdist_wheel

pypi:
twine upload dist/*

release: clean build pypi
30 changes: 30 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
jsonschema = "==3.1.1"

[dev-packages]
flake8 = "*"
flake8-bugbear = "*"
autopep8 = "*"
pre-commit = "*"
pytest = "*"
pytest-cov = "*"
pytest-xdist = "*"
pytest-only = "*"
watchdog = "*"
mypy = "*"
isort = "*"
tox = ">=3.13.2"
coverage = "*"
wily = "*"
jsonschema = "==3.0.2"
pyclean-py = "*"
pytest-mock = "*"
rope = "*"
twine = "*"
pydocstyle = "*"
tox-pipenv-install = "*"
Loading