Skip to content

Commit

Permalink
Merge pull request #2 from sbellem/0.1.0
Browse files Browse the repository at this point in the history
0.1.0
  • Loading branch information
sbellem committed Feb 23, 2016
2 parents 269335b + 9230c3f commit feac36e
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: python
python: 2.7
install: pip install -e .[test]
before_install: pip install codecov
script: py.test -v --cov
after_success: codecov
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:2.7

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY requirements.txt /usr/src/app/
RUN pip install --upgrade pip

COPY . /usr/src/app

RUN pip install -e .[dev]

CMD ["py.test", "-v", "tests/"]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# transactions: Bitcoin for Humans

[![PyPI](https://img.shields.io/pypi/v/transactions.svg)](https://pypi.python.org/pypi/transactions)
[![Travis](https://img.shields.io/travis/ascribe/transactions.svg)](https://travis-ci.org/ascribe/transactions)

transactions is a small python library to easily create and push transactions to the bitcoin network.

## Install
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
trxs:
build: .
volumes:
- ./transactions:/usr/src/app/transactions
- ./tests:/usr/src/app/tests
- ./pytest.ini:/usr/src/app/pytest.ini
- ./setup.cfg:/usr/src/app/setup.cfg
- ./setup.py:/usr/src/app/setup.py
command: py.test -v
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
testpaths = tests
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[aliases]
test=pytest

[coverage:run]
source = transactions
omit = *test*
81 changes: 78 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,88 @@
"""
transactions: Bitcoin for Humans
transactions is a small python library to easily create and push transactions
to the bitcoin network.
More information at https://github.com/ascribe/transactions
"""
import io
import os
import re

from setuptools import setup


def read(*names, **kwargs):
with io.open(
os.path.join(os.path.dirname(__file__), *names),
encoding=kwargs.get('encoding', 'utf8')
) as fp:
return fp.read()


def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(
r'^__version__ = [\'"]([^\'"]*)[\'"]', version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError('Unable to find version string.')


install_requires = [
'pybitcointools==1.1.15',
'pycoin==0.52',
'requests==2.7.0',
]

tests_require = [
'pytest',
'coverage',
'pep8',
'pyflakes',
'pylint',
'pytest',
'pytest-cov',
]

dev_require = [
'ipdb',
'ipython',
]

docs_require = [
'Sphinx>=1.3.5',
'sphinxcontrib-napoleon>=0.4.4',
]

setup(
name='transactions',
version='0.1',
version=find_version('transactions', '__init__.py'),
url='https://github.com/ascribe/transactions',
license='',
license='Apache Software License',
author='Rodolphe Marques',
author_email='[email protected]',
packages=['transactions',
'transactions.services'],
description='transactions: Bitcoin for Humans'
description='transactions: Bitcoin for Humans',
long_description=__doc__,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development',
],
install_requires=install_requires,
setup_requires=['pytest-runner'],
tests_require=tests_require,
extras_require={
'test': tests_require,
'dev': dev_require + tests_require + docs_require,
'docs': docs_require,
},
)
8 changes: 8 additions & 0 deletions tests/test_transactions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def test_init_transactions_class_with_defaults():
from transactions import Transactions
from transactions.services.blockrservice import BitcoinBlockrService
trxs = Transactions()
assert trxs.testnet is False
assert isinstance(trxs._service, BitcoinBlockrService)
assert trxs._min_tx_fee == trxs._service._min_transaction_fee
assert trxs._dust == trxs._service._min_dust
5 changes: 4 additions & 1 deletion transactions/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
from transactions import Transactions
from transactions import Transactions # noqa


__version__ = '0.1.0'

0 comments on commit feac36e

Please sign in to comment.