Skip to content

Commit

Permalink
Rename /scripts and update CONTRIBUTING.md (#161)
Browse files Browse the repository at this point in the history
* Rename /scripts directory and add detailed installation to
CONTRIBUTING.md

* Update CHANGELOG.md

* Add /recipe and eqt_env.yml to branch

* Update mamba installation link

* Remove intel channel from recipe, amend CHANGELOG.md

* Limit Python version to <3.12 in conda recipe

* Update CHANGELOG.md

* Update CONTRIBUTING.md

* Amend formatting of Python version line in conda recipe
  • Loading branch information
jcornall authored Nov 30, 2024
1 parent c1dbd6f commit 0291f7f
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Version x.x.x
- 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)
- Change SessionDirectorySelectionDialog `.open()` call to `.exec()` (#163)

# Version 1.0.1
Expand Down
77 changes: 60 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,41 +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 and installing it.
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 git@github.com:TomographicImaging/eqt
git clone git@github.com: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.

## Continuous integration
The [`.pre-commit-config.yaml`](./.pre-commit-config.yaml) config file indicates the repositories and the hooks which will be applied automatically.

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 @@ -68,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)
```
3 changes: 1 addition & 2 deletions scripts/eqt_env.yml → recipe/eqt_env.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# This creates an environment with all of the prerequisites for eqt
name: eqt_env
channels:
- conda-forge
dependencies:
- python
- python <3.12
- pip
- pyside2
- qdarkstyle

0 comments on commit 0291f7f

Please sign in to comment.