From e6686ea1476cfb220d5529b8ce35231ecbcd5cfc Mon Sep 17 00:00:00 2001 From: Simon Mathis Date: Mon, 25 Nov 2024 06:33:39 -0800 Subject: [PATCH] docs: add contributing instructions --- .env.sample | 3 +++ CONTRIBUTING.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTORS.md | 10 ---------- README.md | 4 ++++ contribute.sh | 4 ++++ environment.yml | 19 +++++++++++++++++++ 6 files changed, 75 insertions(+), 10 deletions(-) create mode 100644 .env.sample create mode 100644 CONTRIBUTING.md delete mode 100644 CONTRIBUTORS.md create mode 100644 contribute.sh create mode 100644 environment.yml diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..3e1563d --- /dev/null +++ b/.env.sample @@ -0,0 +1,3 @@ +PYMOL_RPC_HOST=localhost +PYMOL_RPC_PORT=9123 +LOG_LEVEL=INFO \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4ba8af1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,45 @@ +# Contributors + +## Special thanks for all the people who have helped this project so far: + +* [Simon Mathis](https://github.com/Croydon-Brixton) +* [Martin Buttenschön](https://github.com/maabuu) + +## I would like to join this list. How can I help the project? + +We always welcome contributions to improve the project. Please have a look at the current github issues for information on where help could be needed. + +### Getting set up: +The development environment for pymol-remote is detailed in the [`environment.yml` file](environment.yml). + +For simplicity, you can set up the development environment using the `contribute.sh` script: + +```bash +# NOTE: If you wish to use a different package manager than conda/etc. you can manually install the dependencies and set the .env file +./contribute.sh +``` + +You can then set the environment variables such as your localhosts's IP address in the `.env` file. Do not commit this file to github. + +### Running the tests + +To run the tests, you can use + +```bash +# Run all tests +pytest tests/ + +# Run only the tests that do not require a running server +pytest tests/ -m "not requires_server" + +# Run only the tests that do not require biotite on the client side +pytest tests/ -m "not client_requires_biotite" + +``` + +### Test Categories + +The test suite uses pytest markers to organize tests: + +- `requires_server`: Tests that need a running PyMOL server +- `client_requires_biotite`: Tests that need biotite installed on the client side diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index f633c7d..0000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,10 +0,0 @@ -# Contributors - -## Special thanks for all the people who have helped this project so far: - -* [Simon Mathis](https://github.com/Croydon-Brixton) -* [Martin Buttenschön](https://github.com/maabuu) - -## I would like to join this list. How can I help the project? - -We always welcome contributions to improve the project. Please have a look at the current github issues for information on where help could be needed. \ No newline at end of file diff --git a/README.md b/README.md index 5cfe4df..f6cc287 100644 --- a/README.md +++ b/README.md @@ -66,3 +66,7 @@ This implementation is inspired by and based on the original [RDKit RPC](https:/ ## 4. License This code is licensed under the same terms as PyMOL. See [LICENSE](./LICENSE) for more details. + + +## 5. Contributing +See [CONTRIBUTING.md](./CONTRIBUTING.md) for more details. diff --git a/contribute.sh b/contribute.sh new file mode 100644 index 0000000..b43acc2 --- /dev/null +++ b/contribute.sh @@ -0,0 +1,4 @@ +cp .env.sample .env +conda env create -f environment.yml +conda activate pymol-remote +pytest tests/ \ No newline at end of file diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..b00f205 --- /dev/null +++ b/environment.yml @@ -0,0 +1,19 @@ +name: pymol-remote # development environment for pymol-remote + +channels: + - conda-forge + - defaults + +dependencies: + - python=3.10 + + - pymol-open-source + - pytest>=8.3.0,<9.0.0 + + - pip + - pip: + - biotite>=1.0 + - ruff>=0.8.0,<0.9.0 + - pytest-dotenv>=0.5.2 + # ... install pymol-remote in editable mode + - -e .