Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conda native development environment setup #36

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 49 additions & 9 deletions docs/dev/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,76 @@ the comments or ping the conda-auth maintainers on Element.
### Prerequisites

Before setting up your development environment, please make sure that conda is installed
and is at the latest version.
and is at the latest version. Also, make sure to create a fork of the repository in GitHub
and clone the forked repository to your local computer.

### Creating the development environment

#### Prerequisites
#### Using conda

This project is managed with the [pixi](https://pixi.sh). Please [install pixi](https://prefix.dev/docs/pixi/overview#installation)
first before continuing.
To set up your development environment, follow these steps:

1. Set up the development environment with these commands:
```
conda env create -n conda-auth-dev -f environment.yml
```
2. Next, you will want to activate the environment:
```
conda activate conda-auth-dev
```
3. Install the `conda-auth` package locally as editable with `pip`:
```
pip install -e .
```
4. Point your shell session to the correct conda executable to use:
```
export CONDA_EXE="$CONDA_PREFIX/bin/conda"
```
5. To verify the installation, run the `conda` command with no arguments and make sure `auth` shows up under
the list of available commands.


#### Using pixi

You can also use the pixi package manager to set up your development environment.
If pixi is not already installed on your computer, please visit their
[installation guide](https://pixi.sh/latest/#installation).

To set up your development environment, follow these steps:

1. Create a fork of the repository in GitHub (sign up a for a GitHub account if your don't already have one)
2. Clone the forked repository to your local computer
3. Set up and activate the development environment with these commands:
1. Set up and activate the development environment with these commands:
```
pixi install
pixi run develop
```
4. Next, you will want to start new shell with the following command:
2. Next, you will want to start a new shell with the following command:
```
pixi shell
```
5. To verify the installation, run the `conda` command with no arguments and make sure `auth` shows up under
3. To verify the installation, run the `conda` command with no arguments and make sure `auth` shows up under
the list of available commands.

Once this has been done, you should be ready to start make changes to the conda-auth plugin and
experimenting with it on your computer.

### Running tests

#### Using conda

To run the test for conda-auth, run the following command:

```
pytest --doctest-modules
```

Or, to generate an HTML coverage report, run with the following command:

```
pytest --cov=conda_auth --cov-report=html --doctest-modules
```

#### Using pixi

To run the test for conda-auth, run the following command:

```
Expand Down
18 changes: 18 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: conda-auth-dev
channels:
- conda-forge
dependencies:
- conda>=23.9.0
- darker
- flake8
- keyring
- keyrings.alt
- mypy
- pre-commit
- pytest
- pytest-cov
- pytest-mock
- python>=3.8
- pyupgrade
- requests
- "ruamel.yaml"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = [
"conda",
"keyring",
"requests",
"ruamel.yaml<0.18",
"ruamel.yaml",
]

[project.entry-points.conda]
Expand Down
Loading