From 907e3cfec50daac428a6d8b9674067ca1b2957f8 Mon Sep 17 00:00:00 2001 From: Piper Merriam Date: Thu, 14 Apr 2016 10:20:16 -0600 Subject: [PATCH] initial commit --- .github/ISSUE_TEMPLATE.md | 11 ++++++++ .github/PULL_REQUEST_TEMPLATE.md | 11 ++++++++ .gitignore | 45 ++++++++++++++++++++++++++++++++ .travis.yml | 18 +++++++++++++ CHANGELOG | 4 +++ CONTRIBUTING.md | 34 ++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++ MANIFEST.in | 7 +++++ Makefile | 38 +++++++++++++++++++++++++++ README.md | 9 +++++++ pytest.ini | 3 +++ requirements-dev.txt | 3 +++ setup.py | 45 ++++++++++++++++++++++++++++++++ tests/test_example.py | 2 ++ tox.ini | 22 ++++++++++++++++ web3/__init__.py | 3 +++ 16 files changed, 276 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 CHANGELOG create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 MANIFEST.in create mode 100644 Makefile create mode 100644 README.md create mode 100644 pytest.ini create mode 100644 requirements-dev.txt create mode 100644 setup.py create mode 100644 tests/test_example.py create mode 100644 tox.ini create mode 100644 web3/__init__.py diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..66e2bc820c --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,11 @@ +* Version: x.x.x +* Python: 2.7/3.4/3.5 +* OS: osx/linux/win + + +### What was wrong? + + +#### Cute Animal Picture + +> put a cute animal picture here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..4b8261372f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +### What was wrong? + + + +### How was it fixed? + + + +#### Cute Animal Picture + +> put a cute animal picture here. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..676fb32656 --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Complexity +output/*.html +output/*/index.html + +# Sphinx +docs/_build + +# Blockchain +chains diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..2832910fbc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +sudo: false +language: python +python: + - "3.5" +env: + matrix: + - TOX_ENV=py27 + - TOX_ENV=py34 + - TOX_ENV=py35 + - TOX_ENV=flake8 +cache: pip +install: + - "travis_retry pip install setuptools --upgrade" + - "travis_retry pip install tox" +script: + - tox -e $TOX_ENV +after_script: + - cat .tox/$TOX_ENV/log/*.log diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000000..c4af1855c5 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,4 @@ +0.1.0 +----- + +TODO diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..48fff0d48e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,34 @@ +# Development + +To start development you should begin by cloning the repo. + +```bash +$ git clone git@github.com/pipermerriam/web3.py.git +``` + + +# Cute Animal Pictures + +All pull requests need to have a cute animal picture. This is a very important +part of the development process. + + +# Pull Requests + +In general, pull requests are welcome. Please try to adhere to the following. + +- code should conform to PEP8 and as well as the linting done by flake8 +- include tests. +- include any relevant documentation updates. + +It's a good idea to make pull requests early on. A pull request represents the +start of a discussion, and doesn't necessarily need to be the final, finished +submission. + +GitHub's documentation for working on pull requests is [available here][pull-requests]. + +Always run the tests before submitting pull requests, and ideally run `tox` in +order to check that your modifications don't break anything. + +Once you've made a pull request take a look at the travis build status in the +GitHub interface and make sure the tests are runnning as you'd expect. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..8c67f6d079 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Piper Merriam + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000000..1109e8dcc2 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,7 @@ +include LICENSE +include VERSION +include README.md +include requirements.txt + +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..631d3f5a28 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +.PHONY: clean-pyc clean-build docs + +help: + @echo "clean-build - remove build artifacts" + @echo "clean-pyc - remove Python file artifacts" + @echo "lint - check style with flake8" + @echo "test - run tests quickly with the default Python" + @echo "testall - run tests on every Python version with tox" + @echo "release - package and upload a release" + @echo "sdist - package" + +clean: clean-build clean-pyc + +clean-build: + rm -fr build/ + rm -fr dist/ + rm -fr *.egg-info + +clean-pyc: + find . -name '*.pyc' -exec rm -f {} + + find . -name '*.pyo' -exec rm -f {} + + find . -name '*~' -exec rm -f {} + + +lint: + flake8 web3 + +test: + py.test tests + +test-all: + tox + +release: clean + python setup.py sdist bdist_wheel upload + +sdist: clean + python setup.py sdist bdist_wheel + ls -l dist diff --git a/README.md b/README.md new file mode 100644 index 0000000000..c7977d1bc7 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Web3.py + +[![Build Status](https://travis-ci.org/pipermerriam/web3.py.png)](https://travis-ci.org/pipermerriam/web3.py) +[![Documentation Status](https://readthedocs.org/projects/web3.py/badge/?version=latest)](https://readthedocs.org/projects/web3.py/?badge=latest) +[![PyPi version](https://pypip.in/v/web3.py/badge.png)](https://pypi.python.org/pypi/web3.py) +[![PyPi downloads](https://pypip.in/d/web3.py/badge.png)](https://pypi.python.org/pypi/web3.py) + + +A python implementation of [web3.js](https://github.com/ethereum/web3.js) diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000000..3649b52672 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +python_paths= . +addopts= --tb native -v diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000000..ab1a8db036 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,3 @@ +pytest>=2.8.2 +pytest-pythonpath>=0.3 +tox>=1.8.0 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000..6c7cabc334 --- /dev/null +++ b/setup.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import os + +from setuptools import ( + setup, + find_packages, +) + + +DIR = os.path.dirname(os.path.abspath(__file__)) + + +readme = open(os.path.join(DIR, 'README.md')).read() + + +setup( + name='web3.py', + version='0.1.0', + description="""Web3.py""", + long_description=readme, + author='Piper Merriam', + author_email='pipermerriam@gmail.com', + url='https://github.com/pipermerriam/web3.py', + include_package_data=True, + install_requires=[ + "six>=1.10.0", + ], + py_modules=['web3'], + license="MIT", + zip_safe=False, + keywords='ethereum', + packages=find_packages(exclude=["tests", "tests.*"]), + classifiers=[ + 'Development Status :: 2 - Pre-Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + ], +) diff --git a/tests/test_example.py b/tests/test_example.py new file mode 100644 index 0000000000..b76ddae705 --- /dev/null +++ b/tests/test_example.py @@ -0,0 +1,2 @@ +def test_it(): + assert True diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000000..2756fe3a57 --- /dev/null +++ b/tox.ini @@ -0,0 +1,22 @@ +[tox] +envlist= + py{27,34,35}, + flake8 + +[flake8] +max-line-length= 100 +exclude= tests/* + +[testenv] +commands=py.test {posargs:tests} +deps = + -r{toxinidir}/requirements-dev.txt +basepython = + py27: python2.7 + py34: python3.4 + py35: python3.5 + +[testenv:flake8] +basepython=python +deps=flake8 +commands=flake8 {toxinidir}/web3 diff --git a/web3/__init__.py b/web3/__init__.py new file mode 100644 index 0000000000..5312b0ed9c --- /dev/null +++ b/web3/__init__.py @@ -0,0 +1,3 @@ +import pkg_resources + +__version__ = pkg_resources.get_distribution("web3").version