From daa1b0476fef05b7eae8a2da122fbd8c479c2757 Mon Sep 17 00:00:00 2001 From: Yannik Tausch Date: Wed, 10 Jul 2024 11:45:13 +0200 Subject: [PATCH 1/2] add tests for sources that depend on conda build config variants --- tests/test_version_migrator.py | 4 + .../version_polars_mixed_selectors.yaml | 83 +++++++++++++++++++ ...ersion_polars_mixed_selectors_correct.yaml | 83 +++++++++++++++++++ .../version_polars_name_selectors.yaml | 83 +++++++++++++++++++ ...version_polars_name_selectors_correct.yaml | 83 +++++++++++++++++++ .../version_polars_variant_selectors.yaml | 83 +++++++++++++++++++ ...sion_polars_variant_selectors_correct.yaml | 83 +++++++++++++++++++ 7 files changed, 502 insertions(+) create mode 100644 tests/test_yaml/version_polars_mixed_selectors.yaml create mode 100644 tests/test_yaml/version_polars_mixed_selectors_correct.yaml create mode 100644 tests/test_yaml/version_polars_name_selectors.yaml create mode 100644 tests/test_yaml/version_polars_name_selectors_correct.yaml create mode 100644 tests/test_yaml/version_polars_variant_selectors.yaml create mode 100644 tests/test_yaml/version_polars_variant_selectors_correct.yaml diff --git a/tests/test_version_migrator.py b/tests/test_version_migrator.py index 34485be00..bbd8173ab 100644 --- a/tests/test_version_migrator.py +++ b/tests/test_version_migrator.py @@ -50,6 +50,10 @@ ("libevent", "2.1.12"), ("boost", "1.74.0"), ("boostcpp", "1.74.0"), + # these contains sources that depend on conda build config variants + ("polars_mixed_selectors", "1.1.0"), + ("polars_name_selectors", "1.1.0"), + ("polars_variant_selectors", "1.1.0"), # upstream is not available # ("mumps", "5.2.1"), # ("cb3multi", "6.0.0"), diff --git a/tests/test_yaml/version_polars_mixed_selectors.yaml b/tests/test_yaml/version_polars_mixed_selectors.yaml new file mode 100644 index 000000000..91d0ce061 --- /dev/null +++ b/tests/test_yaml/version_polars_mixed_selectors.yaml @@ -0,0 +1,83 @@ +{% if polars_variant == "polars-lts-cpu" %} + {% set name = "polars-lts-cpu" %} +{% elif polars_variant == "polars-u64-idx" %} + {% set name = "polars-u64-idx" %} +{% else %} + {% set name = "polars" %} +{% endif %} +{% set version = "1.0.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + - url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name | replace("-", "_") }}-{{ version }}.tar.gz + sha256: 144a63d6d61dc5d675304673c4261ceccf4cfc75277431389d4afe9a5be0f70b # [polars_variant == "polars"] + sha256: e4c3d203d398bd2914fe191544385950a0cd559051af6b2f6b431b837e357d8e # [polars_variant == "polars-lts-cpu"] + sha256: e2fd9758a4381aef4f3bee0ba62b80c7125983445751579b0d95288e39c94d9f # [polars_variant == "polars-u64-idx"] + + +build: + number: 0 + skip: true # [win and python_impl=="pypy"] + +requirements: + build: + - python # [build_platform != target_platform] + # there is no cross-python for linux-64 -> win-64 + - cross-python_{{ target_platform }} # [build_platform != target_platform and not target_platform == "win-64"] + - crossenv # [build_platform != target_platform] + - maturin >=1.3.2,<2 # [build_platform != target_platform] + - {{ compiler('c') }} + - {{ compiler('cxx') }} # [win] + # clang_win-64 already adds all required run_exports for the windows build + - {{ stdlib("c") }} # [not (build_platform == "linux-64" and target_platform == "win-64")] + - {{ compiler('rust') }} + - posix # [build_platform == "win-64"] + - cmake + - make # [unix] + - cargo-feature # [build_platform != target_platform and target_platform == "win-64"] + - cargo-bundle-licenses + host: + - python + - pip + - maturin >=1.3.2,<2 + run: + - python + - numpy >=1.16.0,<2 + - backports.zoneinfo # [py<39] + - typing_extensions >=4.0.0 # [py<311] + - packaging # [py>=310] + +test: + imports: + - polars + commands: + - pip check + - python -c "from polars import DataFrame" + requires: + - pip + +about: + home: https://github.com/pola-rs/polars + license: MIT + license_family: MIT + license_file: + - LICENSE + - THIRDPARTY.yml + summary: Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow(2) as memory model. + doc_url: https://pola-rs.github.io/polars-book/user-guide/index.html + dev_url: https://github.com/pola-rs/polars + +extra: + recipe-maintainers: + - borchero + - Maxyme + - timkpaine + - ritchie46 + - sugatoray + - xhochy + - dhirschfeld + - pavelzw + - '0xbe7a' diff --git a/tests/test_yaml/version_polars_mixed_selectors_correct.yaml b/tests/test_yaml/version_polars_mixed_selectors_correct.yaml new file mode 100644 index 000000000..fb714609c --- /dev/null +++ b/tests/test_yaml/version_polars_mixed_selectors_correct.yaml @@ -0,0 +1,83 @@ +{% if polars_variant == "polars-lts-cpu" %} + {% set name = "polars-lts-cpu" %} +{% elif polars_variant == "polars-u64-idx" %} + {% set name = "polars-u64-idx" %} +{% else %} + {% set name = "polars" %} +{% endif %} +{% set version = "1.1.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + - url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name | replace("-", "_") }}-{{ version }}.tar.gz + sha256: 75fe824243006ada0f2dd30c8aba0ec03595d9087b29c3ca8f106ef1a975b9cb # [polars_variant == "polars"] + sha256: a9add68d6cf992f8d8bb79c5b8bd73549af504108b8774c5e5d2fc6c751ea48c # [polars_variant == "polars-lts-cpu"] + sha256: ecbfe1bab9367270399490780dd1700d824a9255fd509d22497095029c19ae6b # [polars_variant == "polars-u64-idx"] + + +build: + number: 0 + skip: true # [win and python_impl=="pypy"] + +requirements: + build: + - python # [build_platform != target_platform] + # there is no cross-python for linux-64 -> win-64 + - cross-python_{{ target_platform }} # [build_platform != target_platform and not target_platform == "win-64"] + - crossenv # [build_platform != target_platform] + - maturin >=1.3.2,<2 # [build_platform != target_platform] + - {{ compiler('c') }} + - {{ compiler('cxx') }} # [win] + # clang_win-64 already adds all required run_exports for the windows build + - {{ stdlib("c") }} # [not (build_platform == "linux-64" and target_platform == "win-64")] + - {{ compiler('rust') }} + - posix # [build_platform == "win-64"] + - cmake + - make # [unix] + - cargo-feature # [build_platform != target_platform and target_platform == "win-64"] + - cargo-bundle-licenses + host: + - python + - pip + - maturin >=1.3.2,<2 + run: + - python + - numpy >=1.16.0 + - backports.zoneinfo # [py<39] + - typing_extensions >=4.0.0 # [py<311] + - packaging # [py>=310] + +test: + imports: + - polars + commands: + - pip check + - python -c "from polars import DataFrame" + requires: + - pip + +about: + home: https://github.com/pola-rs/polars + license: MIT + license_family: MIT + license_file: + - LICENSE + - THIRDPARTY.yml + summary: Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow(2) as memory model. + doc_url: https://pola-rs.github.io/polars-book/user-guide/index.html + dev_url: https://github.com/pola-rs/polars + +extra: + recipe-maintainers: + - borchero + - Maxyme + - timkpaine + - ritchie46 + - sugatoray + - xhochy + - dhirschfeld + - pavelzw + - '0xbe7a' diff --git a/tests/test_yaml/version_polars_name_selectors.yaml b/tests/test_yaml/version_polars_name_selectors.yaml new file mode 100644 index 000000000..7eaf93408 --- /dev/null +++ b/tests/test_yaml/version_polars_name_selectors.yaml @@ -0,0 +1,83 @@ +{% if polars_variant == "polars-lts-cpu" %} + {% set name = "polars-lts-cpu" %} +{% elif polars_variant == "polars-u64-idx" %} + {% set name = "polars-u64-idx" %} +{% else %} + {% set name = "polars" %} +{% endif %} +{% set version = "1.0.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + - url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name | replace("-", "_") }}-{{ version }}.tar.gz + sha256: 144a63d6d61dc5d675304673c4261ceccf4cfc75277431389d4afe9a5be0f70b # [name == "polars"] + sha256: e4c3d203d398bd2914fe191544385950a0cd559051af6b2f6b431b837e357d8e # [name == "polars-lts-cpu"] + sha256: e2fd9758a4381aef4f3bee0ba62b80c7125983445751579b0d95288e39c94d9f # [name == "polars-u64-idx"] + + +build: + number: 0 + skip: true # [win and python_impl=="pypy"] + +requirements: + build: + - python # [build_platform != target_platform] + # there is no cross-python for linux-64 -> win-64 + - cross-python_{{ target_platform }} # [build_platform != target_platform and not target_platform == "win-64"] + - crossenv # [build_platform != target_platform] + - maturin >=1.3.2,<2 # [build_platform != target_platform] + - {{ compiler('c') }} + - {{ compiler('cxx') }} # [win] + # clang_win-64 already adds all required run_exports for the windows build + - {{ stdlib("c") }} # [not (build_platform == "linux-64" and target_platform == "win-64")] + - {{ compiler('rust') }} + - posix # [build_platform == "win-64"] + - cmake + - make # [unix] + - cargo-feature # [build_platform != target_platform and target_platform == "win-64"] + - cargo-bundle-licenses + host: + - python + - pip + - maturin >=1.3.2,<2 + run: + - python + - numpy >=1.16.0,<2 + - backports.zoneinfo # [py<39] + - typing_extensions >=4.0.0 # [py<311] + - packaging # [py>=310] + +test: + imports: + - polars + commands: + - pip check + - python -c "from polars import DataFrame" + requires: + - pip + +about: + home: https://github.com/pola-rs/polars + license: MIT + license_family: MIT + license_file: + - LICENSE + - THIRDPARTY.yml + summary: Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow(2) as memory model. + doc_url: https://pola-rs.github.io/polars-book/user-guide/index.html + dev_url: https://github.com/pola-rs/polars + +extra: + recipe-maintainers: + - borchero + - Maxyme + - timkpaine + - ritchie46 + - sugatoray + - xhochy + - dhirschfeld + - pavelzw + - '0xbe7a' diff --git a/tests/test_yaml/version_polars_name_selectors_correct.yaml b/tests/test_yaml/version_polars_name_selectors_correct.yaml new file mode 100644 index 000000000..c788d7c92 --- /dev/null +++ b/tests/test_yaml/version_polars_name_selectors_correct.yaml @@ -0,0 +1,83 @@ +{% if polars_variant == "polars-lts-cpu" %} + {% set name = "polars-lts-cpu" %} +{% elif polars_variant == "polars-u64-idx" %} + {% set name = "polars-u64-idx" %} +{% else %} + {% set name = "polars" %} +{% endif %} +{% set version = "1.1.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + - url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name | replace("-", "_") }}-{{ version }}.tar.gz + sha256: 75fe824243006ada0f2dd30c8aba0ec03595d9087b29c3ca8f106ef1a975b9cb # [name == "polars"] + sha256: a9add68d6cf992f8d8bb79c5b8bd73549af504108b8774c5e5d2fc6c751ea48c # [name == "polars-lts-cpu"] + sha256: ecbfe1bab9367270399490780dd1700d824a9255fd509d22497095029c19ae6b # [name == "polars-u64-idx"] + + +build: + number: 0 + skip: true # [win and python_impl=="pypy"] + +requirements: + build: + - python # [build_platform != target_platform] + # there is no cross-python for linux-64 -> win-64 + - cross-python_{{ target_platform }} # [build_platform != target_platform and not target_platform == "win-64"] + - crossenv # [build_platform != target_platform] + - maturin >=1.3.2,<2 # [build_platform != target_platform] + - {{ compiler('c') }} + - {{ compiler('cxx') }} # [win] + # clang_win-64 already adds all required run_exports for the windows build + - {{ stdlib("c") }} # [not (build_platform == "linux-64" and target_platform == "win-64")] + - {{ compiler('rust') }} + - posix # [build_platform == "win-64"] + - cmake + - make # [unix] + - cargo-feature # [build_platform != target_platform and target_platform == "win-64"] + - cargo-bundle-licenses + host: + - python + - pip + - maturin >=1.3.2,<2 + run: + - python + - numpy >=1.16.0 + - backports.zoneinfo # [py<39] + - typing_extensions >=4.0.0 # [py<311] + - packaging # [py>=310] + +test: + imports: + - polars + commands: + - pip check + - python -c "from polars import DataFrame" + requires: + - pip + +about: + home: https://github.com/pola-rs/polars + license: MIT + license_family: MIT + license_file: + - LICENSE + - THIRDPARTY.yml + summary: Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow(2) as memory model. + doc_url: https://pola-rs.github.io/polars-book/user-guide/index.html + dev_url: https://github.com/pola-rs/polars + +extra: + recipe-maintainers: + - borchero + - Maxyme + - timkpaine + - ritchie46 + - sugatoray + - xhochy + - dhirschfeld + - pavelzw + - '0xbe7a' diff --git a/tests/test_yaml/version_polars_variant_selectors.yaml b/tests/test_yaml/version_polars_variant_selectors.yaml new file mode 100644 index 000000000..b25f819c2 --- /dev/null +++ b/tests/test_yaml/version_polars_variant_selectors.yaml @@ -0,0 +1,83 @@ +{% if polars_variant == "polars-lts-cpu" %} + {% set name = "polars-lts-cpu" %} +{% elif polars_variant == "polars-u64-idx" %} + {% set name = "polars-u64-idx" %} +{% else %} + {% set name = "polars" %} +{% endif %} +{% set version = "1.0.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + - url: https://pypi.io/packages/source/{{ polars_variant[0] }}/{{ polars_variant }}/{{ polars_variant | replace("-", "_") }}-{{ version }}.tar.gz + sha256: 144a63d6d61dc5d675304673c4261ceccf4cfc75277431389d4afe9a5be0f70b # [polars_variant == "polars"] + sha256: e4c3d203d398bd2914fe191544385950a0cd559051af6b2f6b431b837e357d8e # [polars_variant == "polars-lts-cpu"] + sha256: e2fd9758a4381aef4f3bee0ba62b80c7125983445751579b0d95288e39c94d9f # [polars_variant == "polars-u64-idx"] + + +build: + number: 0 + skip: true # [win and python_impl=="pypy"] + +requirements: + build: + - python # [build_platform != target_platform] + # there is no cross-python for linux-64 -> win-64 + - cross-python_{{ target_platform }} # [build_platform != target_platform and not target_platform == "win-64"] + - crossenv # [build_platform != target_platform] + - maturin >=1.3.2,<2 # [build_platform != target_platform] + - {{ compiler('c') }} + - {{ compiler('cxx') }} # [win] + # clang_win-64 already adds all required run_exports for the windows build + - {{ stdlib("c") }} # [not (build_platform == "linux-64" and target_platform == "win-64")] + - {{ compiler('rust') }} + - posix # [build_platform == "win-64"] + - cmake + - make # [unix] + - cargo-feature # [build_platform != target_platform and target_platform == "win-64"] + - cargo-bundle-licenses + host: + - python + - pip + - maturin >=1.3.2,<2 + run: + - python + - numpy >=1.16.0,<2 + - backports.zoneinfo # [py<39] + - typing_extensions >=4.0.0 # [py<311] + - packaging # [py>=310] + +test: + imports: + - polars + commands: + - pip check + - python -c "from polars import DataFrame" + requires: + - pip + +about: + home: https://github.com/pola-rs/polars + license: MIT + license_family: MIT + license_file: + - LICENSE + - THIRDPARTY.yml + summary: Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow(2) as memory model. + doc_url: https://pola-rs.github.io/polars-book/user-guide/index.html + dev_url: https://github.com/pola-rs/polars + +extra: + recipe-maintainers: + - borchero + - Maxyme + - timkpaine + - ritchie46 + - sugatoray + - xhochy + - dhirschfeld + - pavelzw + - '0xbe7a' diff --git a/tests/test_yaml/version_polars_variant_selectors_correct.yaml b/tests/test_yaml/version_polars_variant_selectors_correct.yaml new file mode 100644 index 000000000..00a181d96 --- /dev/null +++ b/tests/test_yaml/version_polars_variant_selectors_correct.yaml @@ -0,0 +1,83 @@ +{% if polars_variant == "polars-lts-cpu" %} + {% set name = "polars-lts-cpu" %} +{% elif polars_variant == "polars-u64-idx" %} + {% set name = "polars-u64-idx" %} +{% else %} + {% set name = "polars" %} +{% endif %} +{% set version = "1.1.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + - url: https://pypi.io/packages/source/{{ polars_variant[0] }}/{{ polars_variant }}/{{ polars_variant | replace("-", "_") }}-{{ version }}.tar.gz + sha256: 75fe824243006ada0f2dd30c8aba0ec03595d9087b29c3ca8f106ef1a975b9cb # [polars_variant == "polars"] + sha256: a9add68d6cf992f8d8bb79c5b8bd73549af504108b8774c5e5d2fc6c751ea48c # [polars_variant == "polars-lts-cpu"] + sha256: ecbfe1bab9367270399490780dd1700d824a9255fd509d22497095029c19ae6b # [polars_variant == "polars-u64-idx"] + + +build: + number: 0 + skip: true # [win and python_impl=="pypy"] + +requirements: + build: + - python # [build_platform != target_platform] + # there is no cross-python for linux-64 -> win-64 + - cross-python_{{ target_platform }} # [build_platform != target_platform and not target_platform == "win-64"] + - crossenv # [build_platform != target_platform] + - maturin >=1.3.2,<2 # [build_platform != target_platform] + - {{ compiler('c') }} + - {{ compiler('cxx') }} # [win] + # clang_win-64 already adds all required run_exports for the windows build + - {{ stdlib("c") }} # [not (build_platform == "linux-64" and target_platform == "win-64")] + - {{ compiler('rust') }} + - posix # [build_platform == "win-64"] + - cmake + - make # [unix] + - cargo-feature # [build_platform != target_platform and target_platform == "win-64"] + - cargo-bundle-licenses + host: + - python + - pip + - maturin >=1.3.2,<2 + run: + - python + - numpy >=1.16.0 + - backports.zoneinfo # [py<39] + - typing_extensions >=4.0.0 # [py<311] + - packaging # [py>=310] + +test: + imports: + - polars + commands: + - pip check + - python -c "from polars import DataFrame" + requires: + - pip + +about: + home: https://github.com/pola-rs/polars + license: MIT + license_family: MIT + license_file: + - LICENSE + - THIRDPARTY.yml + summary: Polars is a blazingly fast DataFrames library implemented in Rust using Apache Arrow(2) as memory model. + doc_url: https://pola-rs.github.io/polars-book/user-guide/index.html + dev_url: https://github.com/pola-rs/polars + +extra: + recipe-maintainers: + - borchero + - Maxyme + - timkpaine + - ritchie46 + - sugatoray + - xhochy + - dhirschfeld + - pavelzw + - '0xbe7a' From f9c9817b05d322bc765b43240cb125cd1a49e840 Mon Sep 17 00:00:00 2001 From: Yannik Tausch Date: Fri, 19 Jul 2024 14:56:21 +0200 Subject: [PATCH 2/2] mark new tests as xfail --- tests/test_version_migrator.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/test_version_migrator.py b/tests/test_version_migrator.py index bbd8173ab..d56ce3bd8 100644 --- a/tests/test_version_migrator.py +++ b/tests/test_version_migrator.py @@ -13,6 +13,10 @@ YAML_PATH = os.path.join(os.path.dirname(__file__), "test_yaml") +VARIANT_SOURCES_NOT_IMPLEMENTED = ( + "Sources that depend on conda build config variants are not supported yet." +) + @pytest.mark.parametrize( "case,new_ver", @@ -50,10 +54,22 @@ ("libevent", "2.1.12"), ("boost", "1.74.0"), ("boostcpp", "1.74.0"), - # these contains sources that depend on conda build config variants - ("polars_mixed_selectors", "1.1.0"), - ("polars_name_selectors", "1.1.0"), - ("polars_variant_selectors", "1.1.0"), + # these contain sources that depend on conda build config variants + pytest.param( + "polars_mixed_selectors", + "1.1.0", + marks=pytest.mark.xfail(reason=VARIANT_SOURCES_NOT_IMPLEMENTED), + ), + pytest.param( + "polars_name_selectors", + "1.1.0", + marks=pytest.mark.xfail(reason=VARIANT_SOURCES_NOT_IMPLEMENTED), + ), + pytest.param( + "polars_variant_selectors", + "1.1.0", + marks=pytest.mark.xfail(reason=VARIANT_SOURCES_NOT_IMPLEMENTED), + ), # upstream is not available # ("mumps", "5.2.1"), # ("cb3multi", "6.0.0"),