Skip to content

Commit

Permalink
test: add a (near) pep440 unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
joanise committed Aug 20, 2024
1 parent 0b1cfe6 commit 3405626
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions g2p/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
from unittest import TestCase, main

import yaml
from pep440 import is_canonical

from g2p import get_arpabet_langs
from g2p._version import VERSION
from g2p.exceptions import IncorrectFileType, RecursionError
from g2p.log import LOGGER
from g2p.mappings import Mapping, utils
Expand Down Expand Up @@ -297,6 +299,11 @@ def test_get_arpabet_langs(self):
self.assertIs(LANGS2, LANGS)
self.assertIs(LANG_NAMES2, LANG_NAMES)

def test_version_is_pep440_compliant(self):
"""We test for almost PEP 440 compliance: hatch adds +local_sha1, which is not compliant."""
main_version, _, _ = VERSION.partition("+")
self.assertTrue(is_canonical(main_version))


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ test = [
"coverage[toml]>=6.5",
"playwright>=1.26.1",
"jsonschema>=4.17.3",
"pep440>=0.1.2",
"httpx",
# Kind of bogus that we need both httpx and aiohttp, but socketio
# wants this
Expand Down

0 comments on commit 3405626

Please sign in to comment.