From bf8caf548b951bf0a06320f77e5019bb891ea106 Mon Sep 17 00:00:00 2001 From: conda-bot <18747875+conda-bot@users.noreply.github.com> Date: Tue, 5 Sep 2023 15:02:40 -0500 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=94=84=20synced=20file(s)=20with=20co?= =?UTF-8?q?nda/infrastructure=20(#4994)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Conda Bot --- .github/workflows/labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index b2c2e821d8..ebfafa82a2 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -20,7 +20,7 @@ jobs: GLOBAL: https://raw.githubusercontent.com/conda/infra/main/.github/global.yml LOCAL: .github/labels.yml steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - id: has_local uses: andstor/file-existence-action@v2.0.0 with: From 7e6b035cbdd14ed50c31a6fc3a6bcc35723fd921 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 20:35:21 +0200 Subject: [PATCH 2/6] [pre-commit.ci] pre-commit autoupdate (#5001) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59f04c445b..379137b52d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,7 +58,7 @@ repos: # auto sort Python imports - id: isort - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: # auto format Python codes - id: black From 735e506b84c4fb5afbcab0fa5639c0a0c081ad3a Mon Sep 17 00:00:00 2001 From: Dave Karetnyk Date: Sat, 16 Sep 2023 12:21:09 +0200 Subject: [PATCH 3/6] Update docs regarding base env use (#5004) Co-authored-by: Bianca Henderson Co-authored-by: Jannis Leidel --- docs/source/install-conda-build.rst | 43 +++++++++++++++++++++++++++ news/4995-run-conda-build-in-base-env | 19 ++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 news/4995-run-conda-build-in-base-env diff --git a/docs/source/install-conda-build.rst b/docs/source/install-conda-build.rst index e8cc6c9425..dd52e930ff 100644 --- a/docs/source/install-conda-build.rst +++ b/docs/source/install-conda-build.rst @@ -9,6 +9,42 @@ To enable building conda packages: * update conda and conda-build +.. _-conda-build-wow: + +Way of working +============== + +For proper functioning, it is strongly recommended to install conda-build in +the conda ``base`` environment. Not doing so may lead to problems. + +Explanation +----------- + +With earlier conda / conda-build versions, it was possible to build packages in +your own defined environment, e.g. ``my_build_env``. This was partly driven by +the general conda recommendation not to use the ``base`` env for normal work; +see `Conda Managing Environments`_ for instance. However, conda-build is better +viewed as part of the conda infrastructure, and not as a normal package. Hence, +installing it in the ``base`` env makes more sense. More information: +`Must conda-build be installed in the base envt?`_ + +Other considerations +-------------------- + +* An installation or update of conda-build (in fact, of any package) in the ``base`` + environment needs to be run from an account with the proper permissions + (i.e., the same permissions as were used to install conda and the base env in + the first place via the Miniconda or Anaconda installers). For example, on + Windows that might mean an account with administrator privileges. + +* `conda-verfiy`_ is a useful package that can also be added to the base + environment in order to remove some warnings generated when conda-build runs. + +* For critical CI/CD projects, you might want to pin to an explicit (but recent) + version of conda-build, i.e. only update to a newer version of conda-build + and conda once they have been first verified "offline". + + .. _install-conda-build: Installing conda-build @@ -18,6 +54,7 @@ To install conda-build, in your terminal window or an Anaconda Prompt, run: .. code-block:: bash + conda activate base conda install conda-build @@ -31,8 +68,14 @@ To update conda and conda-build, in your terminal window or an Anaconda Prompt, .. code-block:: bash + conda activate base conda update conda conda update conda-build For release notes, see the `conda-build GitHub page `_. + + +.. _`Conda Managing Environments`: https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-environments +.. _`conda-verfiy`: https://github.com/conda/conda-verify +.. _`Must conda-build be installed in the base envt?`: https://github.com/conda/conda-build/issues/4995 diff --git a/news/4995-run-conda-build-in-base-env b/news/4995-run-conda-build-in-base-env new file mode 100644 index 0000000000..41a6fc82d9 --- /dev/null +++ b/news/4995-run-conda-build-in-base-env @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* + +### Deprecations + +* + +### Docs + +* Add explanation that conda-build should be run from the base env. (#4995) + +### Other + +* From 82fc11a474bcb396b20a0ee825e68467838f9d24 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 18 Sep 2023 21:22:56 +0200 Subject: [PATCH 4/6] Migrate to new version of readthedocs config. (#5006) --- .github/dependabot.yml | 15 +++++++++++++++ .readthedocs.yml | 6 +++++- docs/requirements.txt | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..07210519aa --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/docs/" + schedule: + interval: "weekly" + allow: + # Allow only production updates for Sphinx + - dependency-name: "sphinx" + dependency-type: "production" diff --git a/.readthedocs.yml b/.readthedocs.yml index a452d9dedf..abdbda6254 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,7 +1,11 @@ version: 2 +build: + os: "ubuntu-22.04" + tools: + python: "3.11" + python: - version: "3" install: - requirements: docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt index 14557857f9..ac7b1b5aeb 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ linkify-it-py==1.0.1 myst-parser==0.15.2 Pillow==9.3.0 -PyYAML==5.4.1 +PyYAML==6.0.1 requests==2.31.0 ruamel.yaml==0.17.16 Sphinx==4.2.0 From 47909dad7552cc02276fefc53848e79f4f4b3356 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Mon, 18 Sep 2023 21:24:56 +0200 Subject: [PATCH 5/6] Clarify which environment gets activated first (#4942) --- docs/source/resources/define-metadata.rst | 7 ++++--- news/4942-docs-prefix-activation | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 news/4942-docs-prefix-activation diff --git a/docs/source/resources/define-metadata.rst b/docs/source/resources/define-metadata.rst index 478a442062..d314349b2b 100644 --- a/docs/source/resources/define-metadata.rst +++ b/docs/source/resources/define-metadata.rst @@ -992,9 +992,10 @@ words, a Python package would list ``python`` here and an R package would list The PREFIX environment variable points to the host prefix. With respect to activation during builds, both the host and build environments are activated. -The build prefix is activated before the host prefix so that the host prefix -has priority over the build prefix. Executables that don't exist in the host -prefix should be found in the build prefix. +The build prefix is activated *after* the host prefix so that the build prefix, +which always contains native executables for the running platform, has priority +over the host prefix, which is not guaranteed to provide native executables (e.g. +when cross-compiling). As of conda-build 3.1.4, the build and host prefixes are always separate when both are defined, or when ``{{ compiler() }}`` Jinja2 functions are used. The diff --git a/news/4942-docs-prefix-activation b/news/4942-docs-prefix-activation new file mode 100644 index 0000000000..9c9f0ca7f5 --- /dev/null +++ b/news/4942-docs-prefix-activation @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* + +### Deprecations + +* + +### Docs + +* Clarify that the `build` prefix is activated _after_ the `host` prefix. (#4942) + +### Other + +* From 3ba167b78edf419b1c290363d62e934b6e6dc47a Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 19 Sep 2023 10:54:11 -0600 Subject: [PATCH 6/6] Updating documentation to describe ~= package specification (#4930) * Migrating information to tables. * Adding a few line breaks for readability. * Adding in more info. * Adding rest of documentation. * Adding news. * Update news/4553-document-compatibility-release-operator Co-authored-by: Jannis Leidel * Remove raw html and moving some examples to a better section. * Update docs/source/resources/package-spec.rst Co-authored-by: Katherine Kinnaman * Update docs/source/resources/package-spec.rst Co-authored-by: Katherine Kinnaman * Update docs/source/resources/package-spec.rst Co-authored-by: Katherine Kinnaman * Update docs/source/resources/package-spec.rst Co-authored-by: Katherine Kinnaman * Update docs/source/resources/package-spec.rst Co-authored-by: Katherine Kinnaman * Making suggested edit. --------- Co-authored-by: Jannis Leidel Co-authored-by: Katherine Kinnaman --- docs/source/resources/package-spec.rst | 160 ++++++++++-------- ...53-document-compatibility-release-operator | 3 + 2 files changed, 91 insertions(+), 72 deletions(-) create mode 100644 news/4553-document-compatibility-release-operator diff --git a/docs/source/resources/package-spec.rst b/docs/source/resources/package-spec.rst index d06e180043..a3f0c98ac9 100644 --- a/docs/source/resources/package-spec.rst +++ b/docs/source/resources/package-spec.rst @@ -62,7 +62,7 @@ conda package is composed of the first 3 values, as in: ``--.tar.bz2`` or ``--.conda``. .. list-table:: - :widths: 15 15 70 + :widths: 15 15 45 * - **Key** - **Type** @@ -76,8 +76,7 @@ conda package is composed of the first 3 values, as in: * - version - string - The package version. May not contain "-". Conda - acknowledges `PEP 440 - `_. + acknowledges `PEP 440 `_. * - build - string @@ -96,15 +95,13 @@ conda package is composed of the first 3 values, as in: * - build_number - integer - - A non-negative integer representing the build number of - the package. + - A non-negative integer representing the build number of the package. - Unlike the build string, the ``build_number`` is inspected by - conda. Conda uses it to sort packages that have otherwise - identical names and versions to determine the latest one. - This is important because new builds that contain bug - fixes for the way a package is built may be added to a - repository. + Unlike the build string, the ``build_number`` is inspected by conda. + + Conda uses it to sort packages that have otherwise identical names and versions to determine the latest one. + + This is important because new builds that contain bug fixes for the way a package is built may be added to a repository. * - depends - list of strings @@ -125,10 +122,12 @@ conda package is composed of the first 3 values, as in: EXAMPLE: ``osx`` - Conda currently does not use this key. Packages for a - specific architecture and platform are usually - distinguished by the repository subdirectory that contains - them---see :ref:`repo-si`. + Conda currently does not use this key. + + Packages for a specific architecture and platform are usually distinguished by the repository subdirectory that contains + them. + + See :ref:`repo-si`. info/files ---------- @@ -284,44 +283,59 @@ parts: * The first part is always the exact name of the package. * The second part refers to the version and may contain special - characters: + characters. See table below. - * \| means OR. +* The third part is always the exact build string. When there are + three parts, the second part must be the exact version. - EXAMPLE: ``1.0|1.2`` matches version 1.0 or 1.2. +.. list-table:: Version Special Characters + :widths: 10, 40, 40 + :header-rows: 1 - * \* matches 0 or more characters in the version string. In - terms of regular expressions, it is the same as ``r'.*'``. + * - Symbol + - Meaning + - Example - EXAMPLE: 1.0|1.4* matches 1.0, 1.4 and 1.4.1b2, but not 1.2. + * - <, >, <=, >= + - Relational operators on versions, - * <, >, <=, >=, ==, and != are relational operators on versions, - which are compared using - `PEP-440 `_. For example, - ``<=1.0`` matches ``0.9``, ``0.9.1``, and ``1.0``, but not ``1.0.1``. - ``==`` and ``!=`` are exact equality. + which are compared using `PEP-440 `_. + - ``<=1.0`` matches 0.9, 0.9.1, and 1.0, but not 1.0.1. - Pre-release versioning is also supported such that ``>1.0b4`` will match - ``1.0b5`` and ``1.0rc1`` but not ``1.0b4`` or ``1.0a5``. + * - ==, and != + - Exact equality and not equalities. + - ``==0.5.1`` matches 0.5.1 and not anything else while ``!=0.5.1`` matches everything but. - EXAMPLE: <=1.0 matches 0.9, 0.9.1, and 1.0, but not 1.0.1. + * - ~= + - Compatibility Release + - ``~=0.5.3`` is equivalent to ``>=0.5.3, <0.6.0a`` - * , means AND. + * - \| + - OR + - ``1.0|1.2`` matches version 1.0 or 1.2. - EXAMPLE: >=2,<3 matches all packages in the 2 series. 2.0, - 2.1, and 2.9 all match, but 3.0 and 1.0 do not. + * - \* + - Matches 0 or more characters in the version string. - * , has higher precedence than \|, so >=1,<2|>3 means greater - than or equal to 1 AND less than 2 or greater than 3, which - matches 1, 1.3 and 3.0, but not 2.2. + In terms of regular expressions, it is the same as ``r'.*'``. + - ``1.0|1.4*`` matches 1.0, 1.4 and 1.4.1b2, but not 1.2. - Conda parses the version by splitting it into parts separated - by \|. If the part begins with <, >, =, or !, it is parsed as a - relational operator. Otherwise, it is parsed as a version, - possibly containing the "*" operator. + * - , + - AND + - ``>=2,<3`` matches all packages in the 2 series. -* The third part is always the exact build string. When there are - 3 parts, the second part must be the exact version. + 2.0, 2.1, and 2.9 all match, but 3.0 and 1.0 do not. + +.. hint:: + ``,`` has higher precedence than \|, so >=1,<2|>3 means greater than or equal to 1 AND less than 2 or greater than 3, which matches 1, 1.3 and 3.0, but not 2.2. + +.. note:: + For package match specifications, pre-release versioning is also supported such that ``>1.0b4`` will match ``1.0b5`` and ``1.0rc1`` but not ``1.0b4`` or ``1.0a5``. + +Conda parses the version by splitting it into parts separated +by \|. If the part begins with <, >, =, or !, it is parsed as a +relational operator. Otherwise, it is parsed as a version, +possibly containing the "*" operator. Remember that the version specification cannot contain spaces, as spaces are used to delimit the package, version, and build @@ -329,40 +343,13 @@ string in the whole match specification. ``python >= 2.7`` is an invalid match specification. However, ``"python >= 2.7"`` (with double or single quotes) is matched as any version of a package named ``python>=2.7``. -When using the command line, put double or single quotes around any package -version specification that contains the space character or any of -the following characters: <, >, \*, or \|. - -EXAMPLE:: - - conda install numpy=1.11 - conda install numpy==1.11 - conda install "numpy>1.11" - conda install "numpy=1.11.1|1.11.3" - conda install "numpy>=1.8,<2" - +Examples of Package Specs +------------------------- -Examples --------- - -The OR constraint "numpy=1.11.1|1.11.3" matches with 1.11.1 or -1.11.3. - -The AND constraint "numpy>=1.8,<2" matches with 1.8 and 1.9 but -not 2.0. - -The fuzzy constraint numpy=1.11 matches 1.11, 1.11.0, 1.11.1, -1.11.2, 1.11.18, and so on. - -The exact constraint numpy==1.11 matches 1.11, 1.11.0, 1.11.0.0, -and so on. - -The build string constraint "numpy=1.11.2=*nomkl*" matches the -NumPy 1.11.2 packages without MKL but not the normal MKL NumPy +The build string constraint "numpy=1.11.2=*nomkl*" matches the NumPy 1.11.2 packages without MKL, but not the normal MKL NumPy 1.11.2 packages. -The build string constraint "numpy=1.11.1|1.11.3=py36_0" matches -NumPy 1.11.1 or 1.11.3 built for Python 3.6 but not any versions +The build string constraint "numpy=1.11.1|1.11.3=py36_0" matches NumPy 1.11.1 or 1.11.3 built for Python 3.6, but not any versions of NumPy built for Python 3.5 or Python 2.7. The following are all valid match specifications for @@ -378,3 +365,32 @@ numpy-1.8.1-py27_0: * numpy >=1.8,<2|1.9 * numpy 1.8.1 py27_0 * numpy=1.8.1=py27_0 + +Command Line Match Spec Examples +-------------------------------- + +When using the command line, put double or single quotes around any package +version specification that contains the space character or any of +the following characters: <, >, \*, or \|. + +.. list-table:: Examples + :widths: 30 60 + :header-rows: 1 + + * - Example + - Meaning + + * - conda install numpy=1.11 + - The fuzzy constraint numpy=1.11 matches 1.11, 1.11.0, 1.11.1, 1.11.2, 1.11.18, and so on. + + * - conda install numpy==1.11 + - The exact constraint numpy==1.11 matches 1.11, 1.11.0, 1.11.0.0, and so on. + + * - conda install "numpy=1.11.1|1.11.3" + - The OR constraint "numpy=1.11.1|1.11.3" matches with 1.11.1 or 1.11.3. + + * - conda install "numpy>1.11" + - Any numpy version 1.12.0a or greater. + + * - conda install "numpy>=1.8,<2" + - The AND constraint "numpy>=1.8,<2" matches with 1.8 and 1.9 but not 2.0. diff --git a/news/4553-document-compatibility-release-operator b/news/4553-document-compatibility-release-operator new file mode 100644 index 0000000000..f5d3dcde47 --- /dev/null +++ b/news/4553-document-compatibility-release-operator @@ -0,0 +1,3 @@ +### Docs + +* Document `~=` (compatibility release) match spec. (#4553)