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

feat: add pypi index #2416

Merged
merged 15 commits into from
Nov 22, 2024
Merged

feat: add pypi index #2416

merged 15 commits into from
Nov 22, 2024

Conversation

nichmor
Copy link
Contributor

@nichmor nichmor commented Nov 5, 2024

Description

The stretch goal is to add custom indexes for pixi like here: https://docs.astral.sh/uv/configuration/indexes/
However, In this PR we add only pinning https://docs.astral.sh/uv/configuration/indexes/#pinning-a-package-to-an-index

A small example of this would be would be:

[project]
authors = ["nichmor <[email protected]>"]
channels = ["conda-forge"]
description = "Add a short description here"
name = "custom_pypi"
platforms = ["osx-arm64"]
version = "0.1.0"

[tasks]

[dependencies]
python = "*"


[pypi-dependencies]
pytorch ={ version = "*", index = "https://download.pytorch.org/whl/cu118" }

We want to iterate on this further and allow the user to specify indexes in the manifest and pin to them by name. This will be done in subsequent PR's.

Tests

There are two automated tests that have been added:

  1. Test of pinning logic in an integration test.
  2. Test of pinning to pytorch specifically, so we can be sure that this works.

@nichmor nichmor marked this pull request as ready for review November 5, 2024 15:33
@nichmor nichmor changed the title feat: add pypi indexes feat: add pypi index Nov 5, 2024
Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

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

Looks good, could you add it in the docs/reference/project_configuration.md?

tests/integration_rust/common/mod.rs Outdated Show resolved Hide resolved
python = "~=3.12.0"

[pypi-dependencies]
foo = {{ version = "*", index = "{pypi_indexes}multiple-indexes-a/index" }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's good to also add torch here, it shouldn't be to slow as it's only solving and it's the main usecase for this feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've added this in different test, I think its better to isolate this one :)

@tdejager
Copy link
Contributor

Something is broken, we need to have this fix first: #2501

@tdejager
Copy link
Contributor

This should all be good now, the failing test is unrelated.

@tdejager tdejager requested a review from ruben-arts November 21, 2024 15:09
@ruben-arts ruben-arts merged commit 1650d6a into prefix-dev:main Nov 22, 2024
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants