Skip to content
Permalink
Browse files

continuous integration goodies from rooterkyberian (#26)

* continuous integration goodies

* fixed test_address not running

* fixup `python setup.py test`

* fixup readme.rst formatting
  • Loading branch information...
rooterkyberian authored and emesik committed Jun 12, 2018
1 parent 7176f3f commit 12e69da49613e47dfd73b64122613528d5fc667b
Showing with 107 additions and 1 deletion.
  1. +15 −0 .editorconfig
  2. +19 −0 .travis.yml
  3. +37 −0 README.rst
  4. +6 −0 setup.cfg
  5. +4 −0 setup.py
  6. +6 −0 test_requirements.txt
  7. +6 −1 tests/test_address.py
  8. +14 −0 tests/utils.py
@@ -0,0 +1,15 @@
# http://editorconfig.org

root = true

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

[*.yml]
indent_size = 2
@@ -0,0 +1,19 @@
language: python
python:
- "2.7"
- "3.6"
- "nightly"

matrix:
allow_failures:
python: "nightly"

cache: pip
before_install:
- pip install -r test_requirements.txt
install:
- pip install -e . # install dependencies as specified in setup.py
script:
- pytest
after_success:
- coveralls
@@ -1,6 +1,17 @@
Python Monero module
====================

|travis|_ |coveralls|_


.. |travis| image:: https://travis-ci.org/emesik/monero-python.svg
.. _travis: https://travis-ci.org/emesik/monero-python


.. |coveralls| image:: https://coveralls.io/repos/github/emesik/monero-python/badge.svg
.. _coveralls: https://coveralls.io/github/emesik/monero-python


A comprehensive Python module for handling Monero cryptocurrency.

* release 0.3
@@ -40,3 +51,29 @@ Want to help?

If you find this project useful, please consider a donation to the following address:
``481SgRxo8hwBCY4z6r88JrN5X8JFCJYuJUDuJXGybTwaVKyoJPKoGj3hQRAEGgQTdmV1xH1URdnHkJv6He5WkEbq6iKhr94``


Development
-----------

1. Clone the repo
2. Create virtualenv & activate it

.. code-block:: bash
python3.6 -m venv .venv
source .venv/bin/activate
3. Install dependencies

.. code-block:: bash
pip install -r requirements.txt -r test_requirements.txt
4. Do your thing

5. Run tests

.. code-block:: bash
pytest
@@ -0,0 +1,6 @@
[aliases]
test=pytest

[tool:pytest]
rootdir=tests
addopts=--cov=monero
@@ -32,6 +32,10 @@ def find_version(*parts):
url = 'https://github.com/emesik/monero-python/',
long_description = open('README.rst', 'rb').read().decode('utf-8'),
install_requires = open('requirements.txt', 'r').read().splitlines(),
tests_requires=open('test_requirements.txt', 'r').read().splitlines(),
setup_requires=[
'pytest-runner',
],
packages = find_packages('.', exclude=['tests']),
include_package_data = True,
author = 'Michał Sałaban',
@@ -0,0 +1,6 @@
coverage~=4.5.1
coveralls
pip>=9
pytest-cov~=2.5
pytest-runner~=4.2
pytest~=3.6
@@ -1,8 +1,14 @@
import unittest

from monero.address import Address, SubAddress, IntegratedAddress, address
from tests.utils import classproperty


class Tests(object):
@classproperty
def __test__(cls):
return issubclass(cls, unittest.TestCase)

def test_from_and_to_string(self):
a = Address(self.addr)
self.assertEqual(str(a), self.addr)
@@ -112,7 +118,6 @@ def test_invalid(self):
address,
'Cf6RinMUztY5otm6NEFjg3UWBBkXK6Lh23wKrLFMEcCY7i3A6aPLH9i4QMCkf6CdWk8Q9N7yoJf7ANKgtQMuPM6JANXgCWs')


def test_type_mismatch(self):
self.assertRaises(ValueError, Address, self.iaddr)
self.assertRaises(ValueError, Address, self.subaddr)
@@ -0,0 +1,14 @@
class ClassPropertyDescriptor(object):
"""Based on https://stackoverflow.com/questions/5189699/how-to-make-a-class-property"""

def __init__(self, fget):
self.fget = fget

def __get__(self, obj, klass):
if klass is None:
klass = type(obj)
return self.fget.__get__(obj, klass)()


def classproperty(func):
return ClassPropertyDescriptor(classmethod(func))

0 comments on commit 12e69da

Please sign in to comment.
You can’t perform that action at this time.