Pip 2020-12-20
I do want to do a bit of pip work today. It's going to be pretty minor.
Thing to note: generated packages don't have hashes (I think), which means... Actually, looking into this, I'm now kind of confused. The create_basic_wheel_for_package helper function contains the following comment: # Have an empty RECORD because we don't want to be checking hashes.. But the test_new_resolver_hashes module defines a _create_find_links helper that calls these other helpers and associates hashes with the result...
OH. I was confused. The comment was talking about checking hashes of individual files in a package, while the hashes that matter to testing constraints are of the package as a whole. So, we're good.
So, I'm going to try to sketch out what the basic tests should be doing:
- Create a scratch package
- Generate a file:// URL to the package
- Constrain installation of that package to that URL, while installing an unrelated package (either another scratch package, or a data index package)
- Assert that the installation succeeded, and the first package was not installed.
Have another test for having an unused constraint to example.com, though I'm not sure what that should do.
Another test:
- Create a scratch package
- Generate a file:// URL to the package
- Constrain installation, and install the package
- The constrained URL should have been used.
Another:
- Create a scratch package with the same name as a package in the data index, but an intermediate version.
- Generate a file:// URL to the package
- Constrain installation of that package to that URL, and install the package, while using the data index.
- The constrained URL should have been used.
As above, but either the constraint or the installation includes a version range incompatible with the scratch package; expect failure.
- Create two scratch packages with the same name and different versions
- Generate file:// URLs to each
- Constrain installation to both
- If installing an unrelated package, installation should succeed
- If installing the scratch package, installation should fail
As the second case above, but with a constraint and a requirement, instead of two constraints.
- Create a scratch package
- Generate a file:// URL to the package
- Constrain the installation to the URL
- Require the package by URL along with the constraint
- Installation should succeed
There's more to outline, but I'm getting tired.
Good night.