Use packaging to parse versions (#8314)

packaging is the standard tool for dealing with versions and
requirements. This allows us to easily support all PEP 508 specs.
packaging also has good error messages, so I don't create our own here.
This lets us get rid of our handrolled half parser and sanity checks.
I kept the whitespace consistency check, since that's just a formatting
lint and isn't testing the correctness of parsing (which we now
definitely do correctly).
This commit is contained in:
Shantanu authored and GitHub committed 2022-07-17 12:35:32 -07:00
1 parent 9df28aac13
commit 5ef20e8021
5 files changed
+17 -49

No files matched your search

-10
View File
@@ -80,16 +80,6 @@ terminal to install all non-pytype requirements:
(.venv) > pip install -r requirements-tests.txt
```
### Optional dependencies
Several tests also have `termcolor` as an optional dependency. Installing this
is not essential to run the tests, but can make the output of some of the tests
slightly prettier and easier to read. To install `termcolor`, run:
```
pip install termcolor
```
## Code formatting
The code is formatted using `black` and `isort`.