Skip to content

Commit

Permalink
deps: use rye instead of poetry (#213)
Browse files Browse the repository at this point in the history
* deps: use rye for describing dependencies

* fix: __init__.py

* misc: Dockerfile

* misc: py38

* misc: remove poetry.lock

* misc: cleanup pyproject.toml
  • Loading branch information
himkt authored May 13, 2024
1 parent 3e06726 commit 25f8964
Show file tree
Hide file tree
Showing 7 changed files with 439 additions and 1,649 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ RUN tar zxvf kytea-0.4.7.tar.gz \

WORKDIR /work

COPY ./data ./data
COPY ./src ./src
COPY ./pyproject.toml ./pyproject.toml
COPY ./poetry.lock ./poetry.lock
COPY ./README.md ./README.md
COPY ./data ./data
COPY ./src ./src
COPY ./pyproject.toml ./pyproject.toml
COPY ./requirements.lock ./requirements.lock
COPY ./README.md ./README.md

RUN python3.10 -m pip install -U pip
RUN python3.10 -m pip install .[all]
RUN python3.10 -m pip install -r requirements.lock
RUN python3.10 -m pip install .

CMD [ \
"python3.10", "-m", "uvicorn", \
Expand Down
1,601 changes: 0 additions & 1,601 deletions poetry.lock

This file was deleted.

114 changes: 72 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,52 +1,68 @@
[tool.ruff]
line-length = 119

[tool.poetry]
[project]
name = "konoha"
version = "5.5.5"
description = "A tiny sentence/word tokenizer for Japanese text written in Python"
authors = ["himkt <himkt@klis.tsukuba.ac.jp>"]
description = "Add your description here"
authors = [{ name = "himkt", email = "himkt@klis.tsukuba.ac.jp" }]
dependencies = [
"requests<3.0.0",
]
readme = "README.md"
packages = [{include = "konoha", from = "src" }]
include = ["src/konoha/py.typed"]
requires-python = ">= 3.8"
license = "MIT"

[tool.poetry.dependencies]
python = "^3.8.0"
boto3 = {version = "^1.34.0", optional = true}
fastapi = {version = "<1.0.0", optional = true}
janome = {version = "^0.5.0", optional = true}
kytea = {version = "^0.1.8", optional = true}
nagisa = {version = "^0.2.10", optional = true}
natto-py = {version = "^1.0.0", optional = true}
requests = "<3.0.0"
sentencepiece = {version = "^0.1.85", optional = true}
sudachipy = {version = "^0.6.8", optional = true}
sudachidict-core = {version = "20230927", optional = true}
uvicorn = {version = "<0.26.0", optional = true}

[tool.poetry.extras]
janome = ["janome"]
mecab = ["natto-py"]
kytea = ["kytea"]
sudachi = ["sudachipy", "sudachidict-core"]
nagisa = ["nagisa"]
sentencepiece = ["sentencepiece"]
remote = ["boto3"]
server = ["fastapi", "uvicorn"]
all = ["janome", "natto-py", "kytea", "sudachipy", "sudachidict-core", "nagisa", "sentencepiece", "boto3", "fastapi", "uvicorn"]

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.4"
httpx = "^0.26.0"
ruff = "^0.3.0"
mypy = "^1.8.0"
sphinx = "<7.2.0"
pydata-sphinx-theme = "<0.15.0"
[project.optional-dependencies]
server = [
"fastapi<1.0.0",
"uvicorn<0.26.0",
]
all = [
"boto3~=1.34.0",
"fastapi<1.0.0",
"janome~=0.5.0",
"kytea~=0.1.0",
"nagisa~=0.2.10",
"natto-py~=1.0.0",
"sentencepiece~=0.1.85",
"sudachidict-core==20230927",
"uvicorn<0.26.0",
]
remote = [
"boto3~=1.34.0",
]
janome = [
"janome~=0.5.0",
]
kytea = [
"kytea~=0.1.0",
]
nagisa = [
"nagisa~=0.2.10",
]
mecab = [
"natto-py~=1.0.0",
]
sentencepiece = [
"sentencepiece~=0.1.85",
]
sudachi = [
"sudachipy~=0.6.8",
"sudachidict-core==20230927",
]

[build-system]
requires = ["poetry>=1.0.2"]
build-backend = "poetry.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.sdist]
packages = ["src/konoha"]
only-packages = true

[tool.hatch.build.targets.wheel]
packages = ["src/konoha"]
only-packages = true

[[tool.mypy.overrides]]
module = [
Expand All @@ -59,3 +75,17 @@ module = [
"sudachipy",
]
ignore_missing_imports = true

[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.2.0",
"httpx>=0.27.0",
"ruff>=0.4.4",
"mypy>=1.10.0",
"sphinx>=7.3.7",
"pydata-sphinx-theme>=0.15.2",
]

[tool.ruff]
line-length = 119
211 changes: 211 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: true
# with-sources: false

-e file:.
accessible-pygments==0.0.5
# via pydata-sphinx-theme
alabaster==0.7.16
# via sphinx
annotated-types==0.6.0
# via pydantic
anyio==4.3.0
# via httpx
# via starlette
# via watchfiles
babel==2.15.0
# via pydata-sphinx-theme
# via sphinx
beautifulsoup4==4.12.3
# via pydata-sphinx-theme
boto3==1.34.103
# via konoha
botocore==1.34.103
# via boto3
# via s3transfer
certifi==2024.2.2
# via httpcore
# via httpx
# via requests
cffi==1.16.0
# via natto-py
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via typer
# via uvicorn
cython==3.0.10
# via dynet38
dnspython==2.6.1
# via email-validator
docutils==0.21.2
# via pydata-sphinx-theme
# via sphinx
dynet38==2.2
# via nagisa
email-validator==2.1.1
# via fastapi
exceptiongroup==1.2.1
# via anyio
# via pytest
fastapi==0.111.0
# via fastapi-cli
# via konoha
fastapi-cli==0.0.3
# via fastapi
h11==0.14.0
# via httpcore
# via uvicorn
httpcore==1.0.5
# via httpx
httptools==0.6.1
# via uvicorn
httpx==0.27.0
# via fastapi
idna==3.7
# via anyio
# via email-validator
# via httpx
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==7.1.0
# via sphinx
iniconfig==2.0.0
# via pytest
janome==0.5.0
# via konoha
jinja2==3.1.4
# via fastapi
# via sphinx
jmespath==1.0.1
# via boto3
# via botocore
kytea==0.1.9
# via konoha
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via jinja2
mdurl==0.1.2
# via markdown-it-py
mypy==1.10.0
mypy-extensions==1.0.0
# via mypy
nagisa==0.2.11
# via konoha
natto-py==1.0.1
# via konoha
numpy==1.26.4
# via dynet38
# via nagisa
orjson==3.10.3
# via fastapi
packaging==24.0
# via pydata-sphinx-theme
# via pytest
# via sphinx
pluggy==1.5.0
# via pytest
pycparser==2.22
# via cffi
pydantic==2.7.1
# via fastapi
pydantic-core==2.18.2
# via pydantic
pydata-sphinx-theme==0.15.2
pygments==2.18.0
# via accessible-pygments
# via pydata-sphinx-theme
# via rich
# via sphinx
pytest==8.2.0
python-dateutil==2.9.0.post0
# via botocore
python-dotenv==1.0.1
# via uvicorn
python-multipart==0.0.9
# via fastapi
pyyaml==6.0.1
# via uvicorn
requests==2.31.0
# via konoha
# via sphinx
rich==13.7.1
# via typer
ruff==0.4.4
s3transfer==0.10.1
# via boto3
sentencepiece==0.1.99
# via konoha
shellingham==1.5.4
# via typer
six==1.16.0
# via nagisa
# via python-dateutil
sniffio==1.3.1
# via anyio
# via httpx
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.5
# via beautifulsoup4
sphinx==7.3.7
# via pydata-sphinx-theme
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
starlette==0.37.2
# via fastapi
sudachidict-core==20230927
# via konoha
sudachipy==0.6.8
# via konoha
# via sudachidict-core
tomli==2.0.1
# via mypy
# via pytest
# via sphinx
typer==0.12.3
# via fastapi-cli
typing-extensions==4.11.0
# via anyio
# via fastapi
# via mypy
# via pydantic
# via pydantic-core
# via pydata-sphinx-theme
# via starlette
# via typer
# via uvicorn
ujson==5.9.0
# via fastapi
urllib3==1.26.18
# via botocore
# via requests
uvicorn==0.25.0
# via fastapi
# via fastapi-cli
# via konoha
uvloop==0.19.0
# via uvicorn
watchfiles==0.21.0
# via uvicorn
websockets==12.0
# via uvicorn
zipp==3.18.1
# via importlib-metadata
Loading

0 comments on commit 25f8964

Please sign in to comment.