rdkit, numpy, pyside and pqtdarktheme are installed by default. ruff is installed using the dev tag as described below
-
Clone the repository:
git clone https://github.com/EBjerrum/rdeditor.git
-
Navigate to the project directory:
cd rdeditor
-
Install rdeditor in editable mode to enable developer modifications:
pip install -e .[dev]
-
Optionally, set up your preferred code editor (e.g., VS Code) to format code on save using ruff.
The rdeditor
project utilizes ruff
as both a linter and code formatter to ensure consistent code quality and formatting standards. You can automate the code formatting process by setting up a pre-commit hook in your local Git repository or configuring VS Code to auto-format code on save using the provided ruff.toml
specifications.
You can set up a pre-commit hook in your local Git repository to automatically format code using ruff
before each commit. Here's how to do it:
-
Navigate to the
.git/hooks
directory in your repository. -
Create a new file named
pre-commit
if it doesn't already exist. -
Open the
pre-commit
file in a text editor and add the following content:#!/bin/bash # Run the ruff formatter on staged changes ruff format $(git diff --cached --name-only | grep '\.py$') # Stage the formatted changes git add $(git diff --cached --name-only)
-
Save the file and make it executable by running the following command in your terminal:
chmod +x .git/hooks/pre-commit
Now, each time you attempt to commit changes, the pre-commit
hook will run the ruff
formatter on your staged changes, ensuring consistent formatting before the commit is finalized.
If you prefer to use VS Code, you can configure it to automatically format code using the provided ruff.toml
specifications on save. Here's how to do it:
-
Open VS Code and navigate to the settings by clicking on the gear icon in the bottom left corner or by pressing
Ctrl + ,
. -
In the search bar at the top, type "format on save" to find the setting.
-
Check the box next to "Editor: Format On Save" to enable auto-formatting on save.
-
Next, click on "Extensions" in the sidebar and search for "ruff" in the search bar.
-
Install the ruff extension.
-
Press
ctrl-shift-p
or selectformat with...
from the right click menu in a python file. Select the optionconfigure default formatter...
and choose ruff.
With these settings configured, VS Code will automatically format your Python code according to the specifications provided in the ruff.toml
file each time you save a file.
[Include usage instructions here if different from README.md]
Code submitted to github master branch are checked with ruff via GitHub Actions. It is thus advisable to check yourself before a pull request is made. This can be done with:
ruff check
which will inspect the code and print a list of issues.
Sometimes they can be safely fixed with
ruff check --fix
and even ruff check --fix --unsafe-fixes
but otherwise they need to be inspected and mitigated.
The github actions has been set to automatically deploy to pypi every time a new release is published. The release will need a new tag created (incremented), otherwise PyPi will not accept the new package.
- Follow the installation steps in the INSTALL section.
- Set up your preferred code editor (e.g., VS Code) to format code on save.
- Optionally, configure a pre-commit hook locally to ensure code consistency before committing changes.
- Use meaningful branch names for new features, bug fixes, or enhancements (e.g., feature/add-new-tool, fix/issue-123).
- Create feature branches from the main branch and submit pull requests for review.
- Review and address any feedback from maintainers before merging changes.
- Follow the project's coding standards and style guide.
- Write clear, concise, and well-documented code.
- Include relevant comments and docstrings to explain complex logic or functionality.
- Write meaningful commit messages that describe the purpose of the changes.
[Include testing instructions and guidelines here if applicable]
[Include troubleshooting tips and common issues here]
[Include links to relevant documentation, tutorials, or external resources]
[Provide contact information for project maintainers or contributors]
[Include a summary of recent changes, improvements, and bug fixes]