-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
100 additions
and
4 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
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,30 @@ | ||
import os | ||
import platform | ||
import shutil | ||
import subprocess | ||
|
||
from flintrock import __version__ as flintrock_version | ||
|
||
THIS_DIR = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
if __name__ == '__main__': | ||
operating_system = platform.system() | ||
machine_type = platform.machine() | ||
|
||
subprocess.run([ | ||
'pyinstaller', | ||
'--noconfirm', | ||
'--name', 'flintrock', | ||
'--additional-hooks-dir', '.', | ||
'standalone.py'], | ||
check=True) | ||
|
||
shutil.make_archive( | ||
base_name=os.path.join( | ||
THIS_DIR, 'dist', | ||
'flintrock-{v}-{os}-{m}'.format( | ||
v=flintrock_version, | ||
os=operating_system, | ||
m=machine_type)), | ||
format='zip', | ||
root_dir=os.path.join(THIS_DIR, 'dist', 'flintrock')) |
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 @@ | ||
datas=[ | ||
('flintrock/scripts', './scripts'), | ||
('flintrock/templates', './templates'), | ||
('flintrock/config.yaml.template', './'), | ||
] |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
wheel >= 0.26.0 | ||
twine >= 1.6.4 | ||
pypandoc >= 1.1.2 | ||
PyInstaller >= 3.1 |
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,7 +1,10 @@ | ||
# NOTE: Run pip from Flintrock's root directory, not from the directory containing | ||
# this file. | ||
|
||
# Due to: https://github.com/pyinstaller/pyinstaller/issues/1781 | ||
setuptools >= 19.0, <= 19.2 | ||
|
||
# NOTE: The `-e .` syntax lets us reuse the requirements already specified under | ||
# `install_requires` in setup.py. | ||
# See: https://caremad.io/2013/07/setup-vs-requirement/ | ||
setuptools >= 18.8.1 | ||
-e . |
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 @@ | ||
""" | ||
A standalone script for use by PyInstaller. | ||
Users should not be running this script. | ||
""" | ||
|
||
import sys | ||
from flintrock.flintrock import main | ||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
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,20 @@ | ||
import glob | ||
import subprocess | ||
import sys | ||
|
||
# External modules | ||
import pytest | ||
|
||
|
||
@pytest.mark.skipif(sys.version_info < (3, 5), reason="Python 3.5+ is required") | ||
def test_pyinstaller_packaging(): | ||
subprocess.run( | ||
['pip', 'install', '-r', 'requirements/maintainer.pip'], | ||
check=True) | ||
subprocess.run( | ||
['python', 'generate-standalone-package.py'], | ||
check=True) | ||
subprocess.run( | ||
['./dist/flintrock/flintrock'], | ||
check=True) | ||
assert glob.glob('./dist/*.zip') |