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 pixi support for multiple platforms #43

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
# SCM syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,13 @@ tensorboard/
# Challenge specific files
data/*
datasplit.csv
result.csv
result.json
result_submitted_only.json

# Bash tasks
nohup.out
nohup.out

# pixi environments
.pixi
*.egg-info
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,59 @@ The package is built on top of the [`cellmap-data`](https://github.com/janelia-c

# Getting started

## Set up your environment
We provide two options for installation of the CellMap Segmentation Challenge software.
1. Using `pixi`
2. Using `micromamba` and `pip`

`pixi` is a new package management tool that can handle both conda and PyPI packages. This is particularly useful installation on Windows or advanced setups.

For basic usage, we also provide a `pip` based installation method using micromamba to create a virtual environment.
You can also [use pyvenv to create a virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-a-new-virtual-environment).

## Getting Started with Pixi

First, install `pixi` by visiting [pixi.sh](https://pixi.sh/latest/#installation) or using the instructions below.

### Linux & macOS

```bash
curl -fsSL https://pixi.sh/install.sh | bash
```

### Windows

#### Powershell
```
iwr -useb https://pixi.sh/install.ps1 | iex
```

#### winget

```
winget install prefix-dev.pixi
```

### Clone the repository

You can clone and install the repository by running the following command:

```bash
# Clone the repository
git clone https://github.com/janelia-cellmap/cellmap-segmentation-challenge

# Install the repo in editable mode
cd cellmap-segmentation-challenge
pixi install
```

### Using the pixi environment

To use the pixi environment, you can either prefix the commands below with `pixi run` (e.g. `pixi run csc --fetch-data`),
or use `pixi shell` which is similar to activating an environment with `conda` or `mamba`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkitti Can you give the specific line to "activate" the pixi environment that was just created, so they can use it just like a mamba environment (i.e. so that the rest of the instructions are still accurate)? Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it simply pixi shell csc?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just pixi shell as I wrote. This will look for the local pyproject.toml and "activate" the environment based on that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I see there is an issue with fastremap at the moment. I'll try to address that in an hour.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhoadesScholar Just checking in. I resolved the issue I was seeing with fastremap.

To clarify, to "activate" the environment, you have first cd cellmap-segmentation-challenge and then run pixi shell.

There's another way which is to execute the following in the shell.

eval "$(pixi shell-hook)"
csc

See more information here:
https://pixi.sh/dev/features/environment/#activation


## Getting started with micromamba and pip

### Set up your environment

We recommend using micromamba to create a new environment with the required dependencies. You can install micromamba by following the instructions [here](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html#automatic-install). The fastest way to do this install, if you are using Linux, macOS, or Git Bash on Windows, is to run the following in your terminal:

Expand All @@ -39,7 +91,7 @@ micromamba create -n csc -c conda-forge -y python==3.11
micromamba activate csc
```

## Clone the repository
### Clone the repository

You can clone and install the repository by running the following command:

Expand Down
Loading