Skip to content

Improve fsspec-proxy dependency groups #4

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

Open
wants to merge 4 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
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,63 @@ Demo

With the server running locally,
now navigate to: https://martindurant.pyscriptapps.com/empty-tundra/latest/

Installation with Optional Dependencies (fsspec-proxy)
-----------------------------------------------------

The following steps apply only to the `fsspec-proxy` package. The package has
several optional dependency groups:

- `s3`: Required for S3 access (needed for the "Conda Stats" example)
- `anaconda`: Required for Anaconda Cloud access
- `all`: All optional dependencies

S3 Support
~~~~~~~~~~

To use S3 functionality (including the "Conda Stats" example):

```bash
pip install .[s3]
```

Anaconda Cloud Support
~~~~~~~~~~~~~~~~~~~~~~

To use Anaconda Cloud functionality, you'll need to install dependencies from
the Anaconda Cloud index. You can do this in two ways:

1. Configure pip to use the Anaconda Cloud index as an extra source. Create (or
edit) the file `~/.config/pip/pip.conf` (on macOS/Linux) or
`%APPDATA%\pip\pip.ini` (on Windows) and add:

[global]
extra-index-url = https://pypi.anaconda.org/anaconda-cloud/simple
Copy link
Member

Choose a reason for hiding this comment

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

It's possible to add this as a command line arg, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @martindurant, thanks for the feedback, I added a 2nd method with the CLI argument.


Then install:

```bash
pip install .[anaconda]
```

2. Or install directly using pip's `--extra-index-url` option:

```bash
pip install .[anaconda] --extra-index-url https://pypi.anaconda.org/anaconda-cloud/simple
```

All Optional Dependencies
~~~~~~~~~~~~~~~~~~~~~~~~

To install all optional dependencies:

```bash
# With pip config
pip install .[all]

# Or directly with extra index
pip install .[all] --extra-index-url https://pypi.anaconda.org/anaconda-cloud/simple
```

This will ensure that all required packages for `fsspec-proxy`, including those
only available on Anaconda Cloud, are installed.
13 changes: 11 additions & 2 deletions fsspec-proxy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,17 @@ dependencies = [
]
dynamic = ["version", "urls", "keywords"]

[project.optional-dependencies]
test = ["anaconda-cloud-storage", "s3fs"]
[dependency-groups]
s3 = [
"s3fs"
]
anaconda = [
"anaconda-cloud-storage"
]
all = [
{include-group = "s3"},
{include-group = "anaconda"}
]

[tool.hatch.build.hooks.version]
path = "fsspec_proxy/_version.py"
Expand Down