diff --git a/README.md b/README.md deleted file mode 100644 index 0749c3a576169d9a8b82110a6d10a0738ac5ccd9..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Duniter Python API -[](https://coveralls.io/github/duniter/duniter-python-api?branch=master) - -Python implementation of [Duniter](https://git.duniter.org/nodes/typescript/duniter) BMA API - -## Features - * Supports Duniter's [Basic Merkle API](https://git.duniter.org/nodes/typescript/duniter/blob/master/doc/HTTP_API.md) and [protocol](https://git.duniter.org/nodes/typescript/duniter/blob/master/doc/Protocol.md) - * Asynchronous - * Duniter signing key - -## Requirements - * Python >= 3.5 - * [aiohttp >= 0.19](https://pypi.python.org/pypi/aiohttp "aiohttp") - * [pylibscrypt](https://pypi.python.org/pypi/pylibscrypt "pylibscrypt") - * [libnacl](https://pypi.python.org/pypi/libnacl "libnacl") - * [base58](https://pypi.python.org/pypi/base58 "base58") - -## Installation -You can install duniter-python-api and all its dependencies via the following pip install: - -`pip3 install duniterpy` - -Please take a look at the document [HTTP API](https://git.duniter.org/nodes/typescript/duniter/blob/master/doc/HTTP_API.md) to learn about the API. - -## Development -- Create a python environment with pyenv -- Add PYTHONPATH env var to your shell containing the path to this repository -- Take a look at examples -- Run examples from parent folder `python example/request_data.py` - -## Documentation - -- [HTML Documentation](https://git.duniter.org/clients/python/duniterpy/tree/master/docs/_build/html) -- [Examples](https://git.duniter.org/clients/python/duniterpy/tree/master/examples) diff --git a/README.rst b/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..6adc76eba90a075c0eb6603b86709699aef6a5bd --- /dev/null +++ b/README.rst @@ -0,0 +1,73 @@ +Duniter Python API +================== + +.. image:: https://coveralls.io/repos/duniter/duniter-python-api/badge.svg?branch=master&service=github + :target: https://coveralls.io/github/duniter/duniter-python-api?branch=master + +Python implementation of `Duniter <https://git.duniter.org/nodes/typescript/duniter>`_ BMA API + +Features +-------- + +* Supports Duniter's `Basic Merkle API <https://git.duniter.org/nodes/typescript/duniter/blob/master/doc/HTTP_API.md>`_ and `protocol <https://git.duniter.org/nodes/typescript/duniter/blob/master/doc/Protocol.md>`_ +* Asynchronous +* Duniter signing key + +Requirements +------------ + +* Python >= 3.5 +* `aiohttp >= 0.19 <https://pypi.python.org/pypi/aiohttp>`_ +* `pylibscrypt <https://pypi.python.org/pypi/pylibscrypt>`_ +* `libnacl <https://pypi.python.org/pypi/libnacl>`_ +* `base58 <https://pypi.python.org/pypi/base58>`_ + +Installation +------------ + +You can install duniter-python-api and all its dependencies via the following pip install: + +:code:`pip3 install duniterpy` + +Please take a look at the document `HTTP API <https://git.duniter.org/nodes/typescript/duniter/blob/master/doc/HTTP_API.md>`_ to learn about the API. + +Development +----------- + +* Create a python environment with pyenv +* Add PYTHONPATH env var to your shell containing the path to this repository +* Take a look at examples +* Run examples from parent folder :code:`python examples/request_data.py` + +Documentation +------------- + +* `HTML Documentation <https://git.duniter.org/clients/python/duniterpy/tree/master/docs/_build/html>`_ +* `Examples <https://git.duniter.org/clients/python/duniterpy/tree/master/examples>`_ + +Packaging and deploy +-------------------- + +Pypi +++++ + +*The README file must be in RestructuredText format (README.rst) for the long description field of the package.* + +In the development pyenv environment, install the following tools:: + + pip install --upgrade pip setuptools wheel + + pip install twine + +Change the version number (semantic version number):: + + ./release.sh 0.42.3 + +Build the Pypi package in the ``dist`` folder:: + + python setup.py sdist bdist_wheel + +Deploy the package on the Pypi repository:: + + twine upload dist/* + diff --git a/duniterpy/documents/ws2p/heads.py b/duniterpy/documents/ws2p/heads.py index 90d5236238f8867e2a37ca6b3f59b231072f9889..de359d649bbb366ce2a7f6c7c15e08626b60db8c 100644 --- a/duniterpy/documents/ws2p/heads.py +++ b/duniterpy/documents/ws2p/heads.py @@ -1,7 +1,6 @@ import attr import re -from ..document import MalformedDocumentError from ..block import BlockUID from ..constants import ws2p_public_prefix_regex, ws2p_private_prefix_regex,\ pubkey_regex, signature_regex, ws2pid_regex, block_uid_regex, ws2p_head_regex @@ -108,7 +107,7 @@ class HeadV1: .format( ws2pid=ws2pid_regex, software="[A-Za-z-_]+", - software_version="[0-9]+[.][0-9]+[.][0-9]+", + software_version="[0-9]+[.][0-9]+[.][0-9]+-?[A-Za-z0-9\.]+", pow_prefix="[0-9]+")) v0 = attr.ib(type=HeadV0) @@ -165,7 +164,7 @@ class HeadV2: data = HeadV2.re_inline.match(offload) free_member_room = int(data.group(1)) free_mirror_room = int(data.group(2)) - return cls(v1, free_member_room, free_mirror_room), offload + return cls(v1, free_member_room, free_mirror_room), "" except AttributeError: raise MalformedDocumentError("HeadV2") diff --git a/setup.py b/setup.py index d6bb9ab8e46fc056acf218841fe39a691c3a227d..6c5c013723469f4242c01399c3951117359b911e 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ setup( description="A python implementation of [duniter](https://github.com/duniter/duniter) API", - long_description=open('README.md').read(), + long_description=open('README.rst').read(), # Active la prise en compte du fichier MANIFEST.in include_package_data=True, @@ -71,4 +71,4 @@ setup( install_requires=install_requires, dependency_links=dependency_links -) \ No newline at end of file +)