Skip to content

Commit

Permalink
Simplify Python development dependencies
Browse files Browse the repository at this point in the history
Remove `conda-environment-dev.yml` since it is not useful.
The Python development dependencies are
either in the Poetry `dev` dependency group
or in `pre-commit` hooks.

Adjust the "Development environment" documentation page accordingly.
  • Loading branch information
fabcor-maxiv committed Jan 25, 2024
1 parent 9459329 commit aede81e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 31 deletions.
10 changes: 0 additions & 10 deletions conda-environment-dev.yml

This file was deleted.

31 changes: 12 additions & 19 deletions docs/source/dev/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ conda activate mxcubeweb
```


### 5. Install the remaining dependencies
### 5. Install the back-end dependencies

```
poetry install
```


(front-end)=
### 6. Install front-end dependencies and build the UI
### 6. Install the front-end dependencies and build the UI

```
pnpm --prefix ui install
Expand Down Expand Up @@ -123,30 +123,23 @@ Follow the instructions in [](#front-end) to build a client.
Please read the [contributing guidelines](project:/dev/contributing.md)
before getting started with the development.

The additional tools for development are in the `conda-environment-dev.yml` file,
the environment created above needs to be updated with this:

```
# Make sure the environment created above is activated
conda activate mxcubeweb
# To install the additional dependencies, run:
conda env update --file conda-environment-dev.yml
```

It is recommended to install `mxcubeweb` and `mxcubecore` as "editable"
to be able to add breakpoints and debug the application more easily.
This can be done with `pip`.
By default, when running `poetry install`,
Poetry installs the main project (here `mxcubeweb`) as editable,
but not the dependencies (which includes `mxcubecore`).

```
# In the project root of mxcubeweb (please note that the dot `.` is important):
python -m pip install --editable .
Installing `mxcubecore` as editable can be done with pip.

# In the project root of mxcubecore:
```shell
# Make sure the conda environment is active
conda activate mxcubeweb
# In the project root of mxcubecore (note that the dot `.` is important):
python -m pip install --editable .
```

The above makes it possible to add break points directly in the "checked out code".
The "editable" installations make it possible to
add break points directly in the "checked out code".

Before running any test, make sure that the local *Redis* server is running.
For example, with the `mxcubeweb` *conda* environment activated in a terminal,
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ mxcubecore = ">=1.54.0"
mxcube-video-streamer = ">=1.0.0"
bcrypt = "^4.0.1"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
pre-commit = "2.20.0"
pytest = "7.1.3"
pytest-cov = "4.0.0"
Expand Down

0 comments on commit aede81e

Please sign in to comment.