Skip to content

Commit

Permalink
Karapace: Initial commit to get things started
Browse files Browse the repository at this point in the history
Karapace is an aiohttp based daemon written in Python 3.6
that allows you initially to store and retrieve schemas.

Also schema compatibility testing support for the modes
BACKWARD, FULL and FORWARD compatibility exist, though
could surely be more comprehensive.

There's a fairly extensive set of unittests for the project
but there are sure to be issues that remain so we'll need
even more of them in the future.

The initial release is roughly ~2.5k LOC in all.
  • Loading branch information
Ormod authored and saaros committed Jan 16, 2019
0 parents commit 20f9868
Show file tree
Hide file tree
Showing 31 changed files with 3,748 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .flake8
@@ -0,0 +1,8 @@
[flake8]
max-line-length = 125

# Style issues are handled by yapf formatting
ignore =
E126, # continuation line over-indented for hanging indent
W503, # line break before binary operator
E251, # unexpected spaces around keyword / parameter equals
16 changes: 16 additions & 0 deletions .gitignore
@@ -0,0 +1,16 @@
*.pyc
*.pyo
*~
/.cache
/.coverage
/.project
/.pydevproject
/.pytest_cache/
__pycache__/
/build/
/dist/
/karapace.egg-info/
/karapace-rpm-src.tar
/rpm/
/kafka_*.tgz
/kafka_*/
27 changes: 27 additions & 0 deletions .pylintrc
@@ -0,0 +1,27 @@
[MASTER]
jobs=4

[MESSAGES CONTROL]
disable=
bad-continuation,
fixme,
invalid-name,
missing-docstring,
too-few-public-methods,
too-many-arguments,
too-many-branches,
too-many-instance-attributes,
too-many-locals,
too-many-nested-blocks,
too-many-public-methods,
too-many-statements,
too-public-methods,
wrong-import-order,

[FORMAT]
max-line-length=125

[REPORTS]
output-format=text
reports=no
score=no
55 changes: 55 additions & 0 deletions .style.yapf
@@ -0,0 +1,55 @@
[style]
# For docs, see https://github.com/google/yapf/blob/master/README.rst

based_on_style = pep8
# Disallow splitting between dict key and dict value in multiline {"key": "value"} lines
ALLOW_SPLIT_BEFORE_DICT_VALUE = false

# Avoid adding unnecessary blank lines when nesting
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = false

# Always add two blank lines for top-level classes and methods
BLANK_LINES_AROUND_TOP_LEVEL_DEFINITION = 2

# These two combine consecutive ({ and }) to same line to reduce clutter
COALESCE_BRACKETS = true
DEDENT_CLOSING_BRACKETS = true

# Line length
COLUMN_LIMIT = 125

# Try to avoid having overly long lines by having excessively large penalty for that.
SPLIT_PENALTY_EXCESS_CHARACTER = 1000000000

# Always split dict entries to one entry per line
# EACH_DICT_ENTRY_ON_SEPARATE_LINE = true

# Never split this comment to a separate line. Workaround for certain flake8 & email template lines
I18N_COMMENT = # noqa

# Allow automatically joining lines, for example, multiline if that would fit to a single line
JOIN_MULTIPLE_LINES = true

# "3 * 5", instead of "3*5"
SPACES_AROUND_POWER_OPERATOR = true

# Follow normal comment style by adding two spaces between code and comment
SPACES_BEFORE_COMMENT = 2

# If list of items is comma terminated, always split to one per line.
SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED = true

# Related to previous one, if list of items (args or dict/list/...) needs to be split, split to one per line.
# SPLIT_ALL_COMMA_SEPARATED_VALUES = true

# Split dict generators for clarity (add line breaks between { and key: val etc.
SPLIT_BEFORE_DICT_SET_GENERATOR = true

# Split method(k1=v1, k2=v2...) to separate lines
SPLIT_BEFORE_NAMED_ASSIGNS = true

# For complex (for some definition of complex) comprehensions, put output, for and if to separate lines
SPLIT_COMPLEX_COMPREHENSION = true

# When splitting something to multiple lines ('method(\n val...'), intend by 4
CONTINUATION_INDENT_WIDTH = 4
20 changes: 20 additions & 0 deletions .travis.yml
@@ -0,0 +1,20 @@
language: python

python:
- "3.5"
- "3.6"

# TODO: remove these overrides once default dist supports python 3.7
matrix:
include:
- python: 3.7
dist: xenial
sudo: true

install:
- "pip install astroid==2.0.0 flake8 pylint pytest isort yapf requests kafka-python aiohttp avro-python3 aiosocksy"

script:
- "make pylint"
- "make flake8"
- "make unittest"

0 comments on commit 20f9868

Please sign in to comment.