pyinstaller
This commit is contained in:
parent
42bcf83b2d
commit
9824cbd410
3 changed files with 65 additions and 2 deletions
42
.travis.yml
42
.travis.yml
|
@ -30,3 +30,45 @@ jobs:
|
||||||
- <<: *tests
|
- <<: *tests
|
||||||
name: "Unit Tests w/ Python 3.6"
|
name: "Unit Tests w/ Python 3.6"
|
||||||
python: "3.6"
|
python: "3.6"
|
||||||
|
|
||||||
|
- &build
|
||||||
|
name: "Linux"
|
||||||
|
python: "3.6"
|
||||||
|
install:
|
||||||
|
- pip install pyinstaller
|
||||||
|
- pip install -e .
|
||||||
|
|
||||||
|
script:
|
||||||
|
- pyinstaller -F -n aioupnp aioupnp/__main__.py
|
||||||
|
- chmod +x dist/aioupnp
|
||||||
|
- zip -j dist/aioupnp-${OS}.zip dist/aioupnp
|
||||||
|
|
||||||
|
env: OS=linux
|
||||||
|
addons:
|
||||||
|
artifacts:
|
||||||
|
working_dir: dist
|
||||||
|
paths:
|
||||||
|
- aioupnp-${OS}.zip
|
||||||
|
|
||||||
|
- <<: *build
|
||||||
|
name: "Mac"
|
||||||
|
os: osx
|
||||||
|
osx_image: xcode9.4
|
||||||
|
language: generic
|
||||||
|
env: OS=mac
|
||||||
|
|
||||||
|
- <<: *build
|
||||||
|
name: "Windows"
|
||||||
|
language: generic
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
install:
|
||||||
|
- docker pull cdrx/pyinstaller-windows:python3-32bit
|
||||||
|
script:
|
||||||
|
- docker run -v "$(pwd):/src/aioupnp" cdrx/pyinstaller-windows:python3-32bit aioupnp/wine_build.sh
|
||||||
|
- sudo zip -j dist/aioupnp-windows.zip dist/aioupnp.exe
|
||||||
|
addons:
|
||||||
|
artifacts:
|
||||||
|
working_dir: dist
|
||||||
|
paths:
|
||||||
|
- aioupnp-windows.zip
|
||||||
|
|
|
@ -335,11 +335,17 @@ class UPnP:
|
||||||
kwargs = kwargs or {}
|
kwargs = kwargs or {}
|
||||||
igd_args = igd_args
|
igd_args = igd_args
|
||||||
timeout = int(timeout)
|
timeout = int(timeout)
|
||||||
|
close_loop = False
|
||||||
try:
|
try:
|
||||||
asyncio.get_running_loop()
|
loop = asyncio.get_running_loop()
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
|
close_loop = True
|
||||||
|
if not loop and not close_loop:
|
||||||
|
loop = asyncio.new_event_loop()
|
||||||
|
asyncio.set_event_loop(loop)
|
||||||
|
close_loop = True
|
||||||
|
|
||||||
fut: asyncio.Future = asyncio.Future()
|
fut: asyncio.Future = asyncio.Future()
|
||||||
|
|
||||||
|
@ -374,7 +380,10 @@ class UPnP:
|
||||||
if not hasattr(UPnP, method) or not hasattr(getattr(UPnP, method), "_cli"):
|
if not hasattr(UPnP, method) or not hasattr(getattr(UPnP, method), "_cli"):
|
||||||
fut.set_exception(UPnPError("\"%s\" is not a recognized command" % method))
|
fut.set_exception(UPnPError("\"%s\" is not a recognized command" % method))
|
||||||
wrapper = lambda : None
|
wrapper = lambda : None
|
||||||
asyncio.run(wrapper())
|
|
||||||
|
loop.run_until_complete(wrapper())
|
||||||
|
if close_loop:
|
||||||
|
loop.close()
|
||||||
try:
|
try:
|
||||||
result = fut.result()
|
result = fut.result()
|
||||||
except UPnPError as err:
|
except UPnPError as err:
|
||||||
|
|
12
wine_build.sh
Executable file
12
wine_build.sh
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
set -x
|
||||||
|
|
||||||
|
rm -rf /tmp/.wine-*
|
||||||
|
|
||||||
|
apt-get -qq update
|
||||||
|
apt-get -qq install -y git
|
||||||
|
|
||||||
|
pip install setuptools_scm
|
||||||
|
|
||||||
|
cd aioupnp
|
||||||
|
pip install -e .
|
||||||
|
pyinstaller -F -n aioupnp aioupnp/__main__.py
|
Loading…
Reference in a new issue