Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ANY-package #37

Open
mottosso opened this issue Jun 23, 2019 · 2 comments
Open

Support for ANY-package #37

mottosso opened this issue Jun 23, 2019 · 2 comments
Labels

Comments

@mottosso
Copy link
Owner

mottosso commented Jun 23, 2019

Goal

Support requirements that depend not not on only a range of different versions, but also a range of different packages.

Motivation

Useful for e.g. Qt.py which requires [pyside, pyside2, pyqt4 or pyqt5], and for packages that depend on either [bleeding_rez, rez]. It can't depend on all, and it can't depend on none.

However, it dawned on me that this can also solve AcademySoftwareFoundation#21 which would be great, and could potentially squat two flies with one stone.

Implementation

From command-line.

rez env six python [pyqt4 pyqt5]

From your package.py

requires = [
  "pyyaml-2.4",
  "six-1.1",
  ["PySide-1.2, "PyQt4-4.7", "PyQt5", "PySide2"],
]

Where the first package found is picked.

As an added bonus, we'll also (finally) be able to account for AcademySoftwareFoundation#21 by adding a null package that does nothing.

requires = [
  ["", "packageA-1.2"]
]

Now both "packageA-1.2" and "" are equally acceptable. If packageA-1.2 isn't found, it would behave as though it was optional and not break the solve.

@mottosso mottosso changed the title Support for OR-package Support for ANY-package Jul 1, 2019
@mottosso
Copy link
Owner Author

  • Also relevant for Python's PIL library, which doesn't have a PyPI package. Pillow on the other hand is a fork that implements the library under the same Python package name.
  • Also relevant for nerdvegas/rez and bleeding-rez

@mottosso
Copy link
Owner Author

mottosso commented Aug 1, 2019

Possible command-line syntax for both optional and ANY-style requests.

rez env Qt.py (PySide2 PySide) pillow (numpy)
  • (numpy) is optional
  • (PySide2 PySide) means one or the other, but not none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant