abravalheri / validate-pyproject

Validation library for simple check on `pyproject.toml`
https://validate-pyproject.readthedocs.io/
Mozilla Public License 2.0
116 stars 11 forks source link

feature request: strict pep440 check #179

Open trim21 opened 3 months ago

trim21 commented 3 months ago

pep440 provice a lax regex and a canonical regex, could we have a strict version check with canonical regex?

which mean, 0.0.1.a0 is invalid, and it's normalized result 0.0.1a0 is valid.

This can be done with packaing package https://github.com/pypa/packaging/blob/main/tests/test_version.py

import packaging.version

def strict_pep440(s: str):
    assert s == str(packaging.version.Version(s))

I can send a pr for this.