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

Update to 24.2, use pip source to install itself #30

Merged
merged 5 commits into from
Aug 12, 2024
Merged

Update to 24.2, use pip source to install itself #30

merged 5 commits into from
Aug 12, 2024

Conversation

jjhelmus
Copy link

@jjhelmus jjhelmus commented Aug 7, 2024

pip 24.2

Destination channel: defaults

Links

Explanation of changes:

@jjhelmus jjhelmus changed the title V24.2 Update to 24.2, use pip source to install itself Aug 7, 2024
@anaconda-pkg-build
Copy link

Linter check found the following problems: ERROR conda.cli.main_run:execute(125): `conda run conda-lint /tmp/abs_adjh1sd0y5/clone` failed. (See above for error) The following problems have been found:

===== ERRORS =====

  • clone/recipe/build.sh:3: pip_install_args: pip install should be run with --no-deps and --no-build-isolation.
  • clone/recipe/meta.yaml:39: invalid_url: https://pip.pypa.io : Not reachable: 403
  • clone/recipe/meta.yaml:48: invalid_url: https://pip.pypa.io : Not reachable: 403
    ===== Final Report: =====
    3 Errors and 0 Warnings were found

@anaconda-pkg-build
Copy link

Linter check found the following problems: ERROR conda.cli.main_run:execute(125): `conda run conda-lint /tmp/abs_f61sopcfw2/clone` failed. (See above for error) The following problems have been found:

===== ERRORS =====

  • clone/recipe/meta.yaml:48: invalid_url: https://pip.pypa.io : Not reachable: 403
  • clone/recipe/meta.yaml:39: invalid_url: https://pip.pypa.io : Not reachable: 403
    ===== Final Report: =====
    2 Errors and 0 Warnings were found

@anaconda-pkg-build
Copy link

Linter check found the following problems: ERROR conda.cli.main_run:execute(125): `conda run conda-lint /tmp/abs_cdxo1u_7uf/clone` failed. (See above for error) The following problems have been found:

===== ERRORS =====

  • clone/recipe/meta.yaml:48: invalid_url: https://pip.pypa.io : Not reachable: 403
  • clone/recipe/meta.yaml:39: invalid_url: https://pip.pypa.io : Not reachable: 403
    ===== Final Report: =====
    2 Errors and 0 Warnings were found

@@ -1,9 +1,10 @@
#!/bin/bash

$PYTHON setup.py install --single-version-externally-managed --record record.txt
# use the pip source to install itself
PYTHONPATH="./src" $PYTHON -m pip install --no-deps --no-build-isolation . -vv
Copy link

Choose a reason for hiding this comment

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

Neat!

Copy link

Choose a reason for hiding this comment

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

how does that work? the pip program is loaded into memory then the version in memory installs the version on disc?

Copy link

@danpetry danpetry Aug 7, 2024

Choose a reason for hiding this comment

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

does that remove the need to set CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=0?

Copy link

Choose a reason for hiding this comment

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

how does that work? the pip program is loaded into memory then the version in memory installs the version on disc?

Well, everything is always loaded in memory... What it does is just rely on the non-installed (so in-tree) pip to install itself. -m pip will call src/pip/__main__.py which is the CLI entrypoint.

Copy link
Author

@jjhelmus jjhelmus Aug 7, 2024

Choose a reason for hiding this comment

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

When importing packages, Python will search and load modules from various location on disk, such as from the site-packages directory. The PYTHONPATH variable can be use to add locations to the search path.

Copy link
Author

Choose a reason for hiding this comment

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

does that remove the need to set CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=0?

No, CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY prevents conda from installing the pip conda package when python is listed as a requirement in the recipe. The environment variable is the same as setting add_pip_as_python_dependency: false in .condarc.

Copy link

@JeanChristopheMorinPerso JeanChristopheMorinPerso left a comment

Choose a reason for hiding this comment

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

@jjhelmus
Copy link
Author

jjhelmus commented Aug 9, 2024

Latest versions of pip requires python python>=3.8 AFAIK, see https://inspector.pypi.io/project/pip/24.2/packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl/pip-24.2.dist-info/METADATA#line.25. Should we also follow that?

Yes. I bumped the minimum version for the build to 3.8.

@anaconda-pkg-build
Copy link

Linter check found the following problems: ERROR conda.cli.main_run:execute(125): `conda run conda-lint /tmp/abs_94xk0pz503/clone` failed. (See above for error) The following problems have been found:

===== ERRORS =====

  • clone/recipe/meta.yaml:39: invalid_url: https://pip.pypa.io : Not reachable: 403
  • clone/recipe/meta.yaml:48: invalid_url: https://pip.pypa.io : Not reachable: 403
    ===== Final Report: =====
    2 Errors and 0 Warnings were found

Copy link

@danpetry danpetry left a comment

Choose a reason for hiding this comment

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

LGTM AFAICS. Do you need to build a couple of packages with it to make sure nothing untoward is happening? ("shouldn't" be, but in my experience bodies are buried in the distro and weird stuff can happen with build tools, we had an issue with this recently)

@cbouss cbouss merged commit a02d490 into master Aug 12, 2024
7 of 8 checks passed
@cbouss cbouss deleted the v24.2 branch August 12, 2024 17:42
@anaconda-pkg-build
Copy link

Linter check found the following problems: ERROR conda.cli.main_run:execute(125): `conda run conda-lint /tmp/abs_53xo6c8hgk/clone` failed. (See above for error) The following problems have been found:

===== ERRORS =====

  • clone/recipe/meta.yaml:48: invalid_url: https://pip.pypa.io : Not reachable: 403
  • clone/recipe/meta.yaml:39: invalid_url: https://pip.pypa.io : Not reachable: 403
    ===== Final Report: =====
    2 Errors and 0 Warnings were found

@danpetry
Copy link

Do you need to build a couple of packages with it to make sure nothing untoward is happening? ("shouldn't" be, but in my experience bodies are buried in the distro and weird stuff can happen with build tools, we had an issue with this recently)

FWIW: AnacondaRecipes/xgboost-feedstock#20

@JeanChristopheMorinPerso

@danpetry I don't think it has to do with pip. Pip became more strict, but it's not a bug, it's a feature.

@danpetry
Copy link

looking more at the comment you made on xgboost, it's about a specific hatch hook which may not be used in all feedstocks, is that right? or even an implementation in the xgboost code which is very unlikely to appear in other feedstocks..?

@JeanChristopheMorinPerso

Yes. It's going to be a problem for projects that set their own tags, which should be a low number of projects.

@jjhelmus jjhelmus mentioned this pull request Sep 4, 2024
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.

6 participants