diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 73013b0e3..7f42b651a 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -1,11 +1,19 @@ # SPDX-FileCopyrightText: 2016-2025 PyThaiNLP Project +# SPDX-FileType: SOURCE # SPDX-License-Identifier: CC0-1.0 name: Build and publish to PyPI on: + push: # Use together with "[cd build]" commit message + branches: + - dev + pull_request: # Use together with "[cd build]" commit message + branches: + - dev release: - types: [published] + types: [published] # "Publish release" button + workflow_dispatch: # Manual trigger to test wheel build jobs: echo_github_env: @@ -66,7 +74,7 @@ jobs: run: twine check dist/* - name: Store distributions - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: dist @@ -77,7 +85,7 @@ jobs: if: github.event_name == 'release' && github.event.action == 'published' steps: - name: Retrieve distributions - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: artifact path: dist diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f9893dd1..9bdf7f624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ --- -SPDX-FileCopyrightText: 2024 PyThaiNLP Project -SPDX-License-Identifier: Apache-2.0 +SPDX-FileCopyrightText: 2025 PyThaiNLP Project +SPDX-FileType: DOCUMENTATION +SPDX-License-Identifier: CC0-1.0 --- # Changelog diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a79385a18..87d06b780 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,9 @@ +--- +SPDX-FileCopyrightText: 2025 PyThaiNLP Project +SPDX-FileType: DOCUMENTATION +SPDX-License-Identifier: CC0-1.0 +--- + # Contributing to PyThaiNLP Hi! Thanks for your interest in contributing to [PyThaiNLP](https://github.com/PyThaiNLP/pythainlp). @@ -7,27 +13,42 @@ Please refer to our [Contributor Covenant Code of Conduct](https://github.com/Py ## Issue Report and Discussion - Discussion: -- GitHub issues (for problems and suggestions): -- Facebook group (not specific to PyThaiNLP, for Thai NLP discussion in general): +- GitHub issues (for problems and suggestions): + +- Facebook group (for general Thai NLP discussion, not specific to PyThaiNLP): + ## Code ## Code Guidelines -- Follow [PEP8](http://www.python.org/dev/peps/pep-0008/), use [black](https://github.com/ambv/black) with `--line-length` = 79; -- Name identifiers (variables, classes, functions, module names) with meaningful - and pronounceable names (`x` is always wrong); - - Please follow this [naming convention](https://namingconvention.org/python/). For example, global constant variables must be in `ALL_CAPS`; - -- Write tests for your new features. The test suite is in `tests/` directory. (see "Testing" section below); +- Follow [PEP8][pep8], use [black][black] with `--line-length` = 79; +- Name identifiers (variables, classes, functions, module names) + with meaningful and pronounceable names (`x` is always wrong); + - Please follow this [naming convention][naming]. + For example, global constant variables must be in `ALL_CAPS`; + ![Naming Convention](https://i.stack.imgur.com/uBr10.png) +- Write tests for your new features. The test suite is in `tests/` directory. + (see "Testing" section below); - Run all tests before pushing (just execute `tox`) so you will know if your changes broke something; -- Commented out codes are [dead - codes](http://www.codinghorror.com/blog/2008/07/coding-without-comments.html); -- All `#TODO` comments should be turned into [issues](https://github.com/pythainlp/pythainlp/issues) in GitHub; -- When appropriate, use [f-string](https://www.python.org/dev/peps/pep-0498/) - (use `f"{a} = {b}"`, instead of `"{} = {}".format(a, b)` and `"%s = %s' % (a, b)"`); -- All text files, including source codes, must end with one empty line. This is [to please git](https://stackoverflow.com/questions/5813311/no-newline-at-end-of-file#5813359) and [to keep up with POSIX standard](https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline). +- Commented out codes are [dead codes][dead-codes]; +- All `#TODO` comments should be turned into [issues][issues] in GitHub; +- When appropriate, use [f-string][pep0498] + (use `f"{a} = {b}"`, + instead of `"{} = {}".format(a, b)` and `"%s = %s' % (a, b)"`); +- All text files, including source codes, must end with one empty line. + This is [to please Git][empty-line] and + [to keep up with POSIX standard][posix]. + +[pep8]: http://www.python.org/dev/peps/pep-0008/ +[black]: https://github.com/ambv/black +[naming]: https://namingconvention.org/python/ +[pep0498]: https://www.python.org/dev/peps/pep-0498/ +[dead-codes]: http://www.codinghorror.com/blog/2008/07/coding-without-comments.html +[issues]: https://github.com/pythainlp/pythainlp/issues +[empty-line]: https://stackoverflow.com/questions/5813311/no-newline-at-end-of-file#5813359 +[posix]: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline ### Version Control System @@ -42,12 +63,13 @@ so it may be a good idea to familiarize yourself with it. ### Pull Request -- We use the famous [gitflow](http://nvie.com/posts/a-successful-git-branching-model/) -to manage our branches. +- We use the famous [gitflow][] to manage our branches. - When you create pull requests on GitHub, GitHub Actions will run tests and several checks automatically. Click the "Details" link at the end of each check to see what needs to be fixed. +[gitflow]: http://nvie.com/posts/a-successful-git-branching-model/ + ## Documentation - We use [Sphinx](https://www.sphinx-doc.org/en/master/) to generate API document @@ -131,9 +153,7 @@ See more in [tests/README.md](./tests/README.md) ## Credits - - - +[![Contributors](https://contributors-img.firebaseapp.com/image?repo=PyThaiNLP/pythainlp)](https://github.com/PyThaiNLP/pythainlp/graphs/contributors) Thanks to all [contributors](https://github.com/PyThaiNLP/pythainlp/graphs/contributors). (Image made with [contributors-img](https://contributors-img.firebaseapp.com)) diff --git a/release.md b/release.md index c9c80a3a6..d441392e3 100644 --- a/release.md +++ b/release.md @@ -1,29 +1,41 @@ +--- +SPDX-FileCopyrightText: 2025 PyThaiNLP Project +SPDX-FileType: DOCUMENTATION +SPDX-License-Identifier: CC0-1.0 +--- + # How to cut a new release -0. This project follows [semantic versioning][semver]. -1. Ensure the version and release date fields (if any) in these files +0. Check if the package can be built properly. + Include "[cd build]" in the commit message to trigger wheel building. +1. Update `CHANGELOG.md` with a short summary of important changes since + the previous release. For example, deprecation or termination of support. +2. This project follows [semantic versioning][semver]. + Ensure the version and release date fields (if any) in these files have been updated to the version of the new planned release: + - `codemeta.json` - `pyproject.toml` - `setup.cfg` - `setup.py` + - `CHANGELOG.md` - `CITATION.cff` - `README.md` - `README.TH.md` - - `CHANGELOG.md` - - `codemeta.json` -2. Navigate to the - [releases page][releases] and - click the "Draft a new release" button. +3. Navigate to the [releases page][releases] and click the + "Draft a new release" button. Only project maintainers are able to perform this step. -3. Then enter the new tag in the "Choose a tag" box. +4. Then enter the new tag in the "Choose a tag" box. The tag should begin with "v", as in, for instance, `v5.0.1`. -4. The release title should be the same as the new version tag. +5. The release title should be the same as the new version tag. For instance, the title could be `v5.0.1`. -5. The click the "Generate release notes" button. -6. You can optionally include any particular thank-you's to contributors or +6. Add a short summary of important changes in this release. + _This should be similar to what have been logged in `CHANGELOG.md`._ + Then click the "Generate release notes" button. +7. You can optionally include any particular thank-you's to contributors or reviewers in a note at the bottom of the release. -7. You can then click "publish release." -8. If [the CI][ci] run is [successful][actions], then the release will be published on both +8. You can then click "Publish release" button. +9. If [the CI][ci] run is [successful][actions], + then the release will be published on both the GitHub release page and also the [Python Package Index][pypi]. [semver]: https://semver.org/