Skip to content

Commit c820451

Browse files
committed
Add pyinstaller exe generation script
1 parent d5bc420 commit c820451

File tree

7 files changed

+64
-11
lines changed

7 files changed

+64
-11
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
include requirements.txt
12
recursive-include example *
23
recursive-include pynetworktables2js/js *

README.rst

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ Documentation can be found at http://pynetworktables2js.readthedocs.org/
2323
Installation
2424
============
2525

26+
Easy install (Windows only)
27+
---------------------------
28+
29+
1. Download the latest pynetworktables2js.exe from github at
30+
https://github.com/robotpy/pynetworktables2js/releases .
31+
2. Copy the
32+
33+
.. note:: By default, it will connect to 127.0.0.1. To connect to a robot,
34+
you will need to pass the exe arguments to tell it where the robot is.
35+
Use --help to see the available options.
36+
37+
Manual install
38+
--------------
39+
2640
Make sure to install python 2 or 3 on your computer, and on Windows you can
2741
execute::
2842

@@ -56,13 +70,6 @@ those resources to make something cool to control your robot?
5670
Usage
5771
=====
5872

59-
There are two example servers distributed with pynetworktables2js, one that
60-
uses `tornado <http://www.tornadoweb.org/en/stable/>`_, and one that uses
61-
`aiohttp <https://github.com/KeepSafe/aiohttp>`_. Either one should work.
62-
63-
No-copy server
64-
--------------
65-
6673
You can just distribute your HTML files, and run a pynetworktables server
6774
using the following command from inside the directory::
6875

@@ -80,6 +87,10 @@ browser (I recommend Chrome) to http://127.0.0.1:8888 and see your website.
8087
Customized python server
8188
------------------------
8289

90+
There are two example servers distributed with pynetworktables2js, one that
91+
uses `tornado <http://www.tornadoweb.org/en/stable/>`_, and one that uses
92+
`aiohttp <https://github.com/KeepSafe/aiohttp>`_. Either one should work.
93+
8394
Go to the 'example' directory distributed with pynetworktables2js, and run::
8495

8596
python tornado_server.py --robot 127.0.0.1

build_exe.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
#
3+
# Builds a pyinstaller-based Windows exe for pynetworktables2js
4+
#
5+
6+
cd $(dirname $0)
7+
docker run --rm -v "$(pwd):/src:Z" -e PYTHONPATH=/src cdrx/pyinstaller-windows:python2

pyinstaller/shim.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env python
2+
3+
from pynetworktables2js.__main__ import main
4+
5+
if __name__ == '__main__':
6+
main()

pynetworktables2js.spec

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# -*- mode: python -*-
2+
3+
block_cipher = None
4+
5+
a = Analysis(['pyinstaller/shim.py'],
6+
binaries=[],
7+
datas=[('pynetworktables2js/js/*', 'pynetworktables2js/js')],
8+
hiddenimports=[],
9+
hookspath=[],
10+
runtime_hooks=[],
11+
excludes=[],
12+
win_no_prefer_redirects=False,
13+
win_private_assemblies=False,
14+
cipher=block_cipher)
15+
pyz = PYZ(a.pure, a.zipped_data,
16+
cipher=block_cipher)
17+
exe = EXE(pyz,
18+
a.scripts,
19+
a.binaries,
20+
a.zipfiles,
21+
a.datas,
22+
name='pynetworktables2js',
23+
debug=False,
24+
strip=False,
25+
upx=True,
26+
console=True )

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tornado>=4.0
2+
pynetworktables>=2017.0.5

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
with open(join(setup_dir, 'README.rst'), 'r') as readme_file:
4040
long_description = readme_file.read()
4141

42+
with open(join(setup_dir, 'requirements.txt')) as fp:
43+
install_requires = fp.readlines()
44+
4245
setup(
4346
name='pynetworktables2js',
4447
version=__version__,
@@ -51,10 +54,7 @@
5154
packages=find_packages(),
5255
include_package_data=True,
5356
zip_safe=False,
54-
install_requires=[
55-
'tornado>=4.0',
56-
'pynetworktables>=2017.0.0a1'
57-
],
57+
install_requires=install_requires,
5858
entry_points={'console_scripts': [ 'pynetworktables2js = pynetworktables2js.__main__:main' ]},
5959
license="BSD License",
6060
classifiers=[

0 commit comments

Comments
 (0)