-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '0.8-dev' into 2629_merge_0.8
- Loading branch information
Showing
620 changed files
with
19,951 additions
and
18,137 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,63 @@ | ||
# Workflow stub to build Toolbox bundles. | ||
name: PyInstaller Bundle | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
bundle: | ||
name: Bundle | ||
strategy: | ||
fail-fast: True | ||
matrix: | ||
python-version: ["3.11"] | ||
os: [windows-latest] | ||
runs-on: windows-latest | ||
steps: | ||
- name: Print notification | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
cache: pip | ||
- name: Install dependencies | ||
run: | | ||
echo "This workflow is stub and does not do anything meaningful." | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
- name: Run tests | ||
run: | | ||
python -m unittest discover --verbose | ||
- name: Install PyInstaller | ||
run: | | ||
python -m pip install PyInstaller | ||
- name: Download embeddable Python | ||
run: | | ||
mkdir embedded-python | ||
cd embedded-python | ||
curl -o python.zip https://www.python.org/ftp/python/3.11.9/python-3.11.9-embed-amd64.zip | ||
tar xf python.zip | ||
del python.zip | ||
- name: Build bundle | ||
run: | | ||
python -m PyInstaller spinetoolbox.spec -- --embedded-python=embedded-python | ||
- name: Get Toolbox version | ||
id: toolbox-version | ||
shell: bash | ||
run: | | ||
python -c "from importlib.metadata import version; print('version=' + version('spinetoolbox'))" >> $GITHUB_OUTPUT | ||
- name: Upload archive | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Spine Toolbox ${{ steps.toolbox-version.outputs.version }} | ||
path: dist | ||
if-no-files-found: error | ||
overwrite: true | ||
update-downloads-page: | ||
name: Trigger Downloads page generation | ||
needs: bundle | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Trigger workflow | ||
run: | | ||
curl -L \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.DOWNLOADS_TRIGGER_TOKEN }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/spine-tools/Downloads/actions/workflows/generate_readme.yml/dispatches \ | ||
-d '{"ref":"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
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,3 @@ | ||
from PyInstaller.utils.hooks import collect_data_files | ||
|
||
datas = collect_data_files("datapackage") |
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,3 @@ | ||
from PyInstaller.utils.hooks import collect_data_files | ||
|
||
datas = collect_data_files("jill", subdir="config") |
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 @@ | ||
from PyInstaller.utils.hooks import collect_data_files | ||
|
||
datas = collect_data_files( | ||
"spine_engine", subdir="execution_managers", includes=("spine_repl.*",), include_py_files=True | ||
) |
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,3 @@ | ||
from PyInstaller.utils.hooks import collect_data_files | ||
|
||
datas = collect_data_files("spinedb_api", subdir="alembic", include_py_files=True) |
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,6 @@ | ||
from PyInstaller.utils.hooks import collect_data_files | ||
|
||
package = "tableschema" | ||
|
||
datas = collect_data_files(package) | ||
datas += collect_data_files(package, subdir="profiles") |
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 @@ | ||
from PyInstaller.utils.hooks import collect_data_files | ||
|
||
datas = collect_data_files("tabulator") | ||
datas += collect_data_files("tabulator", subdir="loaders", include_py_files=True) | ||
datas += collect_data_files("tabulator", subdir="parsers", include_py_files=True) |
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
Empty file.
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,61 @@ | ||
""" | ||
This script benchmarks CompoundModelBase.filter_accepts_model(). | ||
""" | ||
import os | ||
import sys | ||
|
||
if sys.platform == "win32" and "HOMEPATH" not in os.environ: | ||
import pathlib | ||
os.environ["HOMEPATH"] = str(pathlib.Path(sys.executable).parent) | ||
|
||
import time | ||
from typing import Optional | ||
import pyperf | ||
from PySide6.QtCore import QSettings | ||
from PySide6.QtWidgets import QApplication | ||
from benchmarks.utils import StdOutLogger | ||
from spinetoolbox.spine_db_manager import SpineDBManager | ||
from spinetoolbox.spine_db_editor.mvcmodels.compound_models import CompoundModelBase, CompoundParameterValueModel | ||
from spinetoolbox.spine_db_editor.mvcmodels.single_models import SingleModelBase | ||
|
||
|
||
def call_filter_accepts_model( | ||
loops: int, compound_model: CompoundModelBase, single_model: SingleModelBase | ||
) -> float: | ||
duration = 0.0 | ||
for _ in range(loops): | ||
start = time.perf_counter() | ||
compound_model.filter_accepts_model(single_model) | ||
duration += time.perf_counter() - start | ||
return duration | ||
|
||
|
||
def run_benchmark(output_file: Optional[str]): | ||
if not QApplication.instance(): | ||
QApplication() | ||
db_mngr = SpineDBManager(QSettings(), parent=None) | ||
logger = StdOutLogger() | ||
db_map = db_mngr.get_db_map("sqlite://", logger, create=True) | ||
entity_class, error = db_map.add_entity_class_item(name="Object") | ||
assert error is None | ||
db_map.add_entity_class_item(name="Subject") | ||
relationship_class, error = db_map.add_entity_class_item(name="Object__Subject", dimension_name_list=("Object", "Subject")) | ||
assert error is None | ||
compound_model = CompoundParameterValueModel(None, db_mngr, db_map) | ||
compound_model.set_filter_class_ids({db_map: {entity_class["id"]}}) | ||
single_model = SingleModelBase(compound_model, db_map, relationship_class["id"], committed=False) | ||
runner = pyperf.Runner() | ||
benchmark = runner.bench_time_func( | ||
"CompoundModelBase.filter_accepts_model[filter by class ids]", | ||
call_filter_accepts_model, | ||
compound_model, | ||
single_model | ||
) | ||
if output_file: | ||
pyperf.add_runs(output_file, benchmark) | ||
db_mngr.close_all_sessions() | ||
db_mngr.deleteLater() | ||
|
||
|
||
if __name__ == "__main__": | ||
run_benchmark(output_file="") |
Oops, something went wrong.