Skip to content

Commit 338e26e

Browse files
ryuujiclaude
andcommitted
setup.py から pyproject.toml (PEP 621) へ移行
ビルドバックエンドは hatchling。CALIL org の active リポジトリで 事実上の標準になっているため(poetry を使っている16件はすべて archived)。 バージョンは 0.1 のまま据え置く。ビルドした wheel の ndc_parser/__init__.py が PyPI 公開済みの ndc_parser-0.1-py3-none-any.whl と sha256 まで一致することを確認済みで、 PyPI 側に手を入れる必要はない。ndc-dev/api は PyPI から ndc-parser>=0.1 を取得しているため影響を受けない。 requires-python は >=3.10 を設定した。これまで指定がなく、EOL 済みの Python でも動作を保証するように見えていた。パーサは型ヒント1箇所以外に バージョン依存がないため、実際には 3.10 と 3.14 の両方で同じ結果 (ndc8: 10340項目 / ndc9: 12388項目)を返すことを確認している。 公開ライブラリなので CALIL org のアプリ側の >=3.14 には揃えず、 サポート中の CPython を対象にする。 zips/(NDC の TTL、約1.9MB)と sample.py は配布物から除外する。 setup.py の packages 指定でも入っていなかったので配布内容は変わらない。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8801d53 commit 338e26e

3 files changed

Lines changed: 40 additions & 29 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ NDC Parser for developer
44

55
## Install
66

7-
pip install ndc_parser
7+
pip install ndc-parser
88

99
## Sample
1010
[sample.py](https://github.com/ndc-dev/python-parser/blob/master/sample.py)
@@ -13,5 +13,6 @@ pip install ndc_parser
1313
[https://github.com/ndc-dev/api](https://github.com/ndc-dev/api)
1414

1515
## build
16-
pip install wheel
17-
python setup.py bdist_wheel
16+
uv build
17+
18+
`dist/` に sdist と wheel が出力される。

pyproject.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[project]
2+
# PyPI 上のバージョンは 0.1 のまま据え置く。README 経由の long_description や
3+
# 依存ゼロという構成は setup.py 時代から変えていないので、公開済みの
4+
# ndc_parser-0.1-py3-none-any.whl と中身が一致する状態を維持している。
5+
name = "ndc-parser"
6+
version = "0.1"
7+
description = "NDC Parser"
8+
readme = "README.md"
9+
requires-python = ">=3.10"
10+
license = "MIT"
11+
license-files = ["LICENSE.txt"]
12+
authors = [{ name = "CALIL Inc.", email = "info@calil.jp" }]
13+
keywords = ["NDC", "Nippon Decimal Classification", "Parser"]
14+
classifiers = [
15+
"Development Status :: 3 - Alpha",
16+
"Intended Audience :: Developers",
17+
"Natural Language :: Japanese",
18+
"Programming Language :: Python :: 3",
19+
"Topic :: Text Processing :: Markup",
20+
]
21+
22+
[project.urls]
23+
Homepage = "https://github.com/ndc-dev/python-parser"
24+
Repository = "https://github.com/ndc-dev/python-parser"
25+
26+
[build-system]
27+
requires = ["hatchling"]
28+
build-backend = "hatchling.build"
29+
30+
# zips/(NDC の TTL、約1.9MB)と sample.py は配布物に含めない。
31+
# sample.py は README から GitHub 上のリンクとして案内している。
32+
[tool.hatch.build.targets.wheel]
33+
packages = ["ndc_parser"]
34+
35+
[tool.hatch.build.targets.sdist]
36+
include = ["ndc_parser", "README.md", "LICENSE.txt"]

setup.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)