Git Product home page Git Product logo

psicalc-viewer's Introduction

PSICalc Viewer

This is the GUI tree viewing system for the psicalc algorithm. For details on the algorithm, see the psicalc package: https://pypi.org/project/psicalc/. You can find prebuilt PSICalc Viewer binaries here.

Building

PSICalc Viewer is supported on macOS, Windows, and Linux. The build system uses just. It's not required but will make your life easier.

macOS

Note: To build a DMG, codesign, etc, you'll need to setup a dotenv file. Copy .build.env to .env and edit accordingly.

Install the prerequisites via Homebrew:

brew install pyenv
brew install pyenv-virtualenv
eval "$(pyenv init -)"

MACOSX_DEPLOYMENT_TARGET=12.5 PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.12.2

Optionally, setup a virtualenv:

pyenv virtualenv 3.12.2 psicalc-viewer
pyenv local psicalc-viewer

The rest:

brew install graphviz
brew install just
brew install create-dmg
pip install -r requirements.txt

When developing locally you can run the app via just run or:

PYTHONPATH=src python3 src/ps_app/main.py

If you want to use a local version of psicalc:

PYTHONPATH=src:../path/to/psicalc-package python3 src/ps_app/main.py

To build the app:

just build

If you need to edit anything in resources/resources.qrc, make sure regenerate with:

just build-resources

To build a DMG:

just build-dmg

See the Justfile for other uses.

Windows

Install the prerequisites via Chocolatey and winget:

choco install pyenv-win
pyenv update
pyenv install 3.12.2
pyenv local 3.12.2
choco install just
choco install graphviz
winget install Microsoft.VisualStudio.2022.BuildTools

Note: When running the Visual Studio Installer, you only need to select "Desktop development with C++". This is a requirement for PyGraphviz.

Optionally, setup a virtualenv:

python -m venv venv
.\venv\Scripts\activate

The rest:

pip install --use-pep517 --config-settings="--global-option=build_ext" --config-settings="--global-option=-IC:\Program Files\Graphviz\include" --config-settings="--global-option=-LC:\Program Files\Graphviz\lib" pygraphviz
pip install -r requirements.txt

When developing locally you can run the app via just run or:

$env:PYTHONPATH = "src"; python .\src\ps_app\main.py

If you want to use a local version of psicalc:

$env:PYTHONPATH = "src;..\psicalc-package\src"; python .\src\ps_app\main.py

To build an exe:

just build

If you need to edit anything in resources/resources.qrc, make sure regenerate with:

just build-resources

See the Justfile for other uses.

Installer is created with InstallForge. Use packaging/psicalc-windows.ifp to start.

Linux

These instructions assume an APT based system. Adjust as needed.

Install the prerequisites:

git clone https://github.com/pyenv/pyenv.git ~/.pyenv
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
eval "$(pyenv init -)"

pyenv install 3.12.2

Optionally, setup a virtualenv:

pyenv virtualenv 3.12.2 psicalc-viewer
pyenv local psicalc-viewer

The rest:

sudo apt install graphviz
sudo apt install just
# make linuxdeploy executable and move into your $PATH
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
pip install -r requirements.txt

When developing locally you can run the app via just run or:

PYTHONPATH=src python3 src/ps_app/main.py

If you want to use a local version of psicalc:

PYTHONPATH=src:../path/to/psicalc-package python3 src/ps_app/main.py

There is an odd issue with PyInstaller and GraphViz currently. In _pyinstaller_hooks_contrib/hooks/stdhooks/hook-pygraphviz.py, you need to replace:

graphviz_bindir = os.path.dirname(os.path.realpath(shutil.which("dot")))

with:

graphviz_bindir = os.path.dirname(shutil.which("dot"))

and ensure the GraphViz path is right in packaging/psicalc-linux.spec.

To build the app:

just build

If you need to edit anything in resources/resources.qrc, make sure regenerate with:

just build-resources

To build an AppImage:

just build-appimage

See the Justfile for other uses.

psicalc-viewer's People

Contributors

thomas-townsley-fortyau avatar marcantonio avatar mandosoft avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.