Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shosca committed May 5, 2018
0 parents commit 695abf4
Show file tree
Hide file tree
Showing 104 changed files with 7,095 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf

[LICENSE]
insert_final_newline = false

[Makefile]
indent_style = tab
47 changes: 47 additions & 0 deletions .gitchangelog.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Ignore commits
ignore_regexps = [
r"@minor",
r"!minor",
r"@cosmetic",
r"!cosmetic",
r"@refactor",
r"!refactor",
r"@wip",
r"!wip",
r"^Merge commit .* into HEAD",
r"^Version bump*",
r"^Docs: update*",
r"^Bump version*",
r"^Update history*",
r"^Initial commit* into HEAD",
]

# Detect sections
section_regexps = [
("New features", [r"^[fF]eat.*:\s*?([^\n]*)$"]),
("Fix", [r"^[fF]ix:\s*?([^\n]*)$"]),
("Refactor", [r"^[rR]efactor:\s*?([^\n]*)$"]),
("Documentation", [r"^[dD]oc.*:\s*?([^\n]*)$"]),
("Other", None), ## Match all lines
]

# Rewrite body
body_process = (ReSub(r".*", "") | ReSub(r"^(\n|\r)$", ""))

# Rewrite subject
subject_process = (
strip
| ReSub(r"^(\w+)\s*:\s*([^\n@]*)(@[a-z]+\s+)*$", r"\2")
| ReSub(r"^\*\*: ", "")
| ReSub(r"\) \(", " ")
| strip
| ucfirst
| final_dot
)

tag_filter_regexp = r"^[0-9]+\.[0-9]+(\.[0-9]+)?$"

unreleased_version_label = "Next version (unreleased yet)"

output_engine = rest_py
include_merges = False
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
*.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
.eggs
.cache

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml
htmlcov

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Complexity
output/*.html
output/*/index.html

# Sphinx
docs/_build

# IDEs
/.idea
.venv
.pytest_cache
db.sqlite3
13 changes: 13 additions & 0 deletions .importanizerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"add_imports": [
"from __future__ import absolute_import, print_function, unicode_literals"
],
"groups": [
{"type": "stdlib"},
{"type": "remainder"},
{"type": "packages", "packages": ["sqlalchemy"]},
{"type": "packages", "packages": ["django"]},
{"type": "packages", "packages": ["django_sorcery"]},
{"type": "local"}
]
}
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: 'master'
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: fix-encoding-pragma
- id: flake8
- id: trailing-whitespace

- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
args: [--line-length=120, --safe]
python_version: python3.6
138 changes: 138 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
[style]
based_on_style = pep8

# Allow splits before the dictionary value
ALLOW_SPLIT_BEFORE_DICT_VALUE=False

ALIGN_CLOSING_BRACKET_WITH_VISUAL_INDENT=True
# Align closing bracket with visual indentation

ALLOW_MULTILINE_LAMBDAS=False
# Allow lambdas to be formatted on more than one line

BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=True
# Insert a blank line before a 'def' or 'class' immediately nested
# within another 'def' or 'class'. For example:
#
# class Foo:
# # <------ this blank line
# def method():
# ...

COLUMN_LIMIT=120
# The column limit.

DEDENT_CLOSING_BRACKETS=True
# Put closing brackets on a separate line, dedented, if the bracketed
# expression can't fit in a single line. Applies to all kinds of brackets,
# including function definitions and calls. For example:
#
# config = {
# 'key1': 'value1',
# 'key2': 'value2',
# } # <--- this bracket is dedented and on a separate line
#
# time_series = self.remote_client.query_entity_counters(
# entity='dev3246.region1',
# key='dns.query_latency_tcp',
# transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
# start_ts=now()-timedelta(days=3),
# end_ts=now(),
# ) # <--- this bracket is dedented and on a separate line

I18N_COMMENT=
# The regex for an i18n comment. The presence of this comment stops
# reformatting of that line, because the comments are required to be
# next to the string they translate.

I18N_FUNCTION_CALL=
# The i18n function call names. The presence of this function stops
# reformattting on that line, because the string it has cannot be moved
# away from the i18n comment.

INDENT_DICTIONARY_VALUE=False
# Indent the dictionary value if it cannot fit on the same line as the
# dictionary key. For example:
#
# config = {
# 'key1':
# 'value1',
# 'key2': value1 +
# value2,
# }

EACH_DICT_ENTRY_ON_SEPARATE_LINE=True

INDENT_WIDTH=4
# The number of columns to use for indentation.

JOIN_MULTIPLE_LINES=True
# Join short lines into one line. E.g., single line 'if' statements.

SPACES_AROUND_POWER_OPERATOR=False
# Use spaces around the power operator.

SPACES_BEFORE_COMMENT=2
# The number of spaces required before a trailing comment.

SPACE_BETWEEN_ENDING_COMMA_AND_CLOSING_BRACKET=True
# Insert a space between the ending comma and closing bracket of a list,
# etc.

SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED=False
# Split before arguments if the argument list is terminated by a
# comma.

SPLIT_BEFORE_BITWISE_OPERATOR=False
# Set to True to prefer splitting before '&', '|' or '^' rather than
# after.

SPLIT_BEFORE_FIRST_ARGUMENT=False
# If an argument / parameter list is going to be split, then split before
# the first argument.

SPLIT_BEFORE_LOGICAL_OPERATOR = True
# Set to True to prefer splitting before 'and' or 'or' rather than
# after.

SPLIT_BEFORE_NAMED_ASSIGNS=False
# Split named assignments onto individual lines.

SPLIT_PENALTY_AFTER_OPENING_BRACKET=30
# The penalty for splitting right after the opening bracket.

SPLIT_PENALTY_AFTER_UNARY_OPERATOR=10000
# The penalty for splitting the line after a unary operator.

SPLIT_PENALTY_BEFORE_IF_EXPR=0
# The penalty for splitting right before an if expression.

SPLIT_PENALTY_BITWISE_OPERATOR=300
# The penalty of splitting the line around the '&', '|', and '^'
# operators.

SPLIT_PENALTY_EXCESS_CHARACTER=2600
# The penalty for characters over the column limit.

SPLIT_PENALTY_FOR_ADDED_LINE_SPLIT=30
# The penalty incurred by adding a line split to the unwrapped line. The
# more line splits added the higher the penalty.

SPLIT_PENALTY_IMPORT_NAMES=0
# The penalty of splitting a list of "import as" names. For example:
#
# from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
# long_argument_2,
# long_argument_3)
#
# would reformat to something like:
#
# from a_very_long_or_indented_module_name_yada_yad import (
# long_argument_1, long_argument_2, long_argument_3)

SPLIT_PENALTY_LOGICAL_OPERATOR=300
# The penalty of splitting the line around the 'and' and 'or'
# operators.

USE_TABS=False
# Use the Tab character for indentation.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
language: python
python:
- "2.7"
- "3.6"

install:
- pip install pipenv coveralls sqlalchemy_utils
- pipenv install -d --system --skip-lock

script:
- make coverage

after_success:
coveralls
5 changes: 5 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Credits
-------

* Serkan Hosca - https://github.com/shosca
* Miroslav Shubernetskiy - https://github.com/miki725
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Changelog
=========


0.1.0 (2018-05-05)
------------------
- Initial commit. [Serkan Hosca]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Serkan Hosca

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include *.rst *.txt
recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Loading

0 comments on commit 695abf4

Please sign in to comment.