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

explicit = true on index is not honored #10090

Open
tmatup opened this issue Dec 22, 2024 · 7 comments
Open

explicit = true on index is not honored #10090

tmatup opened this issue Dec 22, 2024 · 7 comments
Labels
needs-mre Needs more information for reproduction

Comments

@tmatup
Copy link

tmatup commented Dec 22, 2024

pyproject.toml

[project]
name = "my-project"
version = "0.1.0"
description = "My Project"
authors = []
readme = "README.md"
requires-python = ">=3.10,<3.12"
dependencies = [
    # FROZEN DEPENDENCIES
    "mypackage==1.0.1024",

    # UPDATEABLE DEPENDENCIES - MAJOR
    "pandas>=2.2.3"
]

[[tool.uv.index]]
name = "myindex"
url = "https://myorg.pkgs.visualstudio.com/myproject/_packaging/myfeed/pypi/simple/"
explicit = true

[tool.uv.sources]
mypackage = { index = "myindex" }

uv lock

(py311) joe@test:~/root/$ uv lock
Using CPython 3.10.16
error: Failed to fetch: `https://https//myorg.pkgs.visualstudio.com/myproject/_packaging/myfeed/pypi/simple/gevent/`
  Caused by: Could not connect, are you offline?
  Caused by: Request failed after 3 retries
  Caused by: error sending request for url (https://https//myorg.pkgs.visualstudio.com/myproject/_packaging/myfeed/pypi/simple/gevent/)
  Caused by: client error (Connect)
  Caused by: dns error: failed to lookup address information: Temporary failure in name resolution
  Caused by: failed to lookup address information: Temporary failure in name resolution

uv version

(py311) joe@test:~/root/$ pip show uv
Name: uv
Version: 0.5.11
Summary: An extremely fast Python package and project manager, written in Rust.
Home-page: https://pypi.org/project/uv/
Author: uv
Author-email: "Astral Software Inc." <[email protected]>
License: MIT OR Apache-2.0
Location: /home/joe/venvs/py311/lib/python3.11/site-packages
Requires: 
Required-by: 

Per https://docs.astral.sh/uv/configuration/indexes/#pinning-a-package-to-an-index, shouldn't the index be used for resolving only the mypackage package?

@charliermarsh
Copy link
Member

Yes, but it's going to be hard for me to help without a reproduction that I can run myself. uv lock --show-settings might be helpful.

@charliermarsh charliermarsh added the needs-mre Needs more information for reproduction label Dec 22, 2024
@tmatup
Copy link
Author

tmatup commented Dec 22, 2024

Please see below for the uv lock --show-settings output. Note that I redacted the username, password, org, project, and feed values.

GlobalSettings {
    quiet: false,
    verbose: 0,
    color: Auto,
    native_tls: false,
    concurrency: Concurrency {
        downloads: 50,
        builds: 48,
        installs: 48,
    },
    connectivity: Online,
    allow_insecure_host: [],
    show_settings: true,
    preview: Disabled,
    python_preference: Managed,
    python_downloads: Automatic,
    no_progress: false,
    installer_metadata: true,
}
CacheSettings {
    no_cache: false,
    cache_dir: None,
}
LockSettings {
    locked: false,
    frozen: false,
    dry_run: false,
    python: None,
    install_mirrors: PythonInstallMirrors {
        python_install_mirror: None,
        pypy_install_mirror: None,
    },
    refresh: None(
        Timestamp(
            SystemTime {
                tv_sec: 1734896684,
                tv_nsec: 460173761,
            },
        ),
    ),
    settings: ResolverSettings {
        index_locations: IndexLocations {
            indexes: [
                Index {
                    name: None,
                    url: Url(
                        VerbatimUrl {
                            url: Url {
                                scheme: "https",
                                cannot_be_a_base: false,
                                username: "<username>",
                                password: Some(
                                    "<password>",
                                ),
                                host: Some(
                                    Domain(
                                        "https",
                                    ),
                                ),
                                port: None,
                                path: "//myorg.pkgs.visualstudio.com/myproject/_packaging/myfeed/pypi/simple",
                                query: None,
                                fragment: None,
                            },
                            given: Some(
                                "https://<username>:<password>@https://myorg.pkgs.visualstudio.com/myproject/_packaging/myfeed/pypi/simple",
                            ),
                        },
                    ),
                    explicit: false,
                    default: false,
                    origin: Some(
                        Cli,
                    ),
                    publish_url: None,
                },
            ],
            flat_index: [],
            no_index: false,
        },
        index_strategy: FirstIndex,
        keyring_provider: Disabled,
        resolution: Highest,
        prerelease: IfNecessaryOrExplicit,
        fork_strategy: RequiresPython,
        dependency_metadata: DependencyMetadata(
            {},
        ),
        config_setting: ConfigSettings(
            {},
        ),
        no_build_isolation: false,
        no_build_isolation_package: [],
        exclude_newer: None,
        link_mode: Hardlink,
        upgrade: None,
        build_options: BuildOptions {
            no_binary: None,
            no_build: None,
        },
        sources: Enabled,
    },
}

@charliermarsh
Copy link
Member

It looks like you're providing the index over the CLI -- is that correct?

@tmatup
Copy link
Author

tmatup commented Dec 22, 2024

Yep, I had the UV_EXTRA_INDEX_URL env added to my bashrc. I had it removed, and now I am getting a different error when doing uv lock, based on the pyproject.toml that I have (shared earlier), what could be wrong?

(py311) joe@test:~/root/$ uv lock
Using CPython 3.10.16
  × No solution found when resolving dependencies for split (python_full_version >= '3.10' and sys_platform == 'darwin'):
  ╰─▶ Because mypackage was not found in the package registry and sandbox depends on mypackage==1.0.2408007, we can conclude that sandbox 's requirements are unsatisfiable.
      And because your workspace requires sandbox, we can conclude that your workspace's requirements are unsatisfiable.

Though I was able to do pip install successfully of the package when directly install thru pip

(py311) joe@test:~/root/$ pip install --extra-index-url https://<username>:<pat>@myorg.pkgs.visualstudio.com/myproject/_packaging/myfeed/pypi/simple/ mypackage==1.0.1024
Looking in indexes: https://pypi.org/simple, https://<username>:****@myorg.pkgs.visualstudio.com/myproject/_packaging/myfeed/pypi/simple/
Requirement already satisfied: mypackage==1.0.1024 in /home/joe/venvs/py311/lib/python3.11/site-packages (1.0.1024)
Requirement already satisfied: Pillow in /home/venvs/venvs/py311/lib/python3.11/site-packages (from mypackage==1.0.1024) (11.0.0)
Requirement already satisfied: numpy in /home/venvs/venvs/py311/lib/python3.11/site-packages (from mypackage==1.0.1024) (1.26.4)
Requirement already satisfied: scikit-learn in /home/venvs/venvs/py311/lib/python3.11/site-packages (from mypackage==1.0.1024) (1.5.2)
Requirement already satisfied: scipy>=1.6.0 in /home/venvs/venvs/py311/lib/python3.11/site-packages (from scikit-learn->mypackage==1.0.1024) (1.14.1)
Requirement already satisfied: joblib>=1.2.0 in /home/venvs/venvs/py311/lib/python3.11/site-packages (from scikit-learn->mypackage==1.0.1024) (1.4.2)
Requirement already satisfied: threadpoolctl>=3.1.0 in /home/venvs/venvs/py311/lib/python3.11/site-packages (from scikit-learn->mypackage==1.0.1024) (3.5.0)

And I have the following env variable declared in my bashrc

# uv
export UV_INDEX_DUFEED_USERNAME="<username>"
export UV_INDEX_DUFEED_PASSWORD=<pat>
export AZURE_PACKAGES_TOKEN=<pat>

@tmatup
Copy link
Author

tmatup commented Dec 23, 2024

@charliermarsh any insights for this? I can create a separate issue for this if you want.

@charliermarsh
Copy link
Member

My guess is that authentication is failing somewhere. Can you share the (redacted) logs with --verbose?

@tmatup
Copy link
Author

tmatup commented Dec 23, 2024

@charliermarsh Please see attached for the log. dm_shared is the package name. I used the same credentials when doing pip install. And looks like it indeed found the path to the exact whl file that need to be downloaded and installed. Could the url (convention) be wrong in the pyproject.toml file?

uv_lock.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-mre Needs more information for reproduction
Projects
None yet
Development

No branches or pull requests

2 participants