Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor ethPM #1379

Merged
merged 10 commits into from Jul 11, 2019

Conversation

Projects
None yet
4 participants
@njgheorghita
Copy link
Contributor

commented Jul 9, 2019

What was wrong?

Things that happened here (aka why is this pr so large)

  • py-ethpm codebase was relocated to web3/ethpm
  • critical components moved from pytest-ethereum to web3.tools.pytest_ethereum
  • pytest-ethereum plugins exposed via entrypoints in setup.py
  • removed web3's core dependencies on py-ethpm and pytest-ethereum
  • added a couple core dependencies necessary for ethpm
  • a local ipfs node now runs in the background of circle builds
  • ethpm documentation has been moved to web3 docs

Things to note

  • No code has been changed / needs review in the migrated files, so the general structure of the migrated files is what primarily needs review in this pr.

Cute Animal Picture

image

@njgheorghita njgheorghita force-pushed the njgheorghita:migrate-ethpm branch 2 times, most recently from eb4b660 to 712605d Jul 9, 2019

@njgheorghita njgheorghita force-pushed the njgheorghita:migrate-ethpm branch 2 times, most recently from b8c3190 to b9a9079 Jul 9, 2019

@njgheorghita njgheorghita force-pushed the njgheorghita:migrate-ethpm branch from b9a9079 to 8cff826 Jul 9, 2019

@njgheorghita njgheorghita force-pushed the njgheorghita:migrate-ethpm branch from 4bd5bed to faaabd6 Jul 9, 2019

@njgheorghita njgheorghita force-pushed the njgheorghita:migrate-ethpm branch from 75317ce to 5d18a70 Jul 9, 2019

@voith

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2019

@njgheorghita Out of curiosity, what is the reason behind relocating ethpm to web3.py?

@njgheorghita

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

@voith Totally fair, it basically comes down to a circular dependency between web3 and ethpm that's causing some issues. web3 depends on ethpm concepts in web3.pm and ethpm uses web3 concepts liberally. My impression is the best solution to remove this dependency is to vendor ethpm and all relevant pytest-ethereum code in web3. It adds a fair amount of code overhead to the web3 codebase, but the goal is to keep it well separated from the web3 core code so it doesn't get messy.

@njgheorghita njgheorghita force-pushed the njgheorghita:migrate-ethpm branch 3 times, most recently from 96ba040 to 4dfec57 Jul 10, 2019

@njgheorghita njgheorghita changed the title [WIP] Vendor ethPM Vendor ethPM Jul 10, 2019

@njgheorghita njgheorghita force-pushed the njgheorghita:migrate-ethpm branch from 4dfec57 to 968cebd Jul 10, 2019

@njgheorghita njgheorghita requested review from pipermerriam, carver and kclowes Jul 10, 2019

@kclowes
Copy link
Contributor

left a comment

This looks good to me, @njgheorghita! I just had one question while looking over this: what is the reasoning behind removing the pytest-ethereum dependency? Is it another circular dependency problem?

@njgheorghita

This comment has been minimized.

Copy link
Contributor Author

commented Jul 10, 2019

@kclowes Yup! Exactly, pytest-ethereum has the same circular dependency problem with web3 that ethpm had. However, since pytest-ethereum doesn't rely on web3 as heavily as ethpm, only the few core components were migrated into the web3 codebase rather than the entire library. So, pytest-ethereum will continue to exist as a wrapper around and extensions beyond these new web3 components.

@carver

carver approved these changes Jul 10, 2019

Copy link
Collaborator

left a comment

I won't be able to review the ethpm package, it's way too big. Just gave a quick scan of everything else.

@@ -9,6 +9,17 @@ common: &common
- restore_cache:
keys:
- cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
- run:
name: install ipfs

This comment has been minimized.

Copy link
@carver

carver Jul 10, 2019

Collaborator

Is this necessary for every test now, or just the new ethpm ones?

>>> from ethpm import Package, ASSETS_DIR
>>> from web3 import Web3
>>> owned_manifest_path = ASSETS_DIR / 'owned' / '1.0.0.json'

This comment has been minimized.

Copy link
@carver

carver Jul 10, 2019

Collaborator

Could move this down to the next batch of lines, since it's not used yet.

>>> safe_send_tx_receipt = w3.eth.waitForTransactionReceipt(safe_send_tx_hash)
>>> # Link Escrow factory to deployed SafeSendLib instance
>>> LinkedEscrowFactory = EscrowFactory.link_bytecode({"SafeSendLib": to_canonical_address(safe_send_tx_receipt.contractAddress)})

This comment has been minimized.

Copy link
@carver

carver Jul 10, 2019

Collaborator

Having to convert to a canonical address feels out of place now that ethpm is embedded with web3.py. Seems like it should follow the same standard of the rest of web3.py: either a checksummed address or a canonical address is fine.

This comment has been minimized.

Copy link
@njgheorghita

njgheorghita Jul 10, 2019

Author Contributor

Yup, that makes sense - will take care of this in a following pr to keep review of this pr relatively simple


.. py:attribute:: LinkableContract.linked_references
A list of link reference data for the runtime bytecode, if present in the manifest data used to generate a ``LinkableContract`` factory. Runtime bytecode link reference data must be present in a manifest in order to use ``pytest-ethereum``'s ``Deployer`` for a contract which requires bytecode linking.

This comment has been minimized.

Copy link
@carver

carver Jul 10, 2019

Collaborator

Is this second sentence equivalent to:

If you want to use pytest-ethereum's Deployer for a contract, then runtime bytecode link reference data must be present in a manifest.

I still don't know exactly what it means, because I've never used Deployer. But in this phrasing, I know I don't have to worry about it, because I'm not using Deployer.

@@ -9,7 +9,6 @@
'tester': [
"eth-tester[py-evm]==0.1.0-beta.39",
"py-geth>=2.0.1,<3.0.0",
"pytest-ethereum>=0.1.3a6,<1.0.0",

This comment has been minimized.

Copy link
@carver

carver Jul 10, 2019

Collaborator

Sweet

@njgheorghita njgheorghita merged commit 598c852 into ethereum:master Jul 11, 2019

28 checks passed

ci/circleci: doctest Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: py36-core Your tests passed on CircleCI!
Details
ci/circleci: py36-ens Your tests passed on CircleCI!
Details
ci/circleci: py36-ethpm Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-ethtester-pyevm Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-goethereum-http-1.7.2 Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-goethereum-http-1.8.22 Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-goethereum-ipc-1.7.2 Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-goethereum-ipc-1.8.22 Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-goethereum-ws-1.7.2 Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-goethereum-ws-1.8.22 Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-parity-http Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-parity-ipc Your tests passed on CircleCI!
Details
ci/circleci: py36-integration-parity-ws Your tests passed on CircleCI!
Details
ci/circleci: py37-core Your tests passed on CircleCI!
Details
ci/circleci: py37-ens Your tests passed on CircleCI!
Details
ci/circleci: py37-ethpm Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-ethtester-pyevm Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-goethereum-http-1.7.2 Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-goethereum-http-1.8.22 Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-goethereum-ipc-1.7.2 Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-goethereum-ipc-1.8.22 Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-goethereum-ws-1.7.2 Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-goethereum-ws-1.8.22 Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-parity-http Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-parity-ipc Your tests passed on CircleCI!
Details
ci/circleci: py37-integration-parity-ws Your tests passed on CircleCI!
Details

@njgheorghita njgheorghita deleted the njgheorghita:migrate-ethpm branch Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.