From c9781625f3c891e7faf53742ef6aa12579240088 Mon Sep 17 00:00:00 2001 From: kinegratii Date: Tue, 2 Jan 2024 00:04:38 +0800 Subject: [PATCH] :hammer: New pyproject.toml config --- .github/workflows/python-package.yml | 2 +- README.md | 9 +++++++++ docs/changelog.md | 6 ++++++ pyproject.toml | 1 - requirements_dev.txt | 3 ++- tests/test_festival_library.py | 3 +++ 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 1cf7ce3..110087c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 68a150c..5cb1f69 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,15 @@ print(FinanceNumbers.to_capital_str(decimal.Decimal(4.50))) # '肆元伍角零 - [x] [nose2](https://pypi.org/project/nose2/) | [pytest](https://docs.pytest.org/en/latest/) - [x] [Github Action](https://github.com/kinegratii/borax/actions) - [x] [Code Coverage](https://codecov.io/) +- [x] [pyproject.toml build tools](https://packaging.python.org/) + +## 项目构建 (Project Build) + +从4.0.1开始,borax 使用 *pyproject.toml* 作为项目构建的配置文件,使用以下命令构建 wheel 发行包。 + +```shell +python -m build -w +``` ## 开源协议 (License) diff --git a/docs/changelog.md b/docs/changelog.md index 727d21a..e10b973 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,11 @@ # 更新日志 +## v4.0.1 + +- 使用 *pyproject.toml* 项目构建配置文件,构建命令 `python -m build -w` +- 支持python3.12 +- 新增方法 `FestivalLibrary.extend_term_festivals` + ## v4.0.0 (20221115) - 新增基于 tkinter 的 [节日界面库](/guides/festivals-ui) diff --git a/pyproject.toml b/pyproject.toml index e1593c1..ae40714 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,6 @@ Documentation = "https://borax.readthedocs.io/zh_CN/latest/" Repository = "https://github.com/kinegratii/borax" [tool.setuptools] -packages = ["borax"] include-package-data = true [tool.setuptools.dynamic] diff --git a/requirements_dev.txt b/requirements_dev.txt index 233e435..43653a7 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -3,4 +3,5 @@ coverage~=5.5 flake8~=6.1 mccabe~=0.6 wheel~=0.42 -setuptools~=65.0 \ No newline at end of file +setuptools~=65.0 +build~=1.0 \ No newline at end of file diff --git a/tests/test_festival_library.py b/tests/test_festival_library.py index 160558e..8a8e460 100644 --- a/tests/test_festival_library.py +++ b/tests/test_festival_library.py @@ -81,6 +81,9 @@ def test_calendar(self): fl = FestivalLibrary.load_builtin() days = fl.monthdaycalendar(2022, 1) self.assertEqual(6, len(days)) + fl1 = FestivalLibrary(fl) + self.assertTrue(isinstance(fl1, FestivalLibrary)) + self.assertTrue(len(fl) == len(fl1)) class FestivalLibraryCURDTestCase(unittest.TestCase):