From e0f85d897fb9b7cf57cfb2b430ea80b120109abc Mon Sep 17 00:00:00 2001 From: Priti Shah Date: Wed, 10 Aug 2022 10:04:50 -0400 Subject: [PATCH] Add information for developers to deal with CI linting failures. --- README_developers.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README_developers.md b/README_developers.md index 7c45d0b8d..bdf060dff 100644 --- a/README_developers.md +++ b/README_developers.md @@ -40,7 +40,7 @@ conda env create -n environment.yml conda activate python -m pip install --no-deps -e . ``` -Note the use of `--no-deps`. Indeed the `environment.yml` already instructs conda to install all the necessary package dependencies. We therefore prevent `setup.py` from overwriting them with the pip-equivalent packages, which might not be compatible with conda. +Note the use of `--no-deps`. Indeed the `environment.yml` already instructs conda to install all the necessary package dependencies. We therefore prevent `setup.py` from overwriting them with the pip-equivalent packages, which might not be compatible with conda. This creates a new environment with name `` with all the necessary library dependencies. Then it activates the new environment. @@ -80,12 +80,12 @@ For example, we can anticipate updating `pyEPR-quantum` to enable Ansys interact To update your local install, simply execute the metal package install command ```sh conda env update -n environment.yml -``` +``` Alternatively, you can remove your conda environment by executing the commands below and later re-create a new environment following the original install instructions in section 1. ```sh conda env list conda env remove -n -``` +``` Notice that using the `conda env update` command might introduce inconsistencies in your virtual environment, and render it unusable. This occurs in general when using conda install commands after any number of pip install commands. ### Setup without conda: in a virtual environment (alternative setup) @@ -115,11 +115,11 @@ Here are some things to consider when setting up a development environment: * Library errors when activating conda environments, or initializing jupyter notebook/lab, might indicate a conflict between python libraries in the base and sub environments. Go ahead and manually delete the library from the base environment `site-packages` folder, shown in the error message. You might need to reinstall them in the sub environment, or create a new one. * If Jupyter notebook has trouble finding a dll for a package that works in the new environment outside of Jupyter, then try opening Jupyter notebook from the new environment instead of from `base` -### Other Common Issues +# Other Common Issues For other common installation issues, please refer to the [FAQ](https://qiskit.org/documentation/metal/faq.html) -### Additional steps for developers +## Additional steps for developers If you are planning to develop the qiskit metal codebase, you need extra packages, which you can install by running the following command instead of (or after) the previous one: ``` @@ -127,7 +127,7 @@ python -m pip install -r requirements-dev.txt ``` You may also want to also use these instructions to [setup user environment](/docs/NEW_DEVELOPER_SETUP.md) -#### Setting up precommit hooks +## Setting up precommit hooks If are planning on committing, you can run the following in the root of your project to link the available precommit hooks. ``` @@ -135,3 +135,10 @@ If are planning on committing, you can run the following in the root of your pro ``` Please make sure the command is run from the same shell you plan on using to commit. If running on Windows, please make sure that this script is run from git-bash or another Linux-style shell. Currently, the precommit hook will check for yapf formatting. +## Get more information when you commit code and CI gives linting error(s) + +If are planning on committing, code and get a linting error. Sometimes the log does not have enough details to fix the error. +``` +yapf --diff --recursive --style .style.yapf qiskit_metal +``` +Go to directory with qiskit-metal/.style.yapf file and run the above command to lint locally. This may give more meaningful feedback for linting failure.