Skip to content

Commit 84d2bf2

Browse files
authored
Update documentation for set up and testing (#520)
1 parent be403eb commit 84d2bf2

File tree

2 files changed

+47
-6
lines changed

2 files changed

+47
-6
lines changed

documentation/FIRST_TIME_SETUP.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ If the command fails, install Python with Anaconda by following the installation
1414

1515
### Create a Python virtual environment
1616

17-
We recommend installing Python dependencies in a virtual environment isolate the project from the rest of your machine. If you're using Anaconda, create a virtual environment named `deepcell-label` with this command: `conda create -n deepcell-label python=3.8`.
17+
We recommend installing Python dependencies in a virtual environment to isolate the project from the rest of your machine. Create a virtual environment named `deepcell-label-env` with this command: `python -m venv deepcell-label-env`.
1818

19-
Then activate the virtual environment with: `conda activate deepcell-label`.
19+
Then activate the virtual environment with the activate script in the `deepcell-label/Scripts` or `deepcell-label/bin` folder.
2020

2121
Now when you run `pip install -r requirements.txt`, all the dependencies will be installed in the virtual environment.
2222

23-
You can deactivate the virtual environment with: `source deactivate`.
23+
You can deactivate the virtual environment with: `deactivate`.
2424

25-
Read more about virtual environments with conda here: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html.
26-
27-
If you are not using Anaconda, set up a virtual environment with Python's built-in virtual environment manager `venv`: https://docs.python.org/3/tutorial/venv.html.
25+
Read more about virtual environments with `venv` here: https://docs.python.org/3/tutorial/venv.html.
2826

2927
## Setup Node.js (Javascript)
3028

documentation/LOCAL_USE.md

+43
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ flask run
3838

3939
By default, DeepCell Label creates a temporary database in `/tmp`. Change `SQLALCHEMY_DATABASE_URI` in your `.env`, for example `SQLALCHEMY_DATABASE_URI=sqlite:///~/Documents/deepcell_label.db`, to make a persistent database in another location.
4040

41+
### Running the backend tests
42+
43+
Make sure to be in the `/deepcell_label` folder inside of the backend:
44+
45+
```bash
46+
cd deepcell-label/backend/deepcell_label
47+
```
48+
49+
Then run the tests using the `-m` flag with pytest:
50+
51+
```bash
52+
python -m pytest .
53+
```
54+
4155
### Run with Docker
4256

4357
The backend can also be containerized with [Docker](https://www.docker.com). To build a production-ready Docker image, run:
@@ -70,3 +84,32 @@ yarn start
7084
```
7185

7286
Visit [localhost:3000](http://localhost:3000) to see the DeepCell Label homepage.
87+
88+
### Running the frontend tests
89+
90+
Run the Jest tests with:
91+
92+
```bash
93+
yarn test
94+
```
95+
96+
And open the Cypress UI with:
97+
98+
```bash
99+
npx cypress open
100+
```
101+
102+
They can also be run from command line with:
103+
104+
```bash
105+
npx cypress run
106+
```
107+
108+
## Common Issues (Especially on Windows)
109+
110+
- If SQLAlchemy is giving Operational Errors, it could be because the `/tmp` folder does not exist, which will need to be created (e.g. on C: for Windows)
111+
- On Windows, after installing Python requirements, you probably have to run
112+
```bash
113+
pip uninstall python-magic
114+
pip install python-magic-bin==0.4.14
115+
```

0 commit comments

Comments
 (0)