PyThaiNLP / PyThaiNLP/pythainlp
Consider reduce dependencies
Open
@bact is already working on this.
Since Jan 16, 2026.
dependencies
help wanted
refactoring
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 304
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 14
Description
Background
- It is becoming more difficult to build the entire PyThaiNLP package since it has a long list of dependencies, and each of them may require conflicting versions of subdependencies.
- Dependency installation alone can take longer than one hour for each platform, way unhealthy to get responses for development
- Some dependencies also only support older/end-of-life versions of Python, making the situation more complicated. Some CI environments may not support these old Python versions. It is of security concerns too. See Python end of life information here https://devguide.python.org/versions/
Proposal
- Use the standard library when it possible. Often times there are functionalities that good enough for the job.
- For the features PyThaiNLP develops on our own, try to stick with a single library/framework for one particular area of purposes (for example, use either Tensorflow or PyTorch; avoid using both)
- Before adding a new dependency, assess first what are the transitive dependencies
- Lazy import when possible. (This does not help shortening the test time though)
- Consider putting the dependencies as a separate section in the optional dependencies in pyproject.toml. Keep the dependencies for the standard installation minimal. (This does not help shortening the test time though)
- Prefer dependencies that the community is active, consistently fixing bugs, keep updating the package to work with recent Python versions.
See also
- #639
- #655
Notes
- ONNX Runtime packages will stop supporting Python 3.8 and Python 3.9 https://github.com/microsoft/onnxruntime/releases/tag/v1.20.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.