Skip to content

Latest commit

 

History

History
70 lines (55 loc) · 2.7 KB

File metadata and controls

70 lines (55 loc) · 2.7 KB

Installation with pyenv and pdm

pyenv allows you to install multiple python versions side by side in your local user environment. This installation method is preferred over using conda to install pdm,

Install pyenv

Follow the pyenv installation instructions here. There are just two steps.

  1. Download and install pyenv
  2. Add pyenv functions to your shell configuration.

Install python 3.9

Navigate to the nuc-morph-analysis folder and install the required python version.

pyenv install $(cat .python-version)

The .python-version file in this repo tells pyenv to load Python 3.9 when you are inside the nuc-morph-analysis directory. Check that this is working with which python && python --version.

Install pdm

Detailed installation instructions are available here. For Linux or MacOS, install pdm for your user as follows.

  1. Download the installer
curl -sSLO https://pdm.fming.dev/install-pdm.py
  1. Validate that the installer has not been tampered with
curl -sSL https://pdm.fming.dev/install-pdm.py.sha256 | shasum -a 256 -c -
  1. Using Python 3.9, run the installer.
python install-pdm.py

Warning

With this installation method pdm will be tied to the exact python version used to install it. If you installed with Python 3.9.13, for example, and you later transition to Python 3.9.17, do not uninstall Python 3.9.13.

pdm will be installed into $HOME/.local/bin. Check that your version is at least 2.10. We test against version 2.12.2.

$ pdm --version
PDM, version 2.12.2

Install the project dependencies

From the nuc-morph-analysis directory, use pdm to install the dependencies.

pdm sync -d

Note

If you are on the Allen Institute for Cell Science local network, you can speed up data loading by installing aicsfiles. Use the following steps.

  1. pdm config --local pypi.artifactory.url https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/simple
  2. pdm config --local pypi.artifactory-snapshot.url https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-snapshot-local/simple
  3. pdm sync -d -G internal

This will create a virtual environment at nuc-morph-analysis/.venv. It is recommended use pdm to run Python in this environment without activating it via pdm run python {options}, though you can activate it with eval $(pdm venv activate) or source .venv/bin/activate.

Managing dependencies with pdm

To modify the project dependencies, see our instructions for using pdm.

Testing

To run the tests:

pdm run pytest