Skip to content

Commit

Permalink
Update CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jcornall committed Nov 29, 2024
1 parent 6f7975a commit 4022e3b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 21 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version x.x.x
- Rename /scripts directory to /recipe (#161)
- Update CONTRIBUTING.md with detailed installation instructions (#161)
- Rename `/scripts` directory to `/recipe` (#161)
- Update `CONTRIBUTING.md` with detailed installation and contribution instructions (#161)
- Limit Python version to <3.12 in conda recipe (#161)

# Version 1.0.1
Expand Down
59 changes: 40 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,81 @@
# Developer Contribution Guide
Contribute to the repository by opening a pull request.

- [Developer Contribution Guide](#developer-contribution-guide)
- [Local](#local)
- [Merge the `main` Branch](#merge-the-main-branch)
- [Run Tests](#run-tests)
- [Install and Run `pre-commit`](#install-and-run-pre-commit)
- [Continuous Integration](#continuous-integration)
- [Testing](#testing)
- [Building](#building)
- [Releasing](#releasing)
- [Changelog](#changelog)
- [Changelog Style](#changelog-style)


## Local
Develop code locally by cloning the source code, creating a development environment and installing it.

1. Install [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html), then launch the `Miniforge Prompt`.

2. Clone the `main` branch of `eqt` locally, and navigate into where it has been cloned:

```sh
# Clone (download) source code
git clone [email protected]:TomographicImaging/eqt.git
cd eqt
```

3. Create the mamba environment using the following command:

```sh
# Create environment
mamba env create -f recipe/eqt_env.yml
```

4. Activate the environment:

```sh
mamba activate eqt_env
```

5. Install the dependencies:

```sh
# Install test dependencies
pip install .[dev]
```

### Run tests
Before merging a pull request, all tests must pass. These can be run locally from the repository folder
### Merge the `main` Branch
Conflicts may exist if your branch is behind the `main` branch. To resolve conflicts between branches, merge the `main` branch into your current working branch:
```sh
git merge main
```

### Run Tests
Before merging a pull request, all tests must pass. These can be run locally from the repository folder:
```sh
pytest
```
### Pre-commit guide
Adhere to our styling guide by installing [pre-commit](https://pre-commit.com) in your local eqt environment.

### Install and Run `pre-commit`
Adhere to our styling guide by installing [`pre-commit`](https://pre-commit.com) in your local eqt environment:
```sh
pip install pre-commit
pre-commit install
```
From your local repository folder, run pre-commit on all the files before committing

From your local repository folder, run `pre-commit` on all the files before committing:
```sh
pre-commit run -a
```
or run pre-commit on a single file by specifying its file path
OR,

Run `pre-commit` on a single file by specifying its file path:
```sh
pre-commit run --files [path]
```
The [.pre-commit-config.yaml](./.pre-commit-config.yaml) config file indicates the repositories and the hooks which will be applied automatically.
The [`.pre-commit-config.yaml`](./.pre-commit-config.yaml) config file indicates the repositories and the hooks which will be applied automatically.

## Continuous integration

GitHub Actions runs automatically a subset of the unit tests on every commit via [test.yml](.github/workflows/test.yml).
## Continuous Integration
GitHub Actions automatically runs a subset of the unit tests on every commit via [`test.yml`](.github/workflows/test.yml).

### Testing

Expand Down Expand Up @@ -90,13 +108,16 @@ Version 1.33.7
The `<body>` should be taken from the changelog (below).

#### Changelog
Located in [CHANGELOG.md](./CHANGELOG.md).
Located in [`CHANGELOG.md`](./CHANGELOG.md).

##### Changelog style
The changelog file needs to be updated manually every time a pull request (PR) is submitted.
##### Changelog Style
The changelog file needs to be updated manually every time a pull request (PR) is submitted:
- Itemise the message with "-".
- Be concise by explaining the overall changes in only a few words.
- Mention the relevant PR in brackets.

###### Example:
- Adds `title` to `FormDockWidget` & update tests/examples (#102)
Example:
```md
# Version x.x.x
- Add `title` to `FormDockWidget` & update tests/examples (#102)
```

0 comments on commit 4022e3b

Please sign in to comment.