Giter Club home page Giter Club logo

Comments (6)

wolfv avatar wolfv commented on July 4, 2024

Hmm, I wonder what the expected output is, here. Do you expect the exact=true pin to point to the variant of the new_pydantic=false package?

Currently we (conceptually) treat a recipe variant over the entire file. So in this case, rattler-build thinks that the package-base doesn't exist for new_pydantic=false and then fails.

However, it also fails when not "exactly" pinning. So something seems fishy nonetheless and worth looking into!

from rattler-build.

wolfv avatar wolfv commented on July 4, 2024

Hmm, well, the other assumption for pin_subpackage is that the "subpackage" is available when rendering with that specific variant.

Well, something to think about.

from rattler-build.

pavelzw avatar pavelzw commented on July 4, 2024

If we decide not to support this, i'm wondering what the best alternative for this example would be... In conda-build (and older rattler-build versions) it works 🤔

from rattler-build.

wolfv avatar wolfv commented on July 4, 2024

Hmm, I double checked this. Actually, it's not necessary to skip anything - since new_pydantic is not used in the base package, the hash is always the same and it builds only three packages in the right order.

recipe:
  version: '0.1.0'
build:
  number: 0

outputs:
  - package:
      name: package-base
    build:
      noarch: generic

  - package:
      name: package
    build:
      noarch: python
    requirements:
      host:
        - ${{ pin_subpackage('package-base', exact=true) }}
        - if: new_pydantic
          then:
            - pydantic >=2
          else:
            - pydantic >=1,<2

Let me know if that works fine for your use case?

from rattler-build.

wolfv avatar wolfv commented on July 4, 2024
 ╭─ Finding outputs from recipe
 │ Found 3 variants
 │ Build variant: package-base-0.1.0-h4616a5c_0
 │ 
 │ ╭─────────────────┬─────────╮
 │ │ Variant         ┆ Version │
 │ ╞═════════════════╪═════════╡
 │ │ target_platform ┆ noarch  │
 │ ╰─────────────────┴─────────╯
 │ Build variant: package-0.1.0-pyh590d979_0
 │ 
 │ ╭─────────────────┬──────────────────╮
 │ │ Variant         ┆ Version          │
 │ ╞═════════════════╪══════════════════╡
 │ │ new_pydantic    ┆ true             │
 │ │ package-base    ┆ 0.1.0 h4616a5c_0 │
 │ │ target_platform ┆ noarch           │
 │ ╰─────────────────┴──────────────────╯
 │ Build variant: package-0.1.0-pyhfc8578e_0
 │ 
 │ ╭─────────────────┬──────────────────╮
 │ │ Variant         ┆ Version          │
 │ ╞═════════════════╪══════════════════╡
 │ │ new_pydantic    ┆ false            │
 │ │ package-base    ┆ 0.1.0 h4616a5c_0 │
 │ │ target_platform ┆ noarch           │
 │ ╰─────────────────┴──────────────────╯
 │
 ╰─────────────────── (took 0 seconds)

from rattler-build.

pavelzw avatar pavelzw commented on July 4, 2024

Seems to work, thanks!

from rattler-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.