-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #877 from altendky/pyinstaller_hook
Add PyInstaller hook
- Loading branch information
Showing
9 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
|
||
fspath = getattr(os, 'fspath', str) | ||
|
||
|
||
_pyinstaller_path = Path(__file__).parent | ||
|
||
|
||
def get_hook_dirs(): | ||
return [fspath(_pyinstaller_path)] | ||
|
||
|
||
def get_PyInstaller_tests(): | ||
return [fspath(_pyinstaller_path)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import jpype | ||
|
||
print('+++ about to start JVM') | ||
jpype.startJVM() | ||
print('+++ JVM started') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import jpype | ||
|
||
|
||
fspath = getattr(os, 'fspath', str) | ||
|
||
jar_path = Path(jpype.__file__).parent.parent.joinpath('org.jpype.jar') | ||
|
||
datas = [[fspath(jar_path), '.']] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import os | ||
from pathlib import Path | ||
from subprocess import run | ||
|
||
import jpype | ||
import PyInstaller.__main__ | ||
|
||
|
||
fspath = getattr(os, 'fspath', str) | ||
|
||
|
||
example_path = Path(__file__).parent.joinpath('example.py') | ||
|
||
|
||
def test_start_and_stop(tmp_path): | ||
name = 'e' | ||
dist = tmp_path.joinpath('dist') | ||
work = tmp_path.joinpath('build') | ||
result = dist.joinpath(name, name) | ||
|
||
PyInstaller.__main__.run([ | ||
'--name', | ||
name, | ||
'--distpath', | ||
fspath(dist), | ||
'--workpath', | ||
fspath(work), | ||
fspath(example_path), | ||
]) | ||
|
||
run([fspath(result)], check=True, cwd=fspath(tmp_path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ test=pytest | |
|
||
[tool:pytest] | ||
addopts = --verbose | ||
testpaths = test | ||
testpaths = | ||
test | ||
jpype/_pyinstaller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pytest==4.6.9 | ||
pyinstaller==4.0 | ||
jedi==0.17.0 |