From 483c9f1819a616ac698595960dad9552b8940452 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:29:51 -0400 Subject: [PATCH 01/17] Update environment-Windows.yml --- environments/environment-Windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environments/environment-Windows.yml b/environments/environment-Windows.yml index 7faeba0ee..eb846dee2 100644 --- a/environments/environment-Windows.yml +++ b/environments/environment-Windows.yml @@ -20,3 +20,4 @@ dependencies: - hdmf >= 3.7.0 - pytest == 7.2.2 - pytest-cov == 4.1.0 + - email-validator == 2.0.0 From 19781793d74a6c0fd4e61756bf641e4713f03f13 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:30:23 -0400 Subject: [PATCH 02/17] add hidden import --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bad2cfe3e..45d4c17ae 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "build:win": "npm run build && npm run build:flask:win && npm run build:electron:win", "build:mac": "npm run build && npm run build:flask:unix && npm run build:electron:mac", "build:linux": "npm run build && npm run build:flask:unix && npm run build:electron:linux", - "build:flask:base": "python -m PyInstaller --name nwb-guide --onedir --clean --noconfirm ./pyflask/app.py --distpath ./build/flask --collect-data jsonschema_specifications --collect-all nwbinspector --collect-all neuroconv --collect-all pynwb --collect-all hdmf --collect-all ci_info --hidden-import scipy._distributor_init --hidden-import scipy._lib.messagestream --hidden-import scipy._lib._ccallback --hidden-import scipy._lib._testutils", + "build:flask:base": "python -m PyInstaller --name nwb-guide --onedir --clean --noconfirm ./pyflask/app.py --distpath ./build/flask --collect-data jsonschema_specifications --collect-all nwbinspector --collect-all neuroconv --collect-all pynwb --collect-all hdmf --collect-all ci_info --hidden-import scipy._distributor_init --hidden-import scipy._lib.messagestream --hidden-import scipy._lib._ccallback --hidden-import scipy._lib._testutils --hidden-import email_validator", "build:flask:win": "npm run build:flask:base -- --add-data ./paths.config.json;. --add-data ./package.json;.", "build:flask:unix": "npm run build:flask:base -- --add-data ./paths.config.json:. --add-data ./package.json:. --collect-all ndx_dandi_icephys", "build:electron:win": "electron-builder build --win --publish never", From afa547e2630738530fe3e8f587890dfdcd17ca12 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:48:32 -0400 Subject: [PATCH 03/17] past the pydantic problem; add schema files for ndx_dandi_icephys --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45d4c17ae..e61702881 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "build:win": "npm run build && npm run build:flask:win && npm run build:electron:win", "build:mac": "npm run build && npm run build:flask:unix && npm run build:electron:mac", "build:linux": "npm run build && npm run build:flask:unix && npm run build:electron:linux", - "build:flask:base": "python -m PyInstaller --name nwb-guide --onedir --clean --noconfirm ./pyflask/app.py --distpath ./build/flask --collect-data jsonschema_specifications --collect-all nwbinspector --collect-all neuroconv --collect-all pynwb --collect-all hdmf --collect-all ci_info --hidden-import scipy._distributor_init --hidden-import scipy._lib.messagestream --hidden-import scipy._lib._ccallback --hidden-import scipy._lib._testutils --hidden-import email_validator", + "build:flask:base": "python -m PyInstaller --name nwb-guide --onedir --clean --noconfirm ./pyflask/app.py --distpath ./build/flask --collect-data jsonschema_specifications --collect-all nwbinspector --collect-all neuroconv --collect-all pynwb --collect-all hdmf --collect-all ci_info --collect-all ndx_dandi_icephys --hidden-import scipy._distributor_init --hidden-import scipy._lib.messagestream --hidden-import scipy._lib._ccallback --hidden-import scipy._lib._testutils --hidden-import email_validator", "build:flask:win": "npm run build:flask:base -- --add-data ./paths.config.json;. --add-data ./package.json;.", "build:flask:unix": "npm run build:flask:base -- --add-data ./paths.config.json:. --add-data ./package.json:. --collect-all ndx_dandi_icephys", "build:electron:win": "electron-builder build --win --publish never", From 25ac15ea3fdccacd0e3881eeb3e2d8bf53595add Mon Sep 17 00:00:00 2001 From: Garrett Date: Thu, 7 Sep 2023 10:05:35 -0700 Subject: [PATCH 04/17] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e61702881..faf9ccdf7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "npm run test:app && npm run test:server", "test:app": "vitest run", "test:server": "pytest pyflask/tests/ -s", - "test:executable": "concurrently -n EXE,TEST --kill-others \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"pytest pyflask/tests/ -s --target http://localhost:3434\"", + "test:executable": "concurrently -n EXE,TEST --kill-others-on-fail --success last \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"pytest pyflask/tests/ -s --target http://localhost:3434\"", "test:coverage": "npm run coverage:app && npm run coverage:server", "coverage:app": "vitest run --coverage", "coverage:server": "pytest pyflask/tests/ -s --cov=pyflask --cov-report=xml", From e8addf014413944bd794d9cc29d1ad376602768e Mon Sep 17 00:00:00 2001 From: Garrett Date: Thu, 7 Sep 2023 10:20:19 -0700 Subject: [PATCH 05/17] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index faf9ccdf7..5eb1fa7f2 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "npm run test:app && npm run test:server", "test:app": "vitest run", "test:server": "pytest pyflask/tests/ -s", - "test:executable": "concurrently -n EXE,TEST --kill-others-on-fail --success last \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"pytest pyflask/tests/ -s --target http://localhost:3434\"", + "test:executable": "concurrently -n EXE,TEST --kill-others --success last \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"pytest pyflask/tests/ -s --target http://localhost:3434\"", "test:coverage": "npm run coverage:app && npm run coverage:server", "coverage:app": "vitest run --coverage", "coverage:server": "pytest pyflask/tests/ -s --cov=pyflask --cov-report=xml", From 18280d486bf13da7663781af64829ccd6e5a7a64 Mon Sep 17 00:00:00 2001 From: Garrett Date: Thu, 7 Sep 2023 11:10:24 -0700 Subject: [PATCH 06/17] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5eb1fa7f2..e69551d9b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "npm run test:app && npm run test:server", "test:app": "vitest run", "test:server": "pytest pyflask/tests/ -s", - "test:executable": "concurrently -n EXE,TEST --kill-others --success last \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"pytest pyflask/tests/ -s --target http://localhost:3434\"", + "test:executable": "concurrently -n EXE,TEST --kill-others --success all \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"pytest pyflask/tests/ -s --target http://localhost:3434\"", "test:coverage": "npm run coverage:app && npm run coverage:server", "coverage:app": "vitest run --coverage", "coverage:server": "pytest pyflask/tests/ -s --cov=pyflask --cov-report=xml", From 40c3c17b0ce7dafdcc4ada4387af2b6c5892e8c8 Mon Sep 17 00:00:00 2001 From: Garrett Date: Thu, 7 Sep 2023 11:30:59 -0700 Subject: [PATCH 07/17] kill gracefully --- package.json | 2 +- tests/testPyinstallerExecutable.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e69551d9b..e61702881 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "npm run test:app && npm run test:server", "test:app": "vitest run", "test:server": "pytest pyflask/tests/ -s", - "test:executable": "concurrently -n EXE,TEST --kill-others --success all \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"pytest pyflask/tests/ -s --target http://localhost:3434\"", + "test:executable": "concurrently -n EXE,TEST --kill-others \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"pytest pyflask/tests/ -s --target http://localhost:3434\"", "test:coverage": "npm run coverage:app && npm run coverage:server", "coverage:app": "vitest run --coverage", "coverage:server": "pytest pyflask/tests/ -s --cov=pyflask --cov-report=xml", diff --git a/tests/testPyinstallerExecutable.js b/tests/testPyinstallerExecutable.js index 4611dba7a..fffab8b7a 100644 --- a/tests/testPyinstallerExecutable.js +++ b/tests/testPyinstallerExecutable.js @@ -52,5 +52,11 @@ function handleProcess(proc, id = "process") { console.error(`[${id}] Exit: ${code}`); error(); }); + + process.once('SIGTERM', () => { + proc.kill(0) + process.exit(0) + }) // Exit gracefully if this is caught + } else console.error("child process failed to start on port" + port); } From fa3f445c100c7d3887873f74defd272ed407dcc9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 18:32:21 +0000 Subject: [PATCH 08/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/testPyinstallerExecutable.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/testPyinstallerExecutable.js b/tests/testPyinstallerExecutable.js index fffab8b7a..a8dfb910e 100644 --- a/tests/testPyinstallerExecutable.js +++ b/tests/testPyinstallerExecutable.js @@ -53,10 +53,9 @@ function handleProcess(proc, id = "process") { error(); }); - process.once('SIGTERM', () => { - proc.kill(0) - process.exit(0) - }) // Exit gracefully if this is caught - + process.once("SIGTERM", () => { + proc.kill(0); + process.exit(0); + }); // Exit gracefully if this is caught } else console.error("child process failed to start on port" + port); } From 6db9bcb37a6fcb84ad9eb06caefdbc8ab9c2fdb1 Mon Sep 17 00:00:00 2001 From: Garrett Date: Thu, 7 Sep 2023 12:38:45 -0700 Subject: [PATCH 09/17] Update testPyinstallerExecutable.js --- tests/testPyinstallerExecutable.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testPyinstallerExecutable.js b/tests/testPyinstallerExecutable.js index a8dfb910e..d8ff46469 100644 --- a/tests/testPyinstallerExecutable.js +++ b/tests/testPyinstallerExecutable.js @@ -54,8 +54,10 @@ function handleProcess(proc, id = "process") { }); process.once("SIGTERM", () => { + console.log('GOT SIGTERM!!!!') proc.kill(0); process.exit(0); }); // Exit gracefully if this is caught + } else console.error("child process failed to start on port" + port); } From b77f2c6091e58254dd5131714cf144d129bea0fd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 19:39:01 +0000 Subject: [PATCH 10/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/testPyinstallerExecutable.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/testPyinstallerExecutable.js b/tests/testPyinstallerExecutable.js index d8ff46469..7a59e3582 100644 --- a/tests/testPyinstallerExecutable.js +++ b/tests/testPyinstallerExecutable.js @@ -54,10 +54,9 @@ function handleProcess(proc, id = "process") { }); process.once("SIGTERM", () => { - console.log('GOT SIGTERM!!!!') + console.log("GOT SIGTERM!!!!"); proc.kill(0); process.exit(0); }); // Exit gracefully if this is caught - } else console.error("child process failed to start on port" + port); } From ad7c74e6692903296cf10a41115e85c35c7d5561 Mon Sep 17 00:00:00 2001 From: Garrett Date: Thu, 7 Sep 2023 13:00:10 -0700 Subject: [PATCH 11/17] Update testPyinstallerExecutable.js --- tests/testPyinstallerExecutable.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/testPyinstallerExecutable.js b/tests/testPyinstallerExecutable.js index d8ff46469..c8fd00864 100644 --- a/tests/testPyinstallerExecutable.js +++ b/tests/testPyinstallerExecutable.js @@ -26,6 +26,13 @@ const regex = /.+Error: .+/; function handleProcess(proc, id = "process") { if (proc != null) { + + process.on("SIGTERM", () => { + console.log('GOT SIGTERM!!!!') + proc.kill(0); + process.exit(0); + }); // Exit gracefully if this is caught + // Listen for errors from Python process proc.stderr.on("data", function (data) { const message = data.toString(); @@ -53,11 +60,5 @@ function handleProcess(proc, id = "process") { error(); }); - process.once("SIGTERM", () => { - console.log('GOT SIGTERM!!!!') - proc.kill(0); - process.exit(0); - }); // Exit gracefully if this is caught - } else console.error("child process failed to start on port" + port); } From 496fdee5ac3807a845da846768d4390fd30b28fa Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn <46533749+GarrettMFlynn@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:53:48 -0700 Subject: [PATCH 12/17] Wait to ensure server has started --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e61702881..de1b1d6b2 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "test": "npm run test:app && npm run test:server", "test:app": "vitest run", "test:server": "pytest pyflask/tests/ -s", - "test:executable": "concurrently -n EXE,TEST --kill-others \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"pytest pyflask/tests/ -s --target http://localhost:3434\"", + "wait3s": "node -e \"setTimeout(() => process.exit(0),3000)\"", + "test:executable": "concurrently -n EXE,TEST --kill-others \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"npm run wait3s && pytest pyflask/tests/ -s --target http://localhost:3434\"", "test:coverage": "npm run coverage:app && npm run coverage:server", "coverage:app": "vitest run --coverage", "coverage:server": "pytest pyflask/tests/ -s --cov=pyflask --cov-report=xml", From 412c1a1ee66aab807ff1c46a4249d475f0fcb50e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 21:56:15 +0000 Subject: [PATCH 13/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/testPyinstallerExecutable.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/testPyinstallerExecutable.js b/tests/testPyinstallerExecutable.js index c8fd00864..1135eaf99 100644 --- a/tests/testPyinstallerExecutable.js +++ b/tests/testPyinstallerExecutable.js @@ -26,13 +26,12 @@ const regex = /.+Error: .+/; function handleProcess(proc, id = "process") { if (proc != null) { - process.on("SIGTERM", () => { - console.log('GOT SIGTERM!!!!') + console.log("GOT SIGTERM!!!!"); proc.kill(0); process.exit(0); }); // Exit gracefully if this is caught - + // Listen for errors from Python process proc.stderr.on("data", function (data) { const message = data.toString(); @@ -59,6 +58,5 @@ function handleProcess(proc, id = "process") { console.error(`[${id}] Exit: ${code}`); error(); }); - } else console.error("child process failed to start on port" + port); } From 603fba6b64eb95c1b405fefaa8fce530f0b22ec8 Mon Sep 17 00:00:00 2001 From: Garrett Date: Thu, 7 Sep 2023 15:29:13 -0700 Subject: [PATCH 14/17] Test locally until it works --- package.json | 2 +- tests/testPyinstallerExecutable.js | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/package.json b/package.json index de1b1d6b2..6d545d081 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "test:app": "vitest run", "test:server": "pytest pyflask/tests/ -s", "wait3s": "node -e \"setTimeout(() => process.exit(0),3000)\"", - "test:executable": "concurrently -n EXE,TEST --kill-others \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"npm run wait3s && pytest pyflask/tests/ -s --target http://localhost:3434\"", + "test:executable": "concurrently -n EXE,TEST --kill-others --success first \"node tests/testPyinstallerExecutable.js --port 3434 --forever\" \"npm run wait3s && pytest pyflask/tests/ -s --target http://localhost:3434\"", "test:coverage": "npm run coverage:app && npm run coverage:server", "coverage:app": "vitest run --coverage", "coverage:server": "pytest pyflask/tests/ -s --cov=pyflask --cov-report=xml", diff --git a/tests/testPyinstallerExecutable.js b/tests/testPyinstallerExecutable.js index c8fd00864..cf1deec14 100644 --- a/tests/testPyinstallerExecutable.js +++ b/tests/testPyinstallerExecutable.js @@ -27,12 +27,6 @@ const regex = /.+Error: .+/; function handleProcess(proc, id = "process") { if (proc != null) { - process.on("SIGTERM", () => { - console.log('GOT SIGTERM!!!!') - proc.kill(0); - process.exit(0); - }); // Exit gracefully if this is caught - // Listen for errors from Python process proc.stderr.on("data", function (data) { const message = data.toString(); From e6dc9684ea036199eea425012289682ce8be8837 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 22:29:48 +0000 Subject: [PATCH 15/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/testPyinstallerExecutable.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/testPyinstallerExecutable.js b/tests/testPyinstallerExecutable.js index 2b44cb542..4611dba7a 100644 --- a/tests/testPyinstallerExecutable.js +++ b/tests/testPyinstallerExecutable.js @@ -26,7 +26,6 @@ const regex = /.+Error: .+/; function handleProcess(proc, id = "process") { if (proc != null) { - // Listen for errors from Python process proc.stderr.on("data", function (data) { const message = data.toString(); From 0a9a521299e988d3e3b8be3693e0ec949723405b Mon Sep 17 00:00:00 2001 From: rly Date: Fri, 8 Sep 2023 11:02:01 +0200 Subject: [PATCH 16/17] Try adjustment to mac env --- environments/environment-MAC.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/environments/environment-MAC.yml b/environments/environment-MAC.yml index cd76d4596..b2333fa86 100644 --- a/environments/environment-MAC.yml +++ b/environments/environment-MAC.yml @@ -1,11 +1,11 @@ name: nwb-guide channels: - - defaults - conda-forge + - defaults dependencies: - - python = 3.9.17 - - nodejs = 18.16.1 + - python = 3.9.18 - PyInstaller = 5.13.0 + - nodejs = 18.16.1 - numcodecs = 0.11.0 - jsonschema = 4.18.0 # this installs jsonschema-specifications which is needed for validation - pydantic[email] = 2.0.2 # email validator is used by dandi @@ -14,9 +14,7 @@ dependencies: - chardet == 5.1.0 - configparser == 6.0.0 - flask == 2.3.2 - - flask-cors === 3.0.10 + - flask-cors == 4.0.0 - flask_restx == 1.1.0 - neuroconv @ git+https://github.com/catalystneuro/neuroconv.git@main#neuroconv[full] - - hdmf >= 3.7.0 - - pytest == 7.2.2 - - pytest-cov == 4.1.0 + - pytest == 7.4.0 From aa88b9f97258ba6d72332c360fbd8d84b4019c50 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 8 Sep 2023 06:37:43 -0700 Subject: [PATCH 17/17] Discard changes to environments/environment-MAC.yml --- environments/environment-MAC.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/environments/environment-MAC.yml b/environments/environment-MAC.yml index b2333fa86..cd76d4596 100644 --- a/environments/environment-MAC.yml +++ b/environments/environment-MAC.yml @@ -1,11 +1,11 @@ name: nwb-guide channels: - - conda-forge - defaults + - conda-forge dependencies: - - python = 3.9.18 - - PyInstaller = 5.13.0 + - python = 3.9.17 - nodejs = 18.16.1 + - PyInstaller = 5.13.0 - numcodecs = 0.11.0 - jsonschema = 4.18.0 # this installs jsonschema-specifications which is needed for validation - pydantic[email] = 2.0.2 # email validator is used by dandi @@ -14,7 +14,9 @@ dependencies: - chardet == 5.1.0 - configparser == 6.0.0 - flask == 2.3.2 - - flask-cors == 4.0.0 + - flask-cors === 3.0.10 - flask_restx == 1.1.0 - neuroconv @ git+https://github.com/catalystneuro/neuroconv.git@main#neuroconv[full] - - pytest == 7.4.0 + - hdmf >= 3.7.0 + - pytest == 7.2.2 + - pytest-cov == 4.1.0