From 002149073453a2a51bb5e935b0ea3d43e7186b26 Mon Sep 17 00:00:00 2001 From: Apricot S <152096077+Apricot-S@users.noreply.github.com> Date: Sun, 14 Jul 2024 20:02:06 +0900 Subject: [PATCH 1/5] chore: Migrate from poetry to rye (#268) --- .gitignore | 4 +++ pyproject.toml | 79 +++++++++++++++++++++++++++----------------------- 2 files changed, 46 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 0b7a7e6..4cdfbbf 100644 --- a/.gitignore +++ b/.gitignore @@ -259,4 +259,8 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +# rye +requirements.lock +requirements-dev.lock + # End of https://www.toptal.com/developers/gitignore/api/python,venv,windows,macos,linux diff --git a/pyproject.toml b/pyproject.toml index ab0ed99..9d8f0ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,51 +1,56 @@ -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.poetry] -version = "0.0.1" +[project] name = "majsoulrpa" +version = "0.0.1" description = "A Robotic Process Automation (RPA) framework for Mahjong Soul (雀魂)" -license = "MIT" -authors = ["Apricot-S"] +authors = [ + { name = "Apricot S." } +] +license = { text = "MIT License" } +readme = "README.md" +requires-python = ">= 3.11" +keywords = ["mahjong", "Mahjong Soul", "Majsoul", "automation", "RPA"] classifiers = [ "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.11", "License :: OSI Approved :: MIT License", ] -readme = "README.md" -keywords = ["mahjong", "Mahjong Soul", "Majsoul", "automation", "RPA"] -packages = [{ include = "majsoulrpa", from = "src" }] -include = [ - "src/majsoulrpa", - "src/majsoulrpa/template/**/*", - "src/majsoulrpa/py.typed", +dependencies = [ + "imapclient>=3.0.1,<4", + "mitmproxy>=10.3.0,<11", + "opencv-python>=4.9.0.80,<5", + "playwright>=1.40.0,<2", + "protobuf>=5.26.1,<6", + "jsonschema>=4.20.0,<5", + "boto3>=1.34.11,<2", + "pyzmq>=26.0.0,<27", + "referencing>=0.35.0,<0.36", + "numpy>=2.0.0,<3", + "wsproto>=1.2.0,<2", ] -[tool.poetry.dependencies] -python = "^3.11" -imapclient = "^3.0.1" -mitmproxy = "^10.3.0" -opencv-python = "^4.9.0.80" -playwright = "^1.40.0" -protobuf = "^5.26.1" -jsonschema = "^4.20.0" -boto3 = "^1.34.11" -pyzmq = "^26.0.0" -referencing = "^0.35.0" -numpy = "^2.0.0" -wsproto = "^1.2.0" +[project.scripts] +majsoulrpa_remote_browser = "majsoulrpa.remote_browser._remote_browser:main" -[tool.poetry.group.dev.dependencies] -mypy = "^1.8.0" -ruff = "^0.5.0" -types-protobuf = "^5.26.0.20240422" -types-jsonschema = "^4.20.0.0" -boto3-stubs = { extras = ["s3"], version = "^1.34.11" } -pytest = "^8.0.1" +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" -[tool.poetry.scripts] -majsoulrpa_remote_browser = "majsoulrpa.remote_browser._remote_browser:main" +[tool.rye] +managed = true +dev-dependencies = [ + "mypy>=1.8.0,<2", + "ruff>=0.5.0,<0.6", + "types-protobuf>=5.26.0.20240422,<6", + "types-jsonschema>=4.20.0.0,<5", + "boto3-stubs[s3]>=1.34.11,<2", + "pytest>=8.0.1,<9", +] + +[tool.hatch.metadata] +allow-direct-references = true + +[tool.hatch.build.targets.wheel] +packages = ["src/majsoulrpa"] [tool.pytest.ini_options] testpaths = ["tests"] From 134f42fde22fc2daf59ad0188feb4471643abadc Mon Sep 17 00:00:00 2001 From: Apricot S <152096077+Apricot-S@users.noreply.github.com> Date: Sun, 14 Jul 2024 20:36:02 +0900 Subject: [PATCH 2/5] chore: Add classifiers (#269) --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9d8f0ff..9e33ffb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,9 +10,11 @@ readme = "README.md" requires-python = ">= 3.11" keywords = ["mahjong", "Mahjong Soul", "Majsoul", "automation", "RPA"] classifiers = [ + "Private :: Do Not Upload", + "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.11", - "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.12", ] dependencies = [ "imapclient>=3.0.1,<4", From 2d22f75b12c0190fc78544c964ae182e1c4547f4 Mon Sep 17 00:00:00 2001 From: Apricot S <152096077+Apricot-S@users.noreply.github.com> Date: Sun, 14 Jul 2024 21:35:49 +0900 Subject: [PATCH 3/5] docs: Change the installation method (#270) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87941ce..c7eb950 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ This is fork of **[Cryolite's majsoul-rpa](https://github.com/Cryolite/majsoul-r ![remote](./docs/remote.png) -## how to setup +## Install -```text -poetry install -poetry shell +```sh +majsoulrpa$ pip install . +majsoulrpa$ playwright install --with-deps chromium ``` ## License From 63d4c9e1e3dd6d2993f1f8ffc9557491304c1376 Mon Sep 17 00:00:00 2001 From: Apricot S <152096077+Apricot-S@users.noreply.github.com> Date: Sun, 14 Jul 2024 22:15:07 +0900 Subject: [PATCH 4/5] chore: delete old announcements (#271) --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index c7eb950..0109ba4 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,6 @@ This is fork of **[Cryolite's majsoul-rpa](https://github.com/Cryolite/majsoul-r 5. Supports browser viewport sizes other than 1920 x 1080 6. Supports 3-player mahjong -## Announcements - -- [2024/04/16] `mode` and `length` of `HomePresentation.create_room` can now be specified with non-literal variables. Please check the [source code](./src/majsoulrpa/presentation/home.py) for details. -- [2024/04/16] `user_data_dir` of `RPA.__init__` can now be specified with `pathlib.Path`. -- [2024/04/24] Added an optional argument `user_data_dir` to `launch_remote_browser` and `--user_data_dir` option to `majsoulrpa_remote_browser`. - ## About The Program - This program is intended to enable the participation of bots in friendly matches and tournaments where bot participation is explicitly allowed. From ea1e49cda3c76983811bfb16b464b0b371c63456 Mon Sep 17 00:00:00 2001 From: Apricot-S Date: Sun, 14 Jul 2024 22:40:20 +0900 Subject: [PATCH 5/5] chore: bump up version to v0.0.2 --- pyproject.toml | 2 +- src/majsoulrpa/_version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9e33ffb..3db4bc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "majsoulrpa" -version = "0.0.1" +version = "0.0.2" description = "A Robotic Process Automation (RPA) framework for Mahjong Soul (雀魂)" authors = [ { name = "Apricot S." } diff --git a/src/majsoulrpa/_version.py b/src/majsoulrpa/_version.py index 362d74a..b5ca99e 100644 --- a/src/majsoulrpa/_version.py +++ b/src/majsoulrpa/_version.py @@ -1 +1 @@ -__version__ = "0.0.1" +__version__ = "0.0.2"