diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 00000000..d0ec4082 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,23 @@ +[bumpversion] +current_version = 0.4.4 +commit = True +tag = True +parse = (?P\d+)\.(?P\d+)\.(?P\d+)(-(?P[^.]*)\.(?P\d+))? +serialize = + {major}.{minor}.{patch}-{stage}.{devnum} + {major}.{minor}.{patch} + +[bumpversion:part:stage] +optional_value = stable +first_value = stable +values = + alpha + beta + stable + +[bumpversion:part:devnum] + +[bumpversion:file:setup.py] +search = version='{current_version}', +replace = version='{new_version}', + diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..9b05d235 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,16 @@ +* Version: x.x.x +* Python: 2.7/3.4/3.5 +* OS: osx/linux/win + + +### What was wrong? + +Please include any of the following that are applicable: + +* The code which produced the error +* The full output of the error + + +### How can it be fixed? + +Fill this section in if you know how this could or should be fixed. diff --git a/ISSUE_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 68% rename from ISSUE_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md index 4b826137..a9937bb7 100644 --- a/ISSUE_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,4 +8,4 @@ #### Cute Animal Picture -> put a cute animal picture here. +![Cute animal picture]() diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0d67497d..b801da87 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ To start development you should begin by cloning the repo. ```bash -$ git clone git@github.com/pipermerriam/ethereum-abi-utils.git +$ git clone git@github.com/ethereum/eth-abi.git ``` diff --git a/README.md b/README.md index 813395fb..5abc3ef1 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,75 @@ # Ethereum Contract -[![Build Status](https://travis-ci.org/pipermerriam/ethereum-abi-utils.png)](https://travis-ci.org/pipermerriam/ethereum-abi-utils) -[![Documentation Status](https://readthedocs.org/projects/ethereum-abi-utils/badge/?version=latest)](https://readthedocs.org/projects/ethereum-abi-utils/?badge=latest) -[![PyPi version](https://pypip.in/v/ethereum-abi-utils/badge.png)](https://pypi.python.org/pypi/ethereum-abi-utils) -[![PyPi downloads](https://pypip.in/d/ethereum-abi-utils/badge.png)](https://pypi.python.org/pypi/ethereum-ipc-utils) +[![Build Status](https://travis-ci.org/ethereum/eth-abi.png)](https://travis-ci.org/ethereum/eth-abi) +[![Documentation Status](https://readthedocs.org/projects/eth-abi/badge/?version=latest)](https://readthedocs.org/projects/eth-abi/?badge=latest) +[![PyPi version](https://pypip.in/v/eth-abi/badge.png)](https://pypi.python.org/pypi/eth-abi) +[![PyPi downloads](https://pypip.in/d/eth-abi/badge.png)](https://pypi.python.org/pypi/eth-ipc-utils) Python utilities for working with the Ethereum ABI + + +## Installation + +```sh +pip install eth-abi +``` + +## Development + +Clone the repository and then run: + +```sh +pip install -e . -r requirements-dev.txt +``` + + +### Running the tests + +You can run the tests with: + +```sh +py.test tests +``` + +Or you can install `tox` to run the full test suite. + + +### Releasing + +Pandoc is required for transforming the markdown README to the proper format to +render correctly on pypi. + +For Debian-like systems: + +``` +apt install pandoc +``` + +Or on OSX: + +```sh +brew install pandoc +``` + +To release a new version: + +```sh +bumpversion $$VERSION_PART_TO_BUMP$$ +git push && git push --tags +make release +``` + + +#### How to bumpversion + +The version format for this repo is `{major}.{minor}.{patch}` for stable, and +`{major}.{minor}.{patch}-{stage}.{devnum}` for unstable (`stage` can be alpha or beta). + +To issue the next version in line, use bumpversion and specify which part to bump, +like `bumpversion minor` or `bumpversion devnum`. + +If you are in a beta version, `bumpversion stage` will switch to a stable. + +To issue an unstable version when the current version is stable, specify the +new version explicitly, like `bumpversion --new-version 4.0.0-alpha.1 devnum` diff --git a/docs/conf.py b/docs/conf.py index a16d2c81..00fcd8e0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,7 +46,7 @@ # General information about the project. project = u'Ethereum ABI Utils' -copyright = u'2016, Piper Merriam ' +copyright = u'2017, Piper Merriam ' author = u'Piper Merriam ' # The version info for the project you're documenting, acts as replacement for diff --git a/docs/decoding.rst b/docs/decoding.rst index 7fdce486..60dac97a 100644 --- a/docs/decoding.rst +++ b/docs/decoding.rst @@ -5,7 +5,7 @@ Decoding These functions are intended for decoding return values from the EVM. -* ``eth_alarm.decode_single(type, data)`` +* ``eth_abi.decode_single(type, data)`` This function tries to decode ``data`` into the python type that corresponds to the provided ``type``. This function accepts both byte strings as well as @@ -28,7 +28,7 @@ The **value** parameter is expected to be one of the recognized EVM types. .. note:: This function cannot be used to decode dynamic or array types such as ``bytes32[]``. -* ``eth_alarm.decode_abi(types, data)`` +* ``eth_abi.decode_abi(types, data)`` This function decodes ``data`` into the python type corresponding to the provided ``types``. This function accepts both byte arrays as well as their diff --git a/docs/encoding.rst b/docs/encoding.rst index d2868b9e..7b4b2bf6 100644 --- a/docs/encoding.rst +++ b/docs/encoding.rst @@ -6,7 +6,7 @@ These functions are intended for encoding python values into representations that are suitable for interacting with the EVM. -* ``eth_alarm.encode_single(type, value)`` +* ``eth_abi.encode_single(type, value)`` This function encodes ``value`` in the ABI encoding for the provided ``type``. @@ -22,7 +22,7 @@ The **value** parameter is expected to be one of the recognized EVM types. .. note:: This function cannot be used to encode array types such as ``bytes32[]``. -* ``eth_alarm.encode_abi(types, values)`` +* ``eth_abi.encode_abi(types, values)`` This function encodes ``values`` in the ABI encoding for the corresponding type provided by the ``types`` argument. diff --git a/eth_abi/__init__.py b/eth_abi/__init__.py index eaf87c88..7cd6697a 100644 --- a/eth_abi/__init__.py +++ b/eth_abi/__init__.py @@ -8,4 +8,4 @@ ) -__version__ = pkg_resources.get_distribution('ethereum-abi-utils').version +__version__ = pkg_resources.get_distribution('eth-abi').version diff --git a/requirements-dev.txt b/requirements-dev.txt index 5ccae885..5ec87bb4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,3 +3,4 @@ pytest>=3.0.3 pytest-pythonpath>=0.7.1 tox>=2.4.1 hypothesis>=3.6.1 +bumpversion==0.5.3 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 861e453b..00000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -sphinx-better-theme==0.1.4 -rlp==0.4.6 diff --git a/setup.py b/setup.py index f7f25f0e..bc68852d 100644 --- a/setup.py +++ b/setup.py @@ -1,32 +1,25 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import os - from setuptools import ( setup, find_packages, ) -DIR = os.path.dirname(os.path.abspath(__file__)) - -version = '0.4.4' - -readme = open(os.path.join(DIR, 'README.md')).read() - - setup( - name='ethereum-abi-utils', - version=version, + name='eth-abi', + # *IMPORTANT*: Don't manually change the version here. Use the 'bumpversion' utility. + version='0.4.4', description="""Ethereum ABI Utils""", - long_description=readme, + long_description_markdown_filename='README.md', author='Piper Merriam', author_email='pipermerriam@gmail.com', - url='https://github.com/pipermerriam/ethereum-abi-utils', + url='https://github.com/ethereum/eth-abi', include_package_data=True, install_requires=[ - 'ethereum-utils>=0.2.0', + 'eth-utils==0.7.*', ], + setup_requires=['setuptools-markdown'], py_modules=['eth_abi'], license="MIT", zip_safe=False,