mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Splice in project template
I tried to merge it so that future updates from the template will be much easier. The template is hosted at: https://github.com/ethereum/ethereum-python-project-template
This commit is contained in:
59
README.md
59
README.md
@ -1,42 +1,83 @@
|
||||
# py-libp2p [](https://travis-ci.com/libp2p/py-libp2p) [](https://gitter.im/py-libp2p/Lobby) [](https://webchat.freenode.net/?channels=%23libp2p) [](https://riot.permaweb.io/#/room/#libp2p:permaweb.io) [](https://discord.gg/66KBrm2)
|
||||
<<<<<<< HEAD
|
||||
# py-libp2p
|
||||
|
||||
[](https://gitter.im/py-libp2p/Lobby)
|
||||
[](https://travis-ci.com/libp2p/py-libp2p)
|
||||
[](https://badge.fury.io/py/<PYPI_NAME>)
|
||||
[](https://pypi.python.org/pypi/<PYPI_NAME>)
|
||||
[](http://<RTD_NAME>.readthedocs.io/en/latest/?badge=latest)
|
||||
[](https://webchat.freenode.net/?channels=%23libp2p)
|
||||
[](https://riot.permaweb.io/#/room/#libp2p:permaweb.io)
|
||||
[](https://discord.gg/66KBrm2)
|
||||
|
||||
|
||||
<h1 align="center">
|
||||
<img width="250" align="center" src="https://github.com/libp2p/py-libp2p/blob/master/assets/py-libp2p-logo.png?raw=true" alt="py-libp2p hex logo" />
|
||||
<img width="250" align="center" src="https://github.com/libp2p/py-libp2p/blob/master/assets/py-libp2p-logo.png?raw=true" alt="py-libp2p hex logo" />
|
||||
</h1>
|
||||
|
||||
## WARNING
|
||||
py-libp2p is an experimental and work-in-progress repo under heavy development. We do not yet recommend using py-libp2p in production environments.
|
||||
|
||||
<SHORT_DESCRIPTION>
|
||||
|
||||
Read more in the [documentation on ReadTheDocs](https://<RTD_NAME>.readthedocs.io/). [View the change log](https://<RTD_NAME>.readthedocs.io/en/latest/releases.html).
|
||||
|
||||
## Sponsorship
|
||||
This project is graciously sponsored by the Ethereum Foundation through [Wave 5 of their Grants Program](https://blog.ethereum.org/2019/02/21/ethereum-foundation-grants-program-wave-5/).
|
||||
|
||||
## Maintainers
|
||||
The py-libp2p team consists of:
|
||||
|
||||
[@zixuanzh](https://github.com/zixuanzh) [@alexh](https://github.com/alexh) [@stuckinaboot](https://github.com/stuckinaboot) [@robzajac](https://github.com/robzajac)
|
||||
[@zixuanzh](https://github.com/zixuanzh) [@alexh](https://github.com/alexh) [@stuckinaboot](https://github.com/stuckinaboot) [@robzajac](https://github.com/robzajac) [@carver](https://github.com/carver)
|
||||
|
||||
## Development
|
||||
|
||||
py-libp2p requires Python 3.7 and the best way to guarantee a clean Python 3.7 environment is with [`virtualenv`](https://virtualenv.pypa.io/en/stable/)
|
||||
|
||||
```sh
|
||||
git clone git@github.com:ethereum/<REPO_NAME>.git
|
||||
cd <REPO_NAME>
|
||||
virtualenv -p python3.7 venv
|
||||
. venv/bin/activate
|
||||
pip3 install -r requirements_dev.txt
|
||||
python setup.py develop
|
||||
pip install -e .[dev]
|
||||
```
|
||||
|
||||
## Testing
|
||||
### Testing Setup
|
||||
|
||||
During development, you might like to have tests run on every file save.
|
||||
|
||||
Show flake8 errors on file change:
|
||||
|
||||
After installing our requirements (see above), you can:
|
||||
```sh
|
||||
cd tests
|
||||
pytest
|
||||
# Test flake8
|
||||
when-changed -v -s -r -1 <MODULE_NAME>/ tests/ -c "clear; flake8 <MODULE_NAME> tests && echo 'flake8 success' || echo 'error'"
|
||||
```
|
||||
|
||||
Run multi-process tests in one command, but without color:
|
||||
|
||||
```sh
|
||||
# in the project root:
|
||||
pytest --numprocesses=4 --looponfail --maxfail=1
|
||||
# the same thing, succinctly:
|
||||
pytest -n 4 -f --maxfail=1
|
||||
```
|
||||
|
||||
Run in one thread, with color and desktop notifications:
|
||||
|
||||
```sh
|
||||
cd venv
|
||||
ptw --onfail "notify-send -t 5000 'Test failure ⚠⚠⚠⚠⚠' 'python 3 test on <REPO_NAME> failed'" ../tests ../<MODULE_NAME>
|
||||
```
|
||||
|
||||
Note that tests/libp2p/test_libp2p.py contains an end-to-end messaging test between two libp2p hosts, which is the bulk of our proof of concept.
|
||||
|
||||
|
||||
### Release setup
|
||||
|
||||
Releases follow the same basic pattern as releases of some tangentially-related projects,
|
||||
like Trinity. See [Trinity's release instructions](
|
||||
https://trinity-client.readthedocs.io/en/latest/contributing.html#releasing).
|
||||
|
||||
## Requirements
|
||||
|
||||
The protobuf description in this repository was generated by `protoc` at version `3.7.1`.
|
||||
|
||||
Reference in New Issue
Block a user