Skip to content

Commit

Permalink
spinedb_api\alembic\versions .py files are now added to the installat…
Browse files Browse the repository at this point in the history
…ion bundle as is (not compiled)
  • Loading branch information
ptsavol committed Sep 4, 2019
1 parent 8889da5 commit ca9d683
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ All **notable** changes to this project are documented here.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [0.3-beta.5] - 2019-09-04

### Fixed
- .py files in *spinedb_api\alembic\versions* are now copied to the installation bundle without compiling them to
.pyc files first. Also, if there's a previous version installed, *spinedb_api\alembic* directory is deleted
before installation begins.

## [0.3-beta.4] - 2019-09-03

### Fixed
- NameError: SpineDBAPIError when executing Data Stores
- NameError: SpineDBAPIError when executing Data Stores.
- Removed an unnecessary error dialog in Import Preview widget.
- Added missing modules from *spinedb_api\alembic\versions* package into installation bundle.

Expand Down
3 changes: 2 additions & 1 deletion setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Spine Toolbox"
#define MyAppVersion "0.3-beta.4"
#define MyAppVersion "0.3-beta.5"
#define MyAppPublisher "Spine Project Consortium"
#define MyAppURL "https://github.com/Spine-project"
#define MyAppExeName "spinetoolbox.exe"
Expand Down Expand Up @@ -68,6 +68,7 @@ Name: "{commondesktop}\{#MyAppName} {#MyAppVersion}"; Filename: "{app}\{#MyAppEx

[InstallDelete]
Type: filesandordirs; Name: "{app}\lib\numpy"
Type: filesandordirs; Name: "{app}\lib\spinedb_api\alembic"

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Expand Down
2 changes: 1 addition & 1 deletion spinetoolbox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import sys
import os

SPINE_TOOLBOX_VERSION = "0.3-beta.4"
SPINE_TOOLBOX_VERSION = "0.3-beta.5"
REQUIRED_SPINEDB_API_VERSION = "0.0.36"
# SPINE GREEN HTML: #99cc33 RGBa: 153, 204, 51, 255
# SPINE BLUE HTML: #004ac2 RGBa: 0, 74, 194, 255
Expand Down
20 changes: 17 additions & 3 deletions spinetoolbox/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ def main(argv):
readme_file = os.path.abspath(os.path.join(APPLICATION_PATH, os.path.pardir, "README.md"))
copying_file = os.path.abspath(os.path.join(APPLICATION_PATH, os.path.pardir, "COPYING"))
copying_lesser_file = os.path.abspath(os.path.join(APPLICATION_PATH, os.path.pardir, "COPYING.LESSER"))
alembic_version_files = alembic_files(python_dir)
# Most dependencies are automatically detected but some need to be manually included.
# NOTE: Excluding 'scipy.spatial.cKDTree' and including 'scipy.spatial.ckdtree' is a workaround
# for a bug in cx_Freeze affecting Windows (https://github.com/anthony-tuininga/cx_Freeze/issues/233)
build_exe_options = {
"packages": ["packaging", "pkg_resources", "spinedb_api.alembic"],
"packages": ["packaging", "pkg_resources"],
"excludes": ["scipy.spatial.cKDTree"],
"includes": [
"atexit",
Expand Down Expand Up @@ -84,8 +85,8 @@ def main(argv):
changelog_file,
readme_file,
copying_file,
copying_lesser_file
],
copying_lesser_file,
] + alembic_version_files,
"include_msvcr": True,
}
# Windows specific options
Expand Down Expand Up @@ -114,5 +115,18 @@ def main(argv):
)


def alembic_files(python_dir):
"""Returns a list of tuples of files in python/Lib/site-packages/spinedb_api/alembic/versions.
First item in tuple is the source file. Second item is the relative destination path to the install directory.
"""
dest_dir = os.path.join("lib", "spinedb_api", "alembic", "versions")
p = os.path.join(python_dir, "Lib", "site-packages", "spinedb_api", "alembic", "versions")
files = list()
for f in os.listdir(p):
if f.endswith(".py"):
files.append((os.path.abspath(os.path.join(p, f)), os.path.join(dest_dir, f)))
return files


if __name__ == '__main__':
sys.exit(main(sys.argv))

0 comments on commit ca9d683

Please sign in to comment.