Skip to content

dev_install

David Banas edited this page Dec 31, 2023 · 11 revisions

Developer Installation Instructions

WARNING: In progress!

Note: These instructions are for developers only! If you are a user, who does not intend to modify the PyBERT source code, back up and choose Instant Gratification, instead.

Note: You may also wish to follow these instructions if you want to test the code in an unreleased development branch to, for instance, provide feedback to the developers.

Note: I'm assuming you're working at a Bash, or Sh, prompt. If you're using Csh, please, make the necessary translations to the following commands.

Installing PyBERT in Development mode.

If you wish to install PyBERT in a way that allows you to see immediate feedback to any changes you make to the PyBERT source code, follow these steps:

  1. If you do not already have Miniconda installed, install the Miniconda Python Distribution.

    Note: It is very important to select the "install just for me and do not require administrative privileges" option when installing Miniconda.

    • Those of you having previously installed PyBERT will notice a change here. To learn why we've changed these instructions from Anaconda to Miniconda, see this FAQ entry.
  2. After that completes, launch an appropriate command prompt shell with the base environment activated.

    How you run an "appropriate command prompt shell with the base environment activated" depends on both your platform and the options you selected during Miniconda installation. The installer should have given you instructions on getting into this state, in its last few messages. The telltale sign that you are correctly configured is seeing: (base) somewhere in your command prompt prefix.

  3. Install and activate the new LibMamba dependency constraint solver:

    • conda install conda-libmamba-solver
    • conda config --set solver libmamba

    Note: It seems to be critical that you do this first, immediately after installing Miniconda and before installing anything else. (We don't know why.)

  4. Create and activate a custom Anaconda environment for PyBERT development:

    • conda create -n pybert-dev
    • conda activate pybert-dev

    Note: At this point, you should see that (base) has been replaced by (pybert-dev) in your prompt.

  5. Install Python 3.10 into the new environment:

    • conda install -c conda-forge -c defaults python=3.10
  6. Install PyBERT's dependencies into the new environment:

    • conda install -c dbanas -c conda-forge -c defaults --only-deps pybert=5
  7. Fork/clone the PyBERT GitHub repository to your machine.

    1. From the main PyBERT repository, make your own fork of PyBERT by clicking where shown:

      GitHub Screen Shot Showing Fork Icon

    2. From your new fork of PyBERT, clone, or download, to your working machine, by clicking where shown:

      GitHub Screen Shot Showing Clone Icon

      and entering the following command:

      git clone <PASTE>

    Note: If you don't wish to create your own fork of the PyBERT project, you may just clone mine. However, note that you won't be able to push any changes you make to the Python source code back up to GitHub!

  8. Move into the newly created PyBERT/ directory and install PyBERT in "development" mode:

    conda develop src/

  9. If you wish to develop on something other than the main branch then check it out:

    git checkout <branch>

  10. Test your new development mode installation of PyBERT, by executing the following command:

    python -m pybert

    You should see the usual PyBERT GUI application appear on your screen.

You are now ready to begin changing the PyBERT source code and testing those changes. Of course, you must quit and restart PyBERT, after making a source code change, in order to see its effects.

Installing PyAMI in Development mode.

If you also wish to install PyAMI in development mode, enter the following commands from the same command prompt and from within the PyBERT/ directory:

  1. git submodule update --init PyAMI/
  2. conda uninstall --force pyibis-ami
  3. conda develop ./PyAMI/
  4. python -c "import pyibisami as dut; print(dut.__file__)"

In response to the last command, you should see something like:

C:\Users\capnf\Documents\GitHub\PyBERT\PyAMI\pyibisami\__init__.py

Clone this wiki locally