Skip to content

Commit

Permalink
Remove-icons-cruft (#416)
Browse files Browse the repository at this point in the history
* Remove icons cruft

* Remove incorrect instruction

* Update contributing guide
  • Loading branch information
cbrnr authored Apr 9, 2024
1 parent aa9b009 commit 0b19b17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
22 changes: 9 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Contributing to MNELAB

If you want to implement a new feature, fix an existing bug, or help improve MNELAB in any other way (such as adding or improving documentation), please consider submitting a [pull request](https://github.com/cbrnr/mnelab/pulls) on GitHub. It might be a good idea to open an [issue](https://github.com/cbrnr/mnelab/issues) beforehand to discuss your planned contributions with the developers.
If you want to implement a new feature, fix an existing bug, or help improve MNELAB in any other way (such as adding or improving documentation), please consider submitting a [pull request](https://github.com/cbrnr/mnelab/pulls). It might be a good idea to open an [issue](https://github.com/cbrnr/mnelab/issues) first to discuss your planned contributions with the developers.

Before you start working on your contribution, please make sure to follow the guidelines described in this document.

Expand All @@ -9,14 +9,14 @@ Before you start working on your contribution, please make sure to follow the gu

You will need to have a working Python installation (make sure to use one of the supported Python versions). Installation methods vary across platforms, but if you don't have any specific preferences, the [official installers](https://www.python.org/) are a great option on Windows and macOS.

In addition to Python, you will also need a working [Git](https://git-scm.com/) installation. Again, installation methods are different depending on which platform you are using. If you are on Windows, you can install [Git for Windows](https://gitforwindows.org/). If you are on macOS, you can install the XCode command line tools with `xcode-select --install`.
In addition to Python, you will also need a working [Git](https://git-scm.com/) installation. Again, installation methods are different depending on which platform you are using. If you are on Windows, you can install [Git for Windows](https://gitforwindows.org/). If you are on macOS, you can install the XCode command line tools with `xcode-select --install`, which contain Git.


### Forking and cloning MNELAB

On the [GitHub website](https://github.com/cbrnr/mnelab), click on the "Fork" button in the top right corner to create your own fork of MNELAB (you need to be logged in with your GitHub account). Next, from the main page of your fork, click on the green "Clone or download" button. Copy the URL to the clipboard – you will need this URL to create your local MNELAB repository.
On the [repository website](https://github.com/cbrnr/mnelab), click on the "Fork" button in the top right corner to create your own fork of MNELAB (you need to be logged in with your GitHub account). Next, from the main page of your fork, click on the green "Clone or download" button. Copy the URL to the clipboard – you will need this URL to create your local MNELAB repository.

Open a terminal and change into the folder where you would like your MNELAB project to live. Then, type `git clone <URL>` (replace `<URL>` with the repository URL you copied to the clipboard earlier). Your fork of MNELAB is now available in the `mnelab` folder.
Open a terminal and change into the folder where you would like your MNELAB fork to live. Then, type `git clone <URL>` (replace `<URL>` with the repository URL you copied to the clipboard earlier). Your fork of MNELAB is now available in the `mnelab` folder.


### Installing required Python packages
Expand All @@ -27,7 +27,7 @@ In a terminal, change to the `mnelab` folder containing your MNELAB fork. You ca
pip install -e ".[full]"
```

You might want to [create a virtual environment](https://docs.python.org/3/library/venv.html#creating-virtual-environments) instead of installing everything into your main environment.
You might want to [create a virtual environment](https://docs.python.org/3/library/venv.html#creating-virtual-environments) instead of installing everything into your global environment.


### Creating a new branch
Expand All @@ -42,23 +42,19 @@ Once you have committed all of your changes, you can push them to your remote fo

### Modifying icons

MNELAB bundles its icons using the Qt Resource System. The icons are stored in the `icons` folder, which contains two themes "light" and "dark". If you want to modify an existing icon or add a new one, you will need to regenerate the resource file. This can be done by running the following command in the `mnelab` folder:
MNELAB bundles its icons in the `icons` folder, which contains two themes ("light" and "dark"). If you want to modify an existing icon or add a new one, make sure to apply your changes to both the "light" and "dark" themes. All icons are SVGs and taken from the [Material Symbols](https://fonts.google.com/icons) icon set.

```
pyside6-rcc icons.qrc -o rc_icons.py
```

The auto-generated `rc_icons.py` will be updated with the new/changed icons. Make sure to include this file in your pull request if you have modified any icons. Please make sure to apply your changes to both the "light" and "dark" theme icons.
If you want to add a new icon, download it from the Material Symbols website, rename it (use a suitable name reflecting its intended action), and place it in the `icons/light/actions` folder. Next, edit the SVG file in a text editor and add the `fill="black"` attribute to the `<svg>` tag. Finally, copy the SVG file to the `icons/dark/actions` folder and change the `fill` attribute to `fill="white"`.


### Adding a changelog entry

Once you have an open pull request, add an entry to the top of `CHANGELOG.md` in the most suitable section: "Added" lists new features, "Fixed" lists bug fixes, and "Changed" lists changes to existing functionality. Finally, make sure to mention your pull request and your name.
Once you have an open pull request, add an entry to the top of `CHANGELOG.md` in the most suitable section: "Added" lists new features, "Fixed" lists bug fixes, and "Changed" lists changes to existing functionality. Finally, make sure to mention the pull request and your name.


### Coding style

MNELAB uses [Black](https://black.readthedocs.io/en/stable/?badge=stable#) code style (using [Ruff](https://docs.astral.sh/ruff/formatter/) for formatting) wherever possible (with the noteable exception that we use a maximum line length of 92 characters as opposed to the default 88 characters). Because [PySide6](https://doc.qt.io/qtforpython-6/index.html) is based on the C++-based Qt library, most of its names use camel case instead of snake case. In your own code, please use snake case whereever possible.
MNELAB uses [Ruff](https://docs.astral.sh/ruff/formatter/) for formatting (with the noteable customization that we use a maximum line length of 92 characters as opposed to the default 88 characters). Because [PySide6](https://doc.qt.io/qtforpython-6/index.html) is based on the C++-based Qt library, most of its names use camel case instead of snake case. In your own code, please use snake case whereever possible.


## Making a PyPI release
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ changelog = "https://github.com/cbrnr/mnelab/blob/main/CHANGELOG.md"

[tool.ruff]
line-length = 92
exclude = ["rc_icons.py"]

[tool.ruff.lint]
select = ["E", "F", "I", "W", "UP"]
Expand Down

0 comments on commit 0b19b17

Please sign in to comment.