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

Translate version specifiers #84

Closed
analog-cbarber opened this issue Sep 12, 2023 · 0 comments
Closed

Translate version specifiers #84

analog-cbarber opened this issue Sep 12, 2023 · 0 comments
Assignees
Labels
component: convert defect Something isn't working

Comments

@analog-cbarber
Copy link
Collaborator

Version specifiers in dependencies are simply copied from
the wheel without modification. This works for many cases,
but since the version comparison operators for pip and conda
are slightly different, some version specifiers will not work
properly in conda. Specifically,

  • the compatible release operator ~= is not supported by conda.
    To translate, use a double expression with >= and *, e.g.:
    ~= 1.2.3 would become >=1.2.3,1.2.* in conda. This form is
    also supported by pip, so this is a viable workaround for packages
    you control.

  • the arbitrary equality clause === is not supported by conda.
    I do not believe there is an equivalent to this in conda, but
    this clause is also heavily discouraged in dependencies and
    might not even match the corresponding conda package.

(There are other operations supported by conda but not pip, but
the are not a concern when translating from pip specifiers.
)

As a workaround, users can switch to compatible specifier syntax when
possible and otherwise can remove the offending package and add it
back with compatible specifier syntax, e.g.:

whl2conda mywheel-1.2.3-py3-none-any.whl -D foo -A 'foo >=1.2.3,1.2.*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: convert defect Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant