From 9e8eda0a252f9a2689603c80cf31696d63bf99d0 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Sat, 16 Nov 2024 23:57:42 -0700 Subject: [PATCH] docs: Remove 'pip install' options in recipes * Remove --no-deps, --no-build-isolation, and --ignore-installed 'pip install' options in recipes as conda-build will enforce all required 'pip install' options itself at build time. * Add corresponding news item. --- conda_build/skeletons/pypi.py | 2 +- conda_build/templates/setuptools.yaml | 2 +- docs/click/meta.yaml | 2 +- docs/source/resources/define-metadata.rst | 2 +- docs/source/user-guide/tutorials/meta.yaml | 2 +- news/5541-remove-pip-install-options-from-recipes | 5 +++++ recipe/meta.yaml | 2 +- tests/test-recipes/metadata/_noarch_none/meta.yaml | 2 +- .../test-recipes/metadata/_pypi_installer_metadata/meta.yaml | 2 +- tests/test-recipes/metadata/_render_recipe/meta.yaml | 2 +- tests/test-recipes/metadata/entry_points/bld.bat | 2 +- tests/test-recipes/metadata/entry_points/build.sh | 2 +- .../test-recipes/metadata/entry_points_have_prefix/meta.yaml | 2 +- .../meta.yaml | 2 +- tests/test-recipes/metadata/jinja_load_toml/meta.yaml | 2 +- tests/test-recipes/metadata/jinja_load_yaml/meta.yaml | 2 +- tests/test_pypi_skeleton.py | 4 ++-- 17 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 news/5541-remove-pip-install-options-from-recipes diff --git a/conda_build/skeletons/pypi.py b/conda_build/skeletons/pypi.py index 6e33af5d89..d47dbbfd10 100644 --- a/conda_build/skeletons/pypi.py +++ b/conda_build/skeletons/pypi.py @@ -432,7 +432,7 @@ def skeletonize( ordered_recipe["build"]["noarch"] = "python" recipe_script_cmd = [ - "{{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation" + "{{ PYTHON }} -m pip install . -vv" ] ordered_recipe["build"]["script"] = " ".join( recipe_script_cmd + setup_options diff --git a/conda_build/templates/setuptools.yaml b/conda_build/templates/setuptools.yaml index 4a850744ed..06aba54183 100644 --- a/conda_build/templates/setuptools.yaml +++ b/conda_build/templates/setuptools.yaml @@ -10,7 +10,7 @@ build: number: {% block build_number -%}1{%- endblock %} script: - cd $RECIPE_DIR - - pip install --no-deps . + - pip install . {% block entry_points -%} entry_points: {{data.get('entry_points', {}).get('console_scripts', [])}} diff --git a/docs/click/meta.yaml b/docs/click/meta.yaml index 1dae56e3d2..30e6f2e676 100644 --- a/docs/click/meta.yaml +++ b/docs/click/meta.yaml @@ -11,7 +11,7 @@ source: build: number: 0 - script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv " + script: "{{ PYTHON }} -m pip install . -vv " requirements: host: diff --git a/docs/source/resources/define-metadata.rst b/docs/source/resources/define-metadata.rst index 06cc7234cb..06cc8115cc 100644 --- a/docs/source/resources/define-metadata.rst +++ b/docs/source/resources/define-metadata.rst @@ -22,7 +22,7 @@ All the metadata in the conda-build recipe is specified in the build: noarch: python number: 0 - script: python -m pip install --no-deps --ignore-installed . + script: python -m pip install . requirements: host: diff --git a/docs/source/user-guide/tutorials/meta.yaml b/docs/source/user-guide/tutorials/meta.yaml index 663ef08f4f..464e4f6b5b 100644 --- a/docs/source/user-guide/tutorials/meta.yaml +++ b/docs/source/user-guide/tutorials/meta.yaml @@ -11,7 +11,7 @@ source: build: number: 0 - script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv " + script: "{{ PYTHON }} -m pip install . -vv " requirements: host: diff --git a/news/5541-remove-pip-install-options-from-recipes b/news/5541-remove-pip-install-options-from-recipes new file mode 100644 index 0000000000..d5d11bd5b5 --- /dev/null +++ b/news/5541-remove-pip-install-options-from-recipes @@ -0,0 +1,5 @@ +### Other + +* Remove `--no-deps`, `--no-build-isolation`, and `--ignore-installed` + `pip install` options in example recipes as `conda-build` will enforce + all required `pip install` options itself at build time. (#5541) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 7bb7c812bc..581ad9aa06 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -8,7 +8,7 @@ source: git_url: ../ build: - script: {{ PYTHON }} -m pip install . --no-deps --no-build-isolation -vv + script: {{ PYTHON }} -m pip install . -vv entry_points: - conda-build = conda_build.cli.main_build:execute - conda-convert = conda_build.cli.main_convert:execute diff --git a/tests/test-recipes/metadata/_noarch_none/meta.yaml b/tests/test-recipes/metadata/_noarch_none/meta.yaml index fa4394e511..31722822b6 100644 --- a/tests/test-recipes/metadata/_noarch_none/meta.yaml +++ b/tests/test-recipes/metadata/_noarch_none/meta.yaml @@ -6,7 +6,7 @@ source: path: ./noarch_test_package build: - script: pip install --no-deps . + script: pip install . noarch: none requirements: diff --git a/tests/test-recipes/metadata/_pypi_installer_metadata/meta.yaml b/tests/test-recipes/metadata/_pypi_installer_metadata/meta.yaml index bb22babecd..20259b29f7 100644 --- a/tests/test-recipes/metadata/_pypi_installer_metadata/meta.yaml +++ b/tests/test-recipes/metadata/_pypi_installer_metadata/meta.yaml @@ -11,7 +11,7 @@ source: build: number: 0 - script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv " + script: "{{ PYTHON }} -m pip install . -vv " requirements: host: diff --git a/tests/test-recipes/metadata/_render_recipe/meta.yaml b/tests/test-recipes/metadata/_render_recipe/meta.yaml index c9f171b4bb..98478e2c47 100644 --- a/tests/test-recipes/metadata/_render_recipe/meta.yaml +++ b/tests/test-recipes/metadata/_render_recipe/meta.yaml @@ -19,7 +19,7 @@ build: script: - {{ PYTHON }} conf/cythonize.py - export PETSC_DIR=$PREFIX - - {{ PYTHON }} -m pip -v install --no-deps . + - {{ PYTHON }} -m pip -v install . skip: true # [win] track_features: - petsc4py_complex # [scalar == "complex"] diff --git a/tests/test-recipes/metadata/entry_points/bld.bat b/tests/test-recipes/metadata/entry_points/bld.bat index f590fa626d..2ee495dec0 100644 --- a/tests/test-recipes/metadata/entry_points/bld.bat +++ b/tests/test-recipes/metadata/entry_points/bld.bat @@ -1,4 +1,4 @@ :: cd %RECIPE_DIR%\..\..\test-package -:: pip install --no-deps . +:: pip install . python setup.py install --old-and-unmanageable if errorlevel 1 exit 1 diff --git a/tests/test-recipes/metadata/entry_points/build.sh b/tests/test-recipes/metadata/entry_points/build.sh index b10532883a..e4725c5c7e 100644 --- a/tests/test-recipes/metadata/entry_points/build.sh +++ b/tests/test-recipes/metadata/entry_points/build.sh @@ -1,5 +1,5 @@ # conda-build/tests/test-recipes/test-package # cd $RECIPE_DIR/../../test-package -# pip install --no-deps . +# pip install . python setup.py install --old-and-unmanageable diff --git a/tests/test-recipes/metadata/entry_points_have_prefix/meta.yaml b/tests/test-recipes/metadata/entry_points_have_prefix/meta.yaml index 8f250efa67..759f8a2561 100644 --- a/tests/test-recipes/metadata/entry_points_have_prefix/meta.yaml +++ b/tests/test-recipes/metadata/entry_points_have_prefix/meta.yaml @@ -11,7 +11,7 @@ source: build: number: 0 script: - - {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv + - {{ PYTHON }} -m pip install . -vvv requirements: host: diff --git a/tests/test-recipes/metadata/entry_points_have_prefix_noarch_has_prefix_files/meta.yaml b/tests/test-recipes/metadata/entry_points_have_prefix_noarch_has_prefix_files/meta.yaml index 38f29e8560..a051c45f03 100644 --- a/tests/test-recipes/metadata/entry_points_have_prefix_noarch_has_prefix_files/meta.yaml +++ b/tests/test-recipes/metadata/entry_points_have_prefix_noarch_has_prefix_files/meta.yaml @@ -13,7 +13,7 @@ build: noarch: python skip: True # [win] script: - - {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv + - {{ PYTHON }} -m pip install . -vvv # We use 'somewhere' instead of 'bin' here because conda-build is quite broken in what it considers # and entry point script when you use noarch: python, involving finding files in 'bin' that contain # prefix and making assumptions about that (we could check for python in the shebang at least, but diff --git a/tests/test-recipes/metadata/jinja_load_toml/meta.yaml b/tests/test-recipes/metadata/jinja_load_toml/meta.yaml index 99bceccdb7..aec154432f 100644 --- a/tests/test-recipes/metadata/jinja_load_toml/meta.yaml +++ b/tests/test-recipes/metadata/jinja_load_toml/meta.yaml @@ -26,5 +26,5 @@ requirements: {% endfor %} build: - script: {{ PYTHON }} -m pip install --no-deps --ignore-installed . + script: {{ PYTHON }} -m pip install . noarch: python \ No newline at end of file diff --git a/tests/test-recipes/metadata/jinja_load_yaml/meta.yaml b/tests/test-recipes/metadata/jinja_load_yaml/meta.yaml index e554a8022f..5813776913 100644 --- a/tests/test-recipes/metadata/jinja_load_yaml/meta.yaml +++ b/tests/test-recipes/metadata/jinja_load_yaml/meta.yaml @@ -19,5 +19,5 @@ requirements: {% endfor %} build: - script: {{ PYTHON }} -m pip install --no-deps --ignore-installed . + script: {{ PYTHON }} -m pip install . noarch: python \ No newline at end of file diff --git a/tests/test_pypi_skeleton.py b/tests/test_pypi_skeleton.py index 20581ef14d..6562a50f14 100644 --- a/tests/test_pypi_skeleton.py +++ b/tests/test_pypi_skeleton.py @@ -58,7 +58,7 @@ def test_print_dict(): }, "build": { "number": 0, - "script": "{{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation", + "script": "{{ PYTHON }} -m pip install . -vv", }, } recipe_order = ["package", "source", "build", "about"] @@ -74,7 +74,7 @@ def test_print_dict(): build: number: 0 - script: "{{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation" + script: "{{ PYTHON }} -m pip install . -vv" about: home: "https://conda.io"