README.rst
1pyenet
2======
3
4pyenet is a python wrapper for the ENet library by Lee Salzman,
5http://enet.bespin.org
6
7It was originally written by Scott Robinson scott@tranzoa.com and is
8currently maintained by Andrew Resch andrewresch@gmail.com
9
10This fork is being maintained by the piqueserver team for purposes of
11including patches for bugs found while developing piqueserver, and to
12provide a package on pypi.
13
14License
15-------
16
17pyenet is licensed under the BSD license, see LICENSE for details. enet
18is licensed under the MIT license, see
19http://enet.bespin.org/License.html
20
21Dependencies
22------------
23
24Building pyenet requires all the same dependencies as enet plus Cython
25and, obviously, Python.
26
27Installation
28------------
29
30From pypi
31~~~~~~~~~
32
33::
34
35 pip install pyenet
36
37Manually from git
38~~~~~~~~~~~~~~~~~
39
40Note: the enet sources are automatically downloaded from
41http://enet.bespin.org/ by ``setup.py``.
42
43This version of pyenet requires enet 1.3.
44
45Run the setup.py build:
46
47::
48
49 $ python setup.py build
50
51Once that is complete, install the new pyenet module:
52
53::
54
55 # python setup.py install
56
57Packaging notes
58---------------
59
60- update package version in ``setup.py``
61- create a virtualenv
62 (``python3 -m venv venv && source venv/bin/activate``)
63- install the requirements: ``pip install -r dev-requirements.txt``
64- build the source dist: ``python setup.py sdist``
65- make sure docker is installed and running and you're on a 64bit linux
66 machine
67- build the binary dists: ``./scripts/build_packages.sh``
68- upload to pypi: ``twine upload dist/* wheelhouse/pyenet*``
69- commit, tag, push to github
70
71Usage
72-----
73
74Once you have installed pyenet, you only need to import the enet module
75to start using enet in your project.
76
77Example server:
78
79::
80
81 >>> import enet
82 >>> host = enet.Host(enet.Address("localhost", 33333), 1, 0, 0)
83 >>> event = host.service(0)
84
85Example client:
86
87::
88
89 >>> import enet
90 >>> host = enet.Host(None, 1, 0, 0)
91 >>> peer = host.connect(enet.Address("localhost", 33333), 1)
92
93More information on usage can be obtained from:
94http://enet.bespin.org/Tutorial.html
95