Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ethereum/web3.py into sup…
Browse files Browse the repository at this point in the history
…port-eip-1577
  • Loading branch information
filips123 committed Dec 14, 2019
2 parents 46dda73 + e4b835e commit 1b825b9
Show file tree
Hide file tree
Showing 181 changed files with 8,540 additions and 3,224 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 5.0.0
current_version = 5.4.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-(?P<stage>[^.]*)\.(?P<devnum>\d+))?
Expand Down
135 changes: 129 additions & 6 deletions .circleci/config.yml
Expand Up @@ -118,7 +118,7 @@ ethpm_steps: &ethpm_steps
command:
wget https://dist.ipfs.io/go-ipfs/v0.4.19/go-ipfs_v0.4.19_linux-amd64.tar.gz &&
tar xvfz go-ipfs_v0.4.19_linux-amd64.tar.gz &&
sudo cp go-ipfs/ipfs /usr/local/bin &&
sudo cp go-ipfs/ipfs /usr/local/bin &&
ipfs init
- run:
name: start ipfs node in background
Expand Down Expand Up @@ -152,12 +152,12 @@ jobs:
environment:
TOXENV: lint

doctest:
docs:
<<: *common
docker:
- image: circleci/python:3.6
environment:
TOXENV: doctest
TOXENV: docs

py36-core:
<<: *common
Expand All @@ -179,7 +179,8 @@ jobs:
- image: circleci/python:3.6
environment:
TOXENV: py36-ethpm
WEB3_INFURA_PROJECT_ID: 4f1a358967c7474aae6f8f4a7698aefc
# Please don't use this key for any shenanigans
WEB3_INFURA_PROJECT_ID: 7707850c2fb7465ebe6f150d67182e22

py36-integration-goethereum-ipc-1.7.2:
<<: *geth_steps
Expand Down Expand Up @@ -286,7 +287,8 @@ jobs:
- image: circleci/python:3.7
environment:
TOXENV: py37-ethpm
WEB3_INFURA_PROJECT_ID: 4f1a358967c7474aae6f8f4a7698aefc
# Please don't use this key for any shenanigans
WEB3_INFURA_PROJECT_ID: 7707850c2fb7465ebe6f150d67182e22

py37-integration-goethereum-ipc-1.7.2:
<<: *geth_steps
Expand Down Expand Up @@ -370,13 +372,121 @@ jobs:
environment:
TOXENV: py37-integration-ethtester
ETHEREUM_TESTER_CHAIN_BACKEND: eth_tester.backends.PyEVMBackend
#
# Python 3.8
#
py38-core:
<<: *common
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-core

py38-ens:
<<: *common
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-ens

py38-ethpm:
<<: *ethpm_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-ethpm
# Please don't use this key for any shenanigans
WEB3_INFURA_PROJECT_ID: 7707850c2fb7465ebe6f150d67182e22

py38-integration-goethereum-ipc-1.7.2:
<<: *geth_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-goethereum-ipc
GETH_VERSION: v1.7.2

py38-integration-goethereum-http-1.7.2:
<<: *geth_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-goethereum-http
GETH_VERSION: v1.7.2

py38-integration-goethereum-ws-1.7.2:
<<: *geth_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-goethereum-ws
GETH_VERSION: v1.7.2

py38-integration-goethereum-ipc-1.8.22:
<<: *geth_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-goethereum-ipc
GETH_VERSION: v1.8.22

py38-integration-goethereum-http-1.8.22:
<<: *geth_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-goethereum-http
GETH_VERSION: v1.8.22

py38-integration-goethereum-ws-1.8.22:
<<: *geth_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-goethereum-ws
GETH_VERSION: v1.8.22

py38-integration-parity-ipc:
<<: *parity_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-parity-ipc
PARITY_VERSION: v2.3.5
PARITY_OS: linux

py38-integration-parity-http:
<<: *parity_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-parity-http
PARITY_VERSION: v2.3.5
PARITY_OS: linux

py38-integration-parity-ws:
<<: *parity_steps
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-parity-ws
PARITY_VERSION: v2.3.5
PARITY_OS: linux

py38-integration-ethtester-pyevm:
<<: *common
docker:
- image: circleci/python:3.8
environment:
TOXENV: py38-integration-ethtester
ETHEREUM_TESTER_CHAIN_BACKEND: eth_tester.backends.PyEVMBackend

workflows:
version: 2
test:
jobs:
- lint
- doctest
- docs
- py36-core
- py36-ens
- py36-ethpm
Expand All @@ -403,3 +513,16 @@ workflows:
- py37-integration-parity-http
- py37-integration-parity-ws
- py37-integration-ethtester-pyevm
- py38-core
- py38-ens
- py38-ethpm
- py38-integration-goethereum-ipc-1.7.2
- py38-integration-goethereum-http-1.7.2
- py38-integration-goethereum-ws-1.7.2
- py38-integration-goethereum-ipc-1.8.22
- py38-integration-goethereum-http-1.8.22
- py38-integration-goethereum-ws-1.8.22
- py38-integration-parity-ipc
- py38-integration-parity-http
- py38-integration-parity-ws
- py38-integration-ethtester-pyevm
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -4,7 +4,8 @@ Related to Issue #

### How was it fixed?


### Todo:
- [ ] Add entry to the [release notes](https://github.com/ethereum/web3.py/blob/master/newsfragments/README.md)

#### Cute Animal Picture

Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -67,6 +67,10 @@ logs
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
.idea/inspectionProfiles
.idea/misc.xml
.idea/web3.py.iml
.idea/modules.xml

# Sensitive or high-churn files:
.idea/dataSources.ids
Expand Down Expand Up @@ -114,3 +118,6 @@ fabric.properties

# mypy Cache
.mypy_cache/

# pip wheel metadata
pip-wheel-metadata/
15 changes: 13 additions & 2 deletions Makefile
Expand Up @@ -40,16 +40,27 @@ build-docs:
$(MAKE) -C docs html
$(MAKE) -C docs doctest

docs: build-docs
docs: build-docs validate-docs
open docs/_build/html/index.html

validate-docs: build-docs
python newsfragments/validate_files.py
towncrier --draft

linux-docs: build-docs
readlink -f docs/_build/html/index.html

release: clean
CURRENT_SIGN_SETTING=$(git config commit.gpgSign)
git config commit.gpgSign true
bumpversion $(bump)
# Let UPCOMING_VERSION be the version that is used for the current bump
$(eval UPCOMING_VERSION=$(shell bumpversion $(bump) --dry-run --list | grep new_version= | sed 's/new_version=//g'))
# Now generate the release notes to have them included in the release commit
towncrier --yes --version $(UPCOMING_VERSION)
# We need --allow-dirty because of the generated release_notes file but it is safe because the
# previous dry-run runs *without* --allow-dirty which ensures it's really just the release notes
# file that we are allowing to sit here dirty, waiting to get included in the release commit.
bumpversion --allow-dirty $(bump)
git push upstream && git push upstream --tags
python setup.py sdist bdist_wheel
twine upload dist/*
Expand Down
10 changes: 8 additions & 2 deletions README.md
Expand Up @@ -121,10 +121,10 @@ tox -e py37-core

If for some reason it is not working, add `--recreate` params.

`tox` is good for testing against the full set of build targets. But if you want to run the tests individually, `py.test` is better for development workflow. For example, to run only the tests in one file:
`tox` is good for testing against the full set of build targets. But if you want to run the tests individually, `pytest` is better for development workflow. For example, to run only the tests in one file:

```sh
py.test tests/core/gas-strategies/test_time_based_gas_price_strategy.py
pytest tests/core/gas-strategies/test_time_based_gas_price_strategy.py
```

### Release setup
Expand All @@ -140,6 +140,12 @@ To release a new version:
make release bump=$$VERSION_PART_TO_BUMP$$
```

To preview the upcoming release notes:

```sh
towncrier --draft
```

#### How to bumpversion

The version format for this repo is `{major}.{minor}.{patch}` for stable, and
Expand Down
7 changes: 7 additions & 0 deletions conftest.py
Expand Up @@ -102,6 +102,13 @@ def web3():
return Web3(provider)


@pytest.fixture
def w3_strict_abi():
w3 = Web3(EthereumTesterProvider())
w3.enable_strict_bytes_type_checking()
return w3


@pytest.fixture(autouse=True)
def print_warnings():
warnings.simplefilter('always')
2 changes: 1 addition & 1 deletion docs/Makefile
Expand Up @@ -50,7 +50,7 @@ clean:
rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
$(SPHINXBUILD) -W -T -E -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

Expand Down
11 changes: 11 additions & 0 deletions docs/README-osx.md
Expand Up @@ -19,3 +19,14 @@ brew install openssl libffi autoconf automake libtool
```sh
brew install leveldb
```

> If you are on `>=OSX 10.15 Catalina` you may encounter the following error with the default `ZSH` shell. This can be fixed by wrapping the `[dev]` part in quotes.
```sh
pip install -e .[dev]
zsh: no matches found: .[dev]
```

Run install commands as follows:
```sh
pip install -e .'[dev]'
```
11 changes: 11 additions & 0 deletions docs/_static/js/matomo.js
@@ -0,0 +1,11 @@
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://matomo.ethereum.org/piwik/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '18']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
21 changes: 19 additions & 2 deletions docs/conventions.rst → docs/abi_types.rst
@@ -1,5 +1,5 @@
Conventions
===========
ABI Types
=========

The Web3 library follows the following conventions.

Expand All @@ -24,3 +24,20 @@ All addresses must be supplied in one of three ways:
* A 20-byte hexadecimal that is checksummed using the `EIP-55
<https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md>`_ spec.
* A 20-byte binary address.

Strict Bytes Type Checking
--------------------------

.. note ::
In version 6, this will be the default behavior
There is a method on web3 that will enable stricter bytes type checking.
The default is to allow Python strings, and to allow bytestrings less
than the specified byte size. To enable stricter checks, use
``w3.enable_strict_bytes_type_checking()``. This method will cause the web3
instance to raise an error if a Python string is passed in without a "0x"
prefix. It will also raise an error if the byte string or hex string is not
the exact number of bytes specified by the ABI type. See the
:ref:`enable-strict-byte-check` section
for an example and more details.
6 changes: 5 additions & 1 deletion docs/conf.py
Expand Up @@ -89,6 +89,7 @@
'web3.providers.rst',
'web3.providers.eth_tester.rst',
'web3.testing.rst',
'web3.tools.*',
]

# The reST default role (used for this markup: `text`) to use for all
Expand Down Expand Up @@ -148,7 +149,10 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
html_static_path = ['_static']

def setup(app):
app.add_js_file("js/matomo.js")

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down

0 comments on commit 1b825b9

Please sign in to comment.