Skip to content

Choosing a prerelease if no stable versions are available to satisfy a requirement #9121

Open
@bersbersbers

Description

@bersbersbers

What's the problem this feature will solve?
This may be an issue or not - I have looked through PEP440 and haven't found anything. Basically, when installing package>1.0a0, I'd expect 1.0rc1 to be installed if it's the only prerelease version available. This is not the case.

Describe the solution you'd like

I'd like pip to understand that rc > a. Unless I am mistaken, we have all of these

2.0a0>1.0a0
1.1a0>1.0a0
1.0a1>1.0a0

but we do not have

1.0rc1>1.0a0

Some console output:

# see what's installed
> pip freeze | grep ^tensorflow=
tensorflow==2.3.1

# see what's available
> pip install tensorflow==10
ERROR: Could not find a version that satisfies the requirement tensorflow==10 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0, 2.3.1, 2.4.0rc0, 2.4.0rc1)
ERROR: No matching distribution found for tensorflow==10

> pip install "tensorflow>2.4a0"
ERROR: Could not find a version that satisfies the requirement tensorflow>2.4a0 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0, 2.3.1, 2.4.0rc0, 2.4.0rc1)
ERROR: No matching distribution found for tensorflow>2.4a0

> pip install "tensorflow>=2.4rc0"
Collecting tensorflow>=2.4rc0
...

> pip freeze | grep ^tensorflow=
tensorflow==2.4.0rc1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions