Skip to content

Commit

Permalink
Merge e38a450 into 2a8e9bf
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed Sep 11, 2020
2 parents 2a8e9bf + e38a450 commit 926bf84
Show file tree
Hide file tree
Showing 246 changed files with 8,357 additions and 1,153 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ docs/build/
/setup.py
.dephell_report/
.mypy_cache/
.pytype/
.pytest_cache/
/tmp.py
.hypothesis/
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ before_install:
- env
- tree
# install DepHell
# https://github.com/travis-ci/travis-ci/issues/8589
- curl https://raw.githubusercontent.com/dephell/dephell/master/install.py | /opt/python/3.7/bin/python
- curl -L dephell.org/install > install.py
- /opt/python/3.7.1/bin/python install.py --branch=master
- dephell inspect self
install:
- dephell venv create --env=$ENV --python="/opt/python/$TRAVIS_PYTHON_VERSION/bin/python"
Expand All @@ -30,18 +30,18 @@ script:
env: ENV=pytest
python:
- "3.6.7"
- "3.7"
- "3.7.1"
- "3.8"

# run flake8
matrix:
include:
- python: "3.7"
- python: "3.7.1"
env: ENV=flake8
script:
- dephell venv run --env=$ENV

- python: "3.7"
- python: "3.7.1"
env: ENV=typing
script:
- dephell venv run --env=$ENV
36 changes: 13 additions & 23 deletions deal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
"""
**Deal** -- python library for design by contract (DbC) programming.
https://en.wikipedia.org/wiki/Design_by_contract
This library contain 3 main conception from DbC:
* Precondition -- condition that must be true before function is executed.
* Postcondition -- condition that must be true after function executed.
* Invariant -- condition that can be relied upon to be true during execution
of a program. In this library invariant condition check in 3 cases:
1. Before class method execution.
2. After class method execution.
3. After some class attribute setting.
**Deal** is a Python library for [design by contract][wiki] (DbC) programming.
See [documentation][docs] for more details.
[wiki]: https://en.wikipedia.org/wiki/Design_by_contract
[docs]: https://deal.readthedocs.io/index.html
"""

# main package info
Expand All @@ -21,40 +14,37 @@


# app
from ._aliases import (
chain, ensure, inv, invariant, offline, post,
pre, pure, raises, reason, require, safe, silent,
)
from ._aliases import chain, ensure, has, inv, post, pre, pure, raises, reason, safe
from ._exceptions import * # noQA
from ._imports import activate, module_load
from ._schemes import Scheme
from ._state import reset, switch
from ._state import disable, enable, reset
from ._testing import TestCase, cases


__all__ = [
'cases',
'reset',
'Scheme',
'switch',
'TestCase',

# state
'disable',
'enable',
'reset',

# decorators
'chain',
'ensure',
'has',
'inv',
'offline',
'post',
'pre',
'raises',
'reason',
'safe',
'silent',

# aliases
'invariant',
'pure',
'require',

# module level
'module_load',
Expand Down

0 comments on commit 926bf84

Please sign in to comment.