From 6a1411f988128c29a8eededb43e75789c3c8a1c9 Mon Sep 17 00:00:00 2001 From: ddelpiano Date: Tue, 22 Oct 2024 15:44:38 +0200 Subject: [PATCH] updating readme with the packaging information --- README.md | 168 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 117 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 768c05b4..b017bd3a 100644 --- a/README.md +++ b/README.md @@ -1,95 +1,161 @@ -# Production installation +# Installing on Linux -## Pre installation +Download bash script to install [here](https://raw.githubusercontent.com/MetaCell/PsyNeuLinkView/feature/PSYNEU-140/package/linux_installer.sh). +It's recommended to download it in your home directory. -This application comes with a requirement for node [version 16.16](https://nodejs.org/en/blog/release/v16.16.0), please install that node version or nvm ([macos installation](https://aws.plainenglish.io/how-to-install-nvm-on-a-mac-8c1e9d1adc17) or [linux installation](https://tecadmin.net/how-to-install-nvm-on-ubuntu-20-04/)) to manage multiple node version. +On terminal, go to your home directory -In order to being able to run successfully PsyNeuLinkView you will need to follow the steps below +``` +cd ~ +``` + +Change file permissions to allow user to run it + +``` +chmod + x linux_installer.sh +``` + +And run installer + +``` +./linux_installer.sh +``` + +After installation is done: + +If conda environment is already active, run + +``` +psyneulinkviewer +``` + +If conda environment is not active, then run : + +``` +source ~/.profile +conda activate psyneulinkview +psyneulinkviewer +``` + +The application should open up succesfully after this. An icon will be visible on the Desktop as well. + +# Installing on MAC + +Download bash script to install [here](https://raw.githubusercontent.com/MetaCell/PsyNeuLinkView/feature/PSYNEU-140/package/mac_installer.sh). +It's recommended to download it in your home directory. + +On terminal, go to your home directory + +``` +cd ~ +``` + +Give user permissions to file + +``` +chmod +x mac_installer.sh +``` -- Create a conda environment +And run installer ``` -conda create --name psnl_viewer python=3.11 +./mac_installer.sh ``` -* Activate the conda environment just created +After installation is done: + +If conda environment is already active, run ``` -conda activate psnl_viewer +open ~/psyneulinkviewer-darwin-x64/psyneulinkviewer.app/ ``` -* Make the pre_installation.sh script executable +If conda environment is not active, then run : ``` -chmod +x pre_installation.sh +source ~/.bash_profile +conda activate psyneulinkview +open ~/psyneulinkviewer-darwin-x64/psyneulinkviewer.app/ ``` -* Run the pre_installation script that will take care of installing PsyNeuLink +The application should open up succesfully after this. A desktop icon should be visible as well. + +# Installation process inside script + +The scripts above run the following commands in order: + +Firs installs the python module 'psyneulinkviewer' from PyPi ``` -bash pre_installation.sh +sudo pip install psyneulinkviewer ``` -* Download the packaged version of the software from the [releases page](https://github.com/MetaCell/PsyNeuLinkView/releases) link, then +This commands installs required libraries and packages. Also creates a conda enviroment where the needed packages are installed. + +After successfully installing the python package above, it reset the user's bash profile to apply the settings changes + +- Linux -### MacOS +``` +source ~/.profile +``` -* Open your terminal and navigate to the folder containing the archive osx.tar.gz previously downloaded +- Mac -* Open the archive and then navigate in the app folder with the commands below +``` +source ~/.bash_profile +``` - ``` - tar xvfz osx.tar.gz - cd PsyNeuLinkViewer-darwin-x64/PsyNeuLinkViewer.app/Contents/MacOS/ - ``` +Then, a desktop file is created on the Desktop which allows users to open the application this way -* Before to launch the application ensure that you are running the node version required, so +# Psyneulinkviewer Requirements - ``` - node --version - ``` +Psyneulinkviewer requires: - and if this is different from v16.16 then either follow the steps at the top or run +- Python 3.11 and pip +- Pip packages : psyneulink, graphviz, wget, packaging and requests +- Conda 4.9.1 or above +- Node 4.19.0 or above +- Rosetta ( on Mac) - ``` - nvm use 16.16 - ``` +All of these are downloaded and installed as part of psyneulinkviewer installation process. -* Now you can run the application +# Testing Models - ``` - ./PsyNeuLinkViewer - ``` +If all went well with installation, you should see the application running as in screenshot below : +![image](https://github.com/user-attachments/assets/ec84044c-287a-4e39-bdf7-aa27cdc486f9) -### Linux +To test models, download [these models](https://github.com/MetaCell/PsyNeuLinkView/tree/feature/PSYNEU-140/test_models) and import one at a time to test. Each time a Model is open, the previous one will disappear. I recommend you start with the models inside 'working_tests', as those are the ones we know for sure should we working. -* Open your terminal and navigate to the folder containing the archive linux.tar.gz previously downloaded +To import go to File -> Open Models -* Open the archive and then navigate in the app folder with the commands below +# PsyNeuLinkView Package Building - ``` - tar xvfz linux.tar.gz - cd PsyNeuLinkViewer-linux-x64/ - ``` +To build pip package -* Before to launch the application ensure that you are running the node version required, so +``` +cd package +python3 -m pip install build +python3 -m build --sdist +``` - ``` - node --version - ``` +To test local build - and if this is different from v16.16 then either follow the steps at the top or run +``` +pip install dist/psyneulinkviewer-VERSIOn.tar.gz +``` - ``` - nvm use 16.16 - ``` +To upload to distribution server. You will need token shared privately to be able to upload. -* Now you can run the application +``` +python3 -m twine upload dist/* +``` - ``` - ./PsyNeuLinkViewer - ``` +To upload to test Pypi server +``` +python3 -m twine upload --repository testpypi dist/* +``` # Development Installation