Skip to content

Commit

Permalink
chore: add integration with pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
tsunammis committed Dec 6, 2018
1 parent d5e4bb9 commit 259d145
Show file tree
Hide file tree
Showing 11 changed files with 164 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .gitignore
@@ -0,0 +1,6 @@
build/
dist/
tartiflette_aiohttp.egg-info/
__pycache__
.coverage
reports/
36 changes: 36 additions & 0 deletions .travis.yml
@@ -0,0 +1,36 @@
language: python
dist: xenial
sudo: true
python:
- "3.6"
# Activate addons when integration tests will be
# implemented with Tartiflette
# addons:
# apt:
# packages:
# - build-essential
# - clang
# - cmake
# - bison
# - flex
#
# Compliant with Gazr Specification
# https://gazr.io
# https://github.com/dailymotion/gazr
# make style | test-unit | test-functional | init
script:
- make test-unit
- make test-functional
- make style
- make complexity
cache: pip
install:
- make init
- pip install -e .[test]
deploy:
provider: pypi
user: dailymotion
password:
secure: "lvwOKPdsFwO9QWpG5Eu423XiYms4hfP8DMhkH2Ku1ivZcES2NZ0FRYrJ0UyCSx9A1k9xfSYjRDe0KxMTPo4HwJjMhl/3JDO7OrI5NqpJiNVG6NQ8djBc+gwj5epugJ6duXe1MPXaNs3Ppo2EOwoslOJDl711YFaBXZsGfQvQ3Z22LyWVQ/QzWth4IzHkI3E0fOg7sPvI83hlhI0Pzfp5DdX6byoQssr65Hs1HvfEbWS3VgA+xZ1lznXMV0Dwl3o8aY2+FbOM8vUvR9HX9Rfm4t1/vOpuKF/9fciJUsCd42FnRayCjt1HsNKW0+EtkaV++oqzB7Dop0BasCc+MGx66iGFIrrAb8HIuIMwR1lMkJr6r9cbQpR7irkuCmMW3O1g52rLM1ky3vBhTzpodk4E9LQ96M9rVxPSez+nXvp94MNk9P6KdqYmgWCKym/kyrXPQrR0vq6URigtGl54HwzvxZfQaLxIPIbPRGqygS282ewzHIEcPm5cJQB1EZb/ZbK1xju7LNzkL933YE0u5kU93/5h15Q0QWo28umo4dhJWH3g47rSqYjnapJwHrj1+yJpjqR3zalLVJbA/H+VmAiG3vy0oJ10nb8SXsFkcN9KcYC84GVR5cvn3UHnYYhMg2x//t8kmY1J4AU8qKk2xipmN2uEAC9ff2SqwnqMIPEQGh4="
on:
branch: master
43 changes: 43 additions & 0 deletions Makefile
@@ -0,0 +1,43 @@

.PHONY: init
init:
true

.PHONY: format
format:
black -l 79 --py36 tartiflette_aiohttp setup.py

.PHONY: check-format
check-format:
black -l 79 --py36 --check tartiflette_aiohttp setup.py

.PHONY: style
style: check-format
pylint tartiflette_aiohttp --rcfile=pylintrc

.PHONY: complexity
complexity:
xenon --max-absolute B --max-modules B --max-average A tartiflette_aiohttp

.PHONY: test-integration
test-integration: clean
true

.PHONY: test-unit
test-unit: clean
mkdir -p reports
py.test -s tests/unit --junitxml=reports/report_unit_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_func.xml

.PHONY: test-functional
test-functional: clean
mkdir -p reports
py.test -s tests/functional --junitxml=reports/report_func_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_unit.xml

.PHONY: test
test: test-integration test-unit test-functional

.PHONY: clean
clean:
find . -name '*.pyc' -exec rm -fv {} +
find . -name '*.pyo' -exec rm -fv {} +
find . -name '__pycache__' -exec rm -frv {} +
71 changes: 71 additions & 0 deletions pylintrc
@@ -0,0 +1,71 @@
# -*- mode: conf -*-
[GENERAL]
init-hook='import sys; sys.path.append("/usr/src/app")'

[BASIC]
# Good variable names which should always be accepted, separated by a comma
# i,j,k = loop control vars, sq=search query, fn=function/lambda, fh=file handle, ts=timestamp, rx=regular expression
good-names=_,__,___,e,i,j,k,sq,fn,fh,js,ts,rx,logger

## Bad variable names which should always be refused, separated by a comma
# balls/qballs is specific to one of the guys
bad-names=foo,bar,baz,toto,tata,tutu,coucou

class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{1,40}|(__.*__))$
function-rgx=[a-z_][a-z0-9_]{2,50}$
method-rgx=[a-z_][a-z0-9_]{2,50}$

[MESSAGE CONTROL]
# CHANGED:
# C0111: Missing docstring
# E0602: Undefined variable %r
# I0011: Locally disabled messages
# I0012: Locally enabled messages
# R0801: Similar lines in files
# R0903: Too few public methods
# W0141: Bad-builtins
# W0142: Use of * or ** magic
# W0223: Abstract method not overridden
# W0603: Using the global statement
# W1202: Logging with '{}' formating instead of '%'
# C0330: Wrong hanging indentation before block (add 4 spaces).
# "bad-continuation" is currently disabled because of that issue -> https://github.com/PyCQA/pylint/issues/289
disable=C0111,E0602,I0011,I0012,R0801,R0903,W0141,W0142,W0223,W0603,W1202,C0303,C0330,C0301

[DESIGN]
## Maximum number of arguments for function / method
max-args=8

## Maximum number of locals for function / method body
max-locals=10

## Maximum number of return / yield for function / method body
max-returns=10

## Maximum number of branch for function / method body
max-branchs=45

## Maximum number of statements in function / method body
max-statements=100

## Maximum number of public methods for a class (see R0904).
max-public-methods=30

max-attributes=15

[FORMAT]
max-line-length=80

## Maximum number of lines in a module
max-module-lines=1000

# String used as indentation unit. We found that two spaces is the best balance for readability, easy typing, etc.
indent-string=' '

[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma. One of our guys uses qballs when he wants to flag something for himself.
notes=FIXME,NINJA

[TYPECHECK]
# Ignore some modules which don't work well with rapidjons
ignored-modules=rapidjson
7 changes: 2 additions & 5 deletions setup.py
Expand Up @@ -14,7 +14,7 @@
"black==18.9b0",
]

_VERSION = "0.1.0"
_VERSION = "0.1.1"

_PACKAGES = find_packages(exclude=["tests*"])

Expand All @@ -35,10 +35,7 @@
],
keywords="api graphql protocol api rest relay tartiflette dailymotion",
packages=_PACKAGES,
install_requires=[
"aiohttp~=3.4",
"tartiflette~=0.1",
],
install_requires=["aiohttp~=3.4", "tartiflette~=0.1"],
tests_require=_TEST_REQUIRE,
extras_require={"test": _TEST_REQUIRE},
include_package_data=True,
Expand Down
2 changes: 2 additions & 0 deletions tartiflette_aiohttp/__init__.py
@@ -0,0 +1,2 @@
def hello():
return "World"
Empty file added tests/__init__.py
Empty file.
Empty file added tests/functional/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions tests/functional/test_hello.py
@@ -0,0 +1,2 @@
def test_hello():
assert True == True
Empty file added tests/unit/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions tests/unit/test_hello.py
@@ -0,0 +1,2 @@
def test_hello():
assert True == True

0 comments on commit 259d145

Please sign in to comment.