Skip to content

Commit

Permalink
Merge pull request #89 from tpdn/maint_testing
Browse files Browse the repository at this point in the history
現代的な環境で手元テストが動作するよう、メンテナンスを行う
  • Loading branch information
yagays authored Nov 4, 2023
2 parents e2a9c34 + 7b1f461 commit 860330e
Show file tree
Hide file tree
Showing 7 changed files with 1,688 additions and 1,938 deletions.
1 change: 0 additions & 1 deletion ja_timex/number_normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class DiffIndex:


def kansuji2number(text: str) -> str:

if text == "零":
return "0"

Expand Down
1 change: 0 additions & 1 deletion ja_timex/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def is_valid_duration(self) -> bool:
return False

def to_duration(self) -> timedelta:

unit_args = {
"years": float(self.parsed.get("year", 0)),
"months": float(self.parsed.get("month", 0)),
Expand Down
3,565 changes: 1,654 additions & 1,911 deletions poetry.lock

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,36 @@ classifiers = [
"Development Status :: 4 - Beta",
"Natural Language :: Japanese",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Linguistic",
]

[tool.poetry.dependencies]
python = "^3.7.1"
python = "^3.8.1"
mojimoji = "^0.0.11"
pendulum = "^2.1.2"

[tool.poetry.dev-dependencies]
ipython = "^7.31.1"
ipdb = "^0.13.9"
flake8 = "^3.9.2"
mypy = "^0.910"
black = "^21.12b0"
isort = "^5.10.1"
pytest = "^6.2.5"
streamlit = "^0.84.2"
pandas = "^1.2.5"
watchdog = "^2.1.6"
mkdocs = "^1.2.3"
mkdocs-material = "^7.3.0"
Pygments = "^2.11.2"
pymdown-extensions = "^8.2"
lxml = "^4.7.1"
tox = "^3.24.5"
[tool.poetry.group.dev.dependencies]
ipython = "8.13.0"
ipdb = "^0.13.13"
flake8 = "^6.1.0"
mypy = "^1.6.0"
black = "^23.9.1"
isort = "^5.12.0"
pytest = "^7.4.2"
streamlit = "1.11.1"
pandas = "2.0.3"
watchdog = "^3.0.0"
mkdocs = "^1.5.3"
mkdocs-material = "^9.4.6"
pygments = "^2.16.1"
pymdown-extensions = "^10.3.1"
lxml = "^4.9.3"
tox = "^4.11.3"

[tool.black]
line-length = 120
Expand Down
1 change: 0 additions & 1 deletion tests/test_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def test_tid():


def test_is_valid_datetime(t_date, t_time, t_duration, t_set):

assert t_date.is_valid_datetime
assert t_time.is_valid_datetime
assert t_duration.is_valid_datetime
Expand Down
4 changes: 2 additions & 2 deletions tests/test_timex.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ def p():
def test_abstime(p):
timexes = p.parse("2021年7月18日")
assert len(timexes) == 1
assert type(timexes[0]) == TIMEX
assert type(timexes[0]) is TIMEX
assert timexes[0].value == "2021-07-18"

timexes = p.parse("2021回目の7月18日")
assert len(timexes) == 1
assert type(timexes[0]) == TIMEX
assert type(timexes[0]) is TIMEX
assert timexes[0].value == "XXXX-07-18"


Expand Down
15 changes: 12 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
[tox]
envlist = python{3.7, 3.8, 3.9}, flake8, black, mypy
min_version = 4.0
env_list =
py38
py39
py310
py311
flake8
black
mypy

isolated_build = True
skipsdist = true
skip_missing_interpreters = true


[testenv]
whitelist_externals = poetry
allowlist_externals = poetry
skip_install = true
commands =
poetry install -v
Expand All @@ -24,4 +33,4 @@ commands = poetry run black . --check
[testenv:flake8]
deps = flake8
commands =
poetry run flake8 ja_timex tests tools
poetry run flake8 ja_timex tests tools

0 comments on commit 860330e

Please sign in to comment.