From 5e6ba12f4b15c81705b04cf36ba1b5f11657faa3 Mon Sep 17 00:00:00 2001 From: fabcor Date: Wed, 24 Jan 2024 16:53:08 +0100 Subject: [PATCH] Simplify Python development dependencies 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" documentatio page accordingly. --- conda-environment-dev.yml | 10 ---------- docs/source/dev/environment.md | 31 ++++++++++++------------------- poetry.lock | 2 +- pyproject.toml | 2 +- 4 files changed, 14 insertions(+), 31 deletions(-) delete mode 100644 conda-environment-dev.yml diff --git a/conda-environment-dev.yml b/conda-environment-dev.yml deleted file mode 100644 index f7ddc0c7b..000000000 --- a/conda-environment-dev.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: mxcubeweb -channels: - - conda-forge -dependencies: - - pytest - - coverage - - flake8 - - black - - pytest-cov - - pytest-mock diff --git a/docs/source/dev/environment.md b/docs/source/dev/environment.md index ab03b9108..d18bfe574 100644 --- a/docs/source/dev/environment.md +++ b/docs/source/dev/environment.md @@ -66,7 +66,7 @@ conda activate mxcubeweb ``` -### 5. Install the remaining dependencies +### 5. Install the back-end dependencies ``` poetry install @@ -74,7 +74,7 @@ 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 @@ -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, diff --git a/poetry.lock b/poetry.lock index 72bd483cc..d63b4af1a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3452,4 +3452,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.11" -content-hash = "1d634a35ec0eeb3d7cb9f50137b0beaeb026fff0183327e4b15e3115db837dc0" +content-hash = "c2e256ff1eaca9b7dac6af863b0516ff2d803d5a41c84139eda7a837095cc532" diff --git a/pyproject.toml b/pyproject.toml index 37920b4a4..354df7f9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"