Skip to content

Commit

Permalink
fix(doctest_docutils): Fix doctest fixed by pydocstyle / ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Nov 26, 2023
1 parent 2d4bd2e commit 211cf96
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/doctest_docutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,18 @@

def is_allowed_version(version: str, spec: str) -> bool:
"""Check `spec` satisfies `version` or not.
This obeys PEP-440 specifiers:
https://peps.python.org/pep-0440/#version-specifiers
Some examples:
>>> is_allowed_version('3.3', '<=3.5')
True
>>> is_allowed_version('3.3', '<=3.2')
False
>>> is_allowed_version('3.3', '>3.2, <4.0')
True.
>>> is_allowed_version('3.3', '<=3.5')
True
>>> is_allowed_version('3.3', '<=3.2')
False
>>> is_allowed_version('3.3', '>3.2, <4.0')
True
"""
return Version(version) in SpecifierSet(spec)

Expand Down

0 comments on commit 211cf96

Please sign in to comment.