Skip to content

Commit

Permalink
Upgrades from template
Browse files Browse the repository at this point in the history
- add doctest
- add pypy3 tests
- readme improvements
- deployment standardization
  • Loading branch information
carver committed Mar 23, 2018
2 parents bca0d4a + 588b1af commit 1a77e30
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .circleci/config.yml
Expand Up @@ -24,6 +24,12 @@ common: &common
key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}

jobs:
doctest:
<<: *common
docker:
- image: circleci/python:3.5
environment:
TOXENV: doctest
lint:
<<: *common
docker:
Expand All @@ -42,10 +48,18 @@ jobs:
- image: circleci/python:3.6
environment:
TOXENV: py36-core
pypy3-core:
<<: *common
docker:
- image: pypy
environment:
TOXENV: pypy3-core
workflows:
version: 2
test:
jobs:
- doctest
- lint
- py35-core
- py36-core
- pypy3-core
9 changes: 9 additions & 0 deletions .travis.yml
Expand Up @@ -9,6 +9,9 @@ matrix:
# lint
- python: "3.5"
env: TOX_POSARGS="-e lint"
# doctest
- python: "3.5"
env: TOX_POSARGS="-e doctest"
# core
- python: "3.5"
env: TOX_POSARGS="-e py35-core"
Expand All @@ -18,6 +21,12 @@ matrix:
# core
- python: "3.6"
env: TOX_POSARGS="-e py36-core"
#
# pypy3 testing
#
# core
- python: "pypy3.5"
env: TOX_POSARGS="-e pypy3-core"
cache:
- pip: true
install:
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -38,6 +38,7 @@ build-docs:
sphinx-apidoc -o docs/ . setup.py "*conftest*"
$(MAKE) -C docs clean
$(MAKE) -C docs html
$(MAKE) -C docs doctest

docs: build-docs
open docs/_build/html/index.html
Expand All @@ -49,7 +50,7 @@ release: clean
CURRENT_SIGN_SETTING=$(git config commit.gpgSign)
git config commit.gpgSign true
bumpversion $(bump)
git push && git push --tags
git push upstream && git push upstream --tags
python setup.py sdist bdist_wheel upload
git config commit.gpgSign "$(CURRENT_SIGN_SETTING)"

Expand Down
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -3,13 +3,16 @@
[![Join the chat at https://gitter.im/ethereum/eth-account](https://badges.gitter.im/ethereum/eth-account.svg)](https://gitter.im/ethereum/eth-account?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Build Status](https://travis-ci.org/ethereum/eth-account.png)](https://travis-ci.org/ethereum/eth-account)
[![PyPI version](https://badge.fury.io/py/eth-account.svg)](https://badge.fury.io/py/eth-account)
[![Python versions](https://img.shields.io/pypi/pyversions/eth-account.svg)](https://pypi.python.org/pypi/eth-account)
[![Docs build](https://readthedocs.org/projects/eth-account/badge/?version=latest)](http://eth-account.readthedocs.io/en/latest/?badge=latest)


Sign Ethereum transactions and messages with local private keys

* Python 3.5+ support

Read more in the [documentation on ReadTheDocs](http://eth-account.readthedocs.io/). [View the change log on Github](docs/releases.rst).
Read more in the [documentation on ReadTheDocs](http://eth-account.readthedocs.io/). [View the change log](http://eth-account.readthedocs.io/en/latest/releases.html)

## Quickstart

Expand Down
17 changes: 16 additions & 1 deletion docs/conf.py
Expand Up @@ -34,7 +34,11 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -273,3 +277,14 @@
'web3': ('http://web3py.readthedocs.io/en/latest/', None),
'hexbytes': ('http://hexbytes.readthedocs.io/en/latest/', None),
}

# -- Doctest configuration ----------------------------------------

import doctest

doctest_default_flags = (0
| doctest.DONT_ACCEPT_TRUE_FOR_1
| doctest.ELLIPSIS
| doctest.IGNORE_EXCEPTION_DETAIL
| doctest.NORMALIZE_WHITESPACE
)
1 change: 1 addition & 0 deletions pytest.ini
@@ -1,6 +1,7 @@
[pytest]
addopts= -v --showlocals --durations 10
python_paths= .
xfail_strict=true

[pytest-watch]
runner= py.test --failed-first --maxfail=1 --no-success-flaky-report
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -67,5 +67,6 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: PyPy',
],
)
4 changes: 4 additions & 0 deletions tests/core/test_import.py
@@ -0,0 +1,4 @@


def test_import():
import eth_account # noqa: F401
11 changes: 9 additions & 2 deletions tox.ini
@@ -1,7 +1,8 @@
[tox]
envlist=
py{35,36}-core
py{35,36,py3}-core
lint
doctest

[isort]
combine_as_imports=True
Expand All @@ -22,10 +23,16 @@ ignore=
usedevelop=True
commands=
core: py.test {posargs:tests/core}
doctest: make -C {toxinidir}/docs doctest
basepython =
doctest: python
py35: python3.5
py36: python3.6
extras=test
pypy3: pypy3
extras=
test
doctest: doc
whitelist_externals=make

[testenv:lint]
basepython=python
Expand Down

0 comments on commit 1a77e30

Please sign in to comment.