Skip to content

Commit 44a6b78

Browse files
authored
Migrate build backend to hatchling (#1311)
* Migrate build backend to hatchling Simplify configurations, remove the need of MANIFEST.in * Update CHANGELOG.md
1 parent 8f7ac10 commit 44a6b78

6 files changed

Lines changed: 15 additions & 29 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ jobs:
3030
with:
3131
python-version: "3.12"
3232
- name: Install build tools and doc build tools
33-
run: |
34-
pip install --upgrade "pip<24.1" "setuptools>=69.0.0,<=73.0.1"
35-
# pip<24.1 because https://github.com/omry/omegaconf/pull/1195
36-
# setuptools>=65.0.2 because https://github.com/pypa/setuptools/commit/d03da04e024ad4289342077eef6de40013630a44#diff-9ea6e1e3dde6d4a7e08c7c88eceed69ca745d0d2c779f8f85219b22266efff7fR1
37-
# setuptools<=73.0.1 because https://github.com/pypa/setuptools/issues/4620
33+
run: pip install --upgrade pip
3834
- name: Install PyThaiNLP
3935
run: pip install ".[docs]"
4036
- name: Build sphinx documentation

.github/workflows/pypi-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
env:
3434
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
3535
run: |
36-
python -m pip install --upgrade "pip<24.1" setuptools
36+
python -m pip install --upgrade pip
3737
python -m pip install ".[compact]"
3838
python -m nltk.downloader omw-1.4
3939

.github/workflows/unittest.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ on:
2121
- "pythainlp/**"
2222
- "tests/**"
2323
- "Makefile"
24-
- "MANIFEST.in"
2524
- "pyproject.toml"
2625
pull_request:
2726
branches:
@@ -33,7 +32,6 @@ on:
3332
- "pythainlp/**"
3433
- "tests/**"
3534
- "Makefile"
36-
- "MANIFEST.in"
3735
- "pyproject.toml"
3836

3937
# Avoid duplicate runs for the same source branch and repository.
@@ -94,11 +92,8 @@ jobs:
9492

9593
- name: Install build tools
9694
run: |
97-
pip install --upgrade "pip<24.1" "setuptools>=69.0.0,<=73.0.1"
95+
pip install --upgrade pip
9896
pip install coverage coveralls
99-
# pip<24.1 because https://github.com/omry/omegaconf/pull/1195
100-
# setuptools>=65.0.2 because https://github.com/pypa/setuptools/commit/d03da04e024ad4289342077eef6de40013630a44#diff-9ea6e1e3dde6d4a7e08c7c88eceed69ca745d0d2c779f8f85219b22266efff7fR1
101-
# setuptools<=73.0.1 because https://github.com/pypa/setuptools/issues/4620
10297
10398
- name: Install ICU (macOS)
10499
if: startsWith(matrix.os, 'macos-')

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ The minimum requirement is now Python 3.9.
5151
when the var is set; auto-downloads otherwise (#1306)
5252
- Callers raise `FileNotFoundError` with download instructions when
5353
a corpus path cannot be resolved (#1306)
54+
- Migrate build backend to `hatchling` (#1311)
5455

5556
### Deprecated
5657

MANIFEST.in

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

pyproject.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
[build-system]
6-
requires = ["setuptools>=69.0.0", "wheel"]
7-
build-backend = "setuptools.build_meta"
6+
requires = ["hatchling"]
7+
build-backend = "hatchling.build"
88

99
[project]
1010
name = "pythainlp"
@@ -297,14 +297,16 @@ issues = "https://github.com/PyThaiNLP/pythainlp/issues"
297297
[project.scripts]
298298
thainlp = "pythainlp.__main__:main"
299299

300-
[tool.setuptools]
301-
include-package-data = true
300+
[tool.hatch.build.targets.wheel]
301+
packages = ["pythainlp"]
302302

303-
[tool.setuptools.packages.find]
304-
exclude = ["tests", "tests.*"]
305-
306-
[tool.setuptools.package-data]
307-
pythainlp = ["corpus/*"]
303+
[tool.hatch.build.targets.sdist]
304+
include = [
305+
"pythainlp/",
306+
"tests/",
307+
"LICENSE",
308+
"README.md",
309+
]
308310

309311
# Bumpversion configuration
310312
[tool.bumpversion]

0 commit comments

Comments
 (0)