Skip to content

Commit

Permalink
Optional dependencies (#415)
Browse files Browse the repository at this point in the history
* seperate notebook dependencies, add details to README

* install all extras

* lock file update

* remove opencv, add back ipyml/ipywidgets to mandatory dependencies

* update lock file to see opencv tests

* Update dependencies

* seperate notebook dependencies, add details to README

* install all extras

* lock file update

* remove opencv, add back ipyml/ipywidgets to mandatory dependencies

* update lock file to see opencv tests

* update release instructions

---------

Co-authored-by: rettigl <[email protected]>
Co-authored-by: Laurenz Rettig <[email protected]>
Co-authored-by: rettigl <[email protected]>
  • Loading branch information
4 people authored Jun 13, 2024
1 parent 1183529 commit cc382cf
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 274 deletions.
67 changes: 53 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@

Backend to handle photoelectron resolved datastreams.

# Table of Contents
[Installation](#installation)
- [For Users (pip)](#for-users-pip)
- [For Contributors (pip)](#for-contributors-pip)
- [For Maintainers (poetry)](#for-maintainers-poetry)

# Installation

## Pip (for users)
## For Users (pip)

### Prerequisites
- Python 3.8+
- pip

### Steps
- Create a new virtual environment using either venv, pyenv, conda, etc. See below for an example.

```bash
Expand All @@ -22,46 +33,74 @@ python -m venv .sed-venv
- Activate your environment:

```bash
# On macOS/Linux
source .sed-venv/bin/activate

# On Windows
.sed-venv\Scripts\activate
```

- Install `sed`, distributed as `sed-processor` on PyPI:

```bash
pip install sed-processor
pip install sed-processor[all]
```

- This should install all the requirements to run `sed` in your environment.

- If you intend to work with Jupyter notebooks, it is helpful to install a Jupyter kernel for your environment. This can be done, once your environment is activated, by typing:

```bash
python -m ipykernel install --user --name=sed_kernel
```
## For Contributors

To contribute to the development of `sed`, you can follow these steps:
- If you do not use Jupyter Notebook or Jupyter Lab, you can skip the installing those dependencies

```bash
pip install sed-processor
```

## For Contributors (pip)

### Prerequisites
- Git
- Python 3.8+
- pip

### Steps
1. Clone the repository:

```bash
git clone https://github.com/OpenCOMPES/sed.git
cd sed
```

2. Install the repository in editable mode:
2. Create and activate a virtual environment:

```bash
# Create a virtual environment
python -m venv .sed-dev

# Activate the virtual environment
# On macOS/Linux
source .sed-dev/bin/activate

# On Windows
.sed-dev\Scripts\activate
```

3. Install the repository in editable mode with all dependencies:

```bash
pip install -e .
pip install -e .[all]
```

Now you have the development version of `sed` installed in your local environment. Feel free to make changes and submit pull requests.

## Poetry (for maintainers)
## For Maintainers (poetry)

- Prerequisites:
+ Poetry: https://python-poetry.org/docs/
### Prerequisites
- Poetry: [Poetry Installation](https://python-poetry.org/docs/#installation)

### Steps
- Create a virtual environment by typing:

```bash
Expand All @@ -78,16 +117,16 @@ poetry install --with dev, docs

- If you wish to use the virtual environment created by Poetry to work in a Jupyter notebook, you first need to install the optional notebook dependencies and then create a Jupyter kernel for that.

+ Install the optional dependencies `ipykernel` and `jupyter`:
- Install the optional dependencies:

```bash
poetry install -E notebook
```

+ Make sure to run the command below within your virtual environment (`poetry run` ensures this) by typing:
- Make sure to run the command below within your virtual environment (`poetry run` ensures this) by typing:

```bash
poetry run ipython kernel install --user --name=sed_poetry
```

+ The new kernel will now be available in your Jupyter kernels list.
- The new kernel will now be available in your Jupyter kernels list.
25 changes: 8 additions & 17 deletions docs/misc/maintain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,19 @@ Release

To create a release, follow these steps:

a. **Create a Git Tag:**
a. **Create a Git Release on Github:**

Before pushing the tag, ensure the release is ready to be made. Make sure to have the **v** prefix in the tag name.
- On the "tags" page, select "releases", and press "Draft a new release".
- At "choose a tag", type in the name of the new release tag. Make sure to have a **v** prefix in the tag name, e.g. **v0.1.10**.
- Confirm creation of the tag, and press "Generate release notes". Edit the notes as appropriate (e.g. remove auto-generated update PRs).
- Press "Publish release". This will create the new tag and release entry, and issue the build and upload to PyPI.

.. code-block:: bash
git tag -a v0.1.5 -m "Describe here what the release is about"
b. **Push the Tag to GitHub:**

After creating the tag, push it to the GitHub repository.

.. code-block:: bash
git push origin v0.1.5
c. **Check PyPI for the Published Package:**
b. **Check PyPI for the Published Package:**

- Visit the PyPI page (https://pypi.org/project/sed-processor/).
- Confirm that the new version (e.g., 0.1.5) has been published.
- Confirm that the new version (e.g., 0.1.10) has been published.

d. **If you don't see update on PyPI:**
c. **If you don't see update on PyPI:**

- Visit the GitHub Actions page and monitor the Release workflow (https://github.com/OpenCOMPES/sed/actions/workflows/release.yml).
- Check if errors occured.
Expand Down
Loading

0 comments on commit cc382cf

Please sign in to comment.