From 3591a0b4c42fde91fad156c809047b7c619e06ed Mon Sep 17 00:00:00 2001
From: Kenneth Yang <82800265+kjy5@users.noreply.github.com>
Date: Fri, 19 Jan 2024 16:25:34 -0800
Subject: [PATCH] 224 make executable (#285)
* Create env to build
* Make PyInstaller spec
* Working exe on py12
* Updated Pathfinder version support
* Add hatch env script
---
.gitignore | 1 -
README.md | 8 ++++----
ephys_link.spec | 43 +++++++++++++++++++++++++++++++++++++++++++
pyproject.toml | 8 ++++++++
4 files changed, 55 insertions(+), 5 deletions(-)
create mode 100644 ephys_link.spec
diff --git a/.gitignore b/.gitignore
index 6481a5a..fcf5bd3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,7 +32,6 @@ MANIFEST
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
-*.spec
# Installer logs
pip-log.txt
diff --git a/README.md b/README.md
index 8aed4dc..33db6c8 100644
--- a/README.md
+++ b/README.md
@@ -16,10 +16,10 @@ to communicate with manipulators used in electrophysiology experiments.
**Supported Manipulators:**
-| Manufacturer | Model |
-|--------------|-------------------------------------------------------------------|
-| Sensapex |
|
-| New Scale | - Pathfinder MPM Control
- M3-USB-3:1-EP
|
+| Manufacturer | Model |
+|--------------|---------------------------------------------------------------------------|
+| Sensapex | |
+| New Scale | - Pathfinder MPM Control v2.8.8+
- M3-USB-3:1-EP
|
Ephys Link is an open and extensible platform. It is designed to easily support integration with other manipulators.
diff --git a/ephys_link.spec b/ephys_link.spec
new file mode 100644
index 0000000..d015858
--- /dev/null
+++ b/ephys_link.spec
@@ -0,0 +1,43 @@
+# -*- mode: python ; coding: utf-8 -*-
+
+
+a = Analysis(
+ ['src\\ephys_link\\__main__.py'],
+ pathex=[],
+ binaries=[('src\\ephys_link\\resources', 'ephys_link\\resources')],
+ datas=[],
+ hiddenimports=['engineio.async_drivers.aiohttp', 'engineio.async_aiohttp'],
+ hookspath=[],
+ hooksconfig={},
+ runtime_hooks=[],
+ excludes=[],
+ noarchive=False,
+)
+pyz = PYZ(a.pure)
+
+exe = EXE(
+ pyz,
+ a.scripts,
+ [],
+ exclude_binaries=True,
+ name='ephys_link',
+ debug=False,
+ bootloader_ignore_signals=False,
+ strip=False,
+ upx=True,
+ console=True,
+ disable_windowed_traceback=False,
+ argv_emulation=False,
+ target_arch=None,
+ codesign_identity=None,
+ entitlements_file=None,
+)
+coll = COLLECT(
+ exe,
+ a.binaries,
+ a.datas,
+ strip=False,
+ upx=True,
+ upx_exclude=[],
+ name='ephys_link',
+)
diff --git a/pyproject.toml b/pyproject.toml
index bb7029c..73c7873 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -82,6 +82,14 @@ dependencies = [
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:src/ephys_link tests}"
+[tool.hatch.envs.exe]
+python = "3.12"
+dependencies = [
+ "pyinstaller==6.3.0",
+]
+[tool.hatch.envs.exe.scripts]
+build = "pyinstaller.exe ephys_link.spec -y"
+
[tool.coverage.run]
source_pkgs = ["ephys_link", "tests"]
branch = true