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

Use python_site_packages_path when specified #14256

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jjhelmus
Copy link
Contributor

@jjhelmus jjhelmus commented Sep 20, 2024

I'm putting this up as an example and for discussion. More work is needed for a complete implementation, especially given that this one breaks backwards compatibility in various function.

Description

When the python package in an environment specifies a python_site_packages_path in its repodata entry, use that path to install noarch: python packages.

Note that this currently only works with the classic solver as libmamba/conda-libmamba-solver does not yet understand this field.

Refs #14053.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@jjhelmus
Copy link
Contributor Author

An example of this:

❯ conda create -n example -c jjhelmus/label/sp_path -c conda-forge python=3.99.90 imagesize --solver classic --yes
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/jhelmus/workspace/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/envs/example

  added / updated specs:
    - imagesize
    - python=3.99.90


The following NEW packages will be INSTALLED:

  imagesize          conda-forge/noarch::imagesize-1.4.1-pyhd8ed1ab_0 
  python             jjhelmus/label/sp_path/noarch::python-3.99.90-0 



Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate example
#
# To deactivate an active environment, use
#
#     $ conda deactivate

❯ tree /Users/jhelmus/workspace/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/envs/example
/Users/jhelmus/workspace/conda/devenv/Darwin/arm64/envs/devenv-3.10-c/envs/example
├── conda-meta
│   ├── history
│   ├── imagesize-1.4.1-pyhd8ed1ab_0.json
│   └── python-3.99.90-0.json
└── sample_path
    └── from_the_file
        └── index_json
            ├── imagesize
            │   ├── __init__.py
            │   └── imagesize.py
            └── imagesize-1.4.1.dist-info
                ├── INSTALLER
                ├── LICENSE.rst
                ├── METADATA
                ├── RECORD
                ├── REQUESTED
                ├── WHEEL
                ├── direct_url.json
                └── top_level.txt

7 directories, 13 files

The python package used here was created with conda-build that includes the change from conda/conda-build#5502.

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Sep 20, 2024
@jezdez jezdez changed the title DRAFT: use python_site_packages_path when specified Use python_site_packages_path when specified Sep 21, 2024
@jezdez jezdez changed the title Use python_site_packages_path when specified Use python_site_packages_path when specified Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

3 participants