{% set on_win = SUBDIR in ('win-64', 'win-32') %}
{% set name = "conda" %}
{% set version = "23.10.0" %}
{% set sha256 = "273d49db8ea723426b87866381daf2df27c7bca2c3474196460d637b62de2a1c" %}
# Running pytest requires the inclusion of test files which baloons
# the size of the package; values can be "yes" or "no"
{% set run_pytest = "no" %}

package:
  name: conda
  version: {{ version }}

source:
  fn: conda-{{ version }}.tar.gz
  url: https://github.com/conda/{{ name }}/archive/{{ version }}.tar.gz
  sha256: {{ sha256 }}

build:
  number: 1
  script: {{ PYTHON }} -m pip install . --no-deps --no-build-isolation -vv && {{ PYTHON }} -m conda init --install
  # These are present when the new environment is created
  # so we have to exempt them from the list of initial files
  # for conda-build to realize they should be included.
  always_include_files:
    - bin/conda                    # [unix]
    - bin/activate                 # [unix]
    - bin/deactivate               # [unix]
    - Scripts/activate.bat         # [win]
    - Scripts/activate             # [win]
    - Scripts/deactivate           # [win]

requirements:
  build:
    - python                                 # [build_platform != target_platform]
    - cross-python_{{ target_platform }}     # [build_platform != target_platform]
    - m2-filesystem                # [win]
    - m2-bash                      # [win]
    - m2-base                      # [win]
  host:
    - python
    - pip
    - hatchling >=1.12.2
    - hatch-vcs >=0.2.0
    - wheel
    # for `conda init` in build/script above
    - menuinst >=1.4.11,<2         # [win]
    - requests >=2.27.0,<3
    - ruamel.yaml >=0.11.14,<0.19
    - tqdm >=4
  run:
    - archspec
    - boltons >=23.0.0
    - charset-normalizer
    - conda-libmamba-solver >=23.11.0
    - conda-package-handling >=2.2.0
    - jsonpatch >=1.32
    - menuinst >=1.4.11,<2         # [win]
    - packaging >=23.0
    - pluggy >=1.0.0
    - pycosat >=0.6.3
    - python
    - requests >=2.27.0,<3
    - ruamel.yaml >=0.11.14,<0.19
    - setuptools >=60.0.0
    - tqdm >=4
    - truststore >=0.8.0           # [py>=310]
  run_constrained:
    - conda-build >=3.27
    - conda-content-trust >=0.1.1
    - conda-env >=2.6

test:
{% if run_pytest == 'yes' %}
  source_files:
    - tests
    - setup.cfg
{% endif %}
  requires:
    - mock
{% if run_pytest == 'yes' %}
    - pytest
{% endif %}
    - pexpect
    - responses
    - m2-filesystem  # [win]
    - m2-bash        # [win]
    - m2-base        # [win]
  imports:
    - conda
    - conda_env
  files:
    - test_runner.bat                # [win]
    - test_runner.sh                 # [unix]
    - commands_to_test.bat           # [win]
    - commands_to_test.sh            # [unix]
  downstreams:
    - conda-smithy  # [python_impl == "cpython" and py<311]

about:
  home: https://conda.io
  license: BSD-3-Clause
  license_file: LICENSE
  summary: OS-agnostic, system-level binary package and environment manager.
  description: |
    Conda is an open source package management system and environment
    management system for installing multiple versions of software packages
    and their dependencies and switching easily between them. It works on
    Linux, OS X and Windows, and was created for Python programs but can
    package and distribute any software.
  doc_url: https://docs.conda.io/projects/conda/en/stable/
  dev_url: https://github.com/conda/conda

extra:
  recipe-maintainers:
    - dbast
    - isuruf
    - jakirkham
    - jezdez
    - kenodegard
    - mbargull
    - ocefpaf
