-
Notifications
You must be signed in to change notification settings - Fork 2
Setup for development
In order to install the repo and system ready for development
- Note the system prerequisites
- Download the code
- Create the development environment
- Install the system
- Run system tests
- The system is being developed on Linux with Python >=3.9
- Ensure git has been set up and configured on the development machine (use git config to check)
- Change directory to where your project repo will be located locally, e.g.
mkdir github-repos
cd github-repos
- Create and move into a new project directory, e.g.
mkdir cmatools-repo
cd cmatools-repo
- Clone the repo content from remote GitHub repo
git clone https://github.com/cma-open/cmatools.git
-
Enter username and password at prompts (not required for public repos)
-
Move into the directory
cd cmatools
The repo is now available for use and development
- Conda is used to manage the python environment and dependencies in which the package is developed and run
- This step only needs to be done once per system / machine
- Change directory into the project scripts directory
cd scripts
chmod +x install-miniconda.sh
./install-miniconda.sh
- This will carry out a silent install of miniconda
- If conda has already been installed you will see notices, if so move on to the next step
- In your terminal window, run the command:
conda list
- Update conda to latest version
conda update -n base -c defaults conda
-
The name and content (packages to be installed) of the conda environment is set in the environment.yml file
-
This is ready for use, but can be edited and commited to change the packages used
-
https://github.com/cma-open/cmatools/blob/master/bin/environment.yml
-
Run this script to create a local isolated conda environment
-
From within the scripts directory
chmod +x create-cmatools-conda-environment.sh
./create-cmatools-conda-environment.sh
- Agree to the prompts in the terminal where required
- Confirm the conda environments that are currently available
conda info --envs
- Confirm the installed packages within the active environment
conda list
Check the currently available environments, then activate the desired environment
conda info --envs
conda activate cmatools-env
When the conda environment is activated then any installation will occur into this environment and be isolated
- Change directory into the main project directory, then run setup
cd ..
pip install -e .
After installing the code, and at regular points during development, a tests can be run with the following script
cd bin
chmod +x runtests.sh
./runtests.sh