Skip to content

v2.6.3: 更新禁漫域名服务器地址,优化文档#455

Merged
hect0x7 merged 3 commits intomasterfrom
dev
Jul 16, 2025
Merged

v2.6.3: 更新禁漫域名服务器地址,优化文档#455
hect0x7 merged 3 commits intomasterfrom
dev

Conversation

@hect0x7
Copy link
Owner

@hect0x7 hect0x7 commented Jul 16, 2025

Summary by CodeRabbit

  • New Features

    • Added a project configuration file for improved build and installation support.
    • Updated the source URL for fetching the latest mobile API domain server list.
  • Documentation

    • Clarified the recommended Python version in the README.
    • Improved tutorial documentation with clearer example output and corrected code formatting.
  • Bug Fixes

    • Corrected variable naming and formatting in tutorial examples.
  • Chores

    • Updated the package version to 2.6.3.
  • Tests

    • Enhanced test output with additional search result details.

@coderabbitai
Copy link

coderabbitai bot commented Jul 16, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a pyproject.toml configuration file for project metadata and build settings, updates documentation for Python version requirements and usage examples, changes the API domain server URL in the configuration, increments the package version, and adds print statements to display search result statistics in both documentation and tests.

Changes

File(s) Summary
pyproject.toml Added new configuration file specifying build system, project metadata, dependencies, entry points, and classifiers.
README.md Clarified Python version requirements, recommending Python 3.9+ for compatibility.
assets/docs/sources/tutorial/0_common_usage.md Added print statement for search results, corrected variable names, and improved code formatting in examples.
src/jmcomic/init.py Updated version string from '2.6.2' to '2.6.3'.
src/jmcomic/jm_config.py Changed API_URL_DOMAIN_SERVER constant to a new Jakarta-based URL.
tests/test_jmcomic/test_jm_client.py Added print statement to display search result statistics in the test_search method.
.github/workflows/release_auto.yml Added explicit permissions for id-token write; commented out PyPI password secret passing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Client
    participant API_Server

    User->>Client: Initiate site search
    Client->>API_Server: Request search results
    API_Server-->>Client: Return results (total, page_size, page_count)
    Client->>User: Print search statistics
Loading

Possibly related PRs

  • Dev #326: Also updates the version string in src/jmcomic/__init__.py, showing a similar version bump process.
  • v2.5.33: 更新禁漫API域名 #399: Updates the API domain server URL and increments the version, directly related to changes in this PR.
  • Dev #324: Aligns Python version support in workflows, related to this PR’s Python version documentation and configuration updates.

Poem

🐰
A hop, a skip, a version jump anew,
Docs now clearer, Python’s path in view.
Jakarta’s server shines in config’s light,
Search stats print out, making things right.
With pyproject set and numbers aligned,
This bunny’s code is streamlined and refined!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cb6f789 and 3e9d012.

📒 Files selected for processing (2)
  • .github/workflows/release_auto.yml (2 hunks)
  • pyproject.toml (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (4)
README.md (1)

168-168: Consistent unordered-list marker

The rest of the README uses dash - for unordered lists, while this line switches to an asterisk *, triggering markdownlint MD004.

-* Python >= 3.7,建议3.9以上,因为jmcomic的依赖库可能会不支持3.9以下的版本。
+- Python >= 3.7,建议 3.9 以上,因为 jmcomic 的依赖库可能会不支持 3.9 以下的版本。
src/jmcomic/jm_config.py (1)

139-139: Single hard-coded domain → fragile

API_URL_DOMAIN_SERVER now points to a Jakarta COS bucket. If that host becomes unavailable the mobile client auto-update will fail.

Consider accepting multiple mirrors and trying them in order, e.g.:

-    API_URL_DOMAIN_SERVER = f'{PROT}jmapp03-1308024008.cos.ap-jakarta.myqcloud.com/server-2024.txt'
+    API_URL_DOMAIN_SERVER_LIST = [
+        f'{PROT}jmapp03-1308024008.cos.ap-jakarta.myqcloud.com/server-2024.txt',
+        f'{PROT}jmappc01-1308024008.cos.ap-guangzhou.myqcloud.com/server-2024.txt',
+    ]

and iterate until one succeeds.

assets/docs/sources/tutorial/0_common_usage.md (1)

129-130: Property / method consistency

The snippet prints page.page_size; ensure the public API exposes page_size as a property (see the test note). Otherwise readers will copy code that prints a method object.

pyproject.toml (1)

32-42: Add license metadata and a license trove classifier

Missing license information prevents automated compliance checks.

[project]
 ...
+license = {file = "LICENSE"}
 ...
 classifiers=[
     "Development Status :: 4 - Beta",
+    "License :: OSI Approved :: MIT License",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ede6817 and cb6f789.

📒 Files selected for processing (6)
  • README.md (1 hunks)
  • assets/docs/sources/tutorial/0_common_usage.md (3 hunks)
  • pyproject.toml (1 hunks)
  • src/jmcomic/__init__.py (1 hunks)
  • src/jmcomic/jm_config.py (1 hunks)
  • tests/test_jmcomic/test_jm_client.py (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/test_jmcomic/test_jm_client.py (1)
src/jmcomic/jm_entity.py (4)
  • page_size (595-599)
  • page_size (645-646)
  • page_size (686-687)
  • page_count (586-592)
🪛 markdownlint-cli2 (0.17.2)
README.md

168-168: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test (3.11, ubuntu-latest)
🔇 Additional comments (1)
src/jmcomic/__init__.py (1)

5-5: Version bump acknowledged

Nothing else changed in the module; the new value simply aligns the code with the release notes.


def test_search(self):
page: JmSearchPage = self.client.search_tag('+无修正 +中文 -全彩')
print(f'总数: {page.total}, 分页大小: {page.page_size},页数: {page.page_count}')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Avoid prints in tests & confirm page_size is an int

  1. Printing inside tests clutters CI output.
  2. page.page_size looks like a property, but if it is a method it will print <bound method …> and break the page_count math.
-        print(f'总数: {page.total}, 分页大小: {page.page_size},页数: {page.page_count}')
+        # Assert pagination meta instead of printing
+        import math
+        self.assertIsInstance(page.total, int)
+        self.assertGreater(page.total, 0)
+        self.assertIsInstance(page.page_size, int)
+        self.assertGreater(page.page_size, 0)
+        self.assertEqual(page.page_count,
+                         math.ceil(page.total / page.page_size))

If page_size is actually a method, decorate it with @property so callers (including the existing page_count implementation) work correctly.


🏁 Script executed:

#!/bin/bash
set -e

echo "1. Inspecting test file around line 20:"
sed -n '1,50p' tests/test_jmcomic/test_jm_client.py || true

echo
echo "2. Locating the Page class definition:"
rg -n "class Page" || echo "No Page class found"

echo
echo "3. Checking for a page_size method or property:"
rg -n -C2 "def page_size" || echo "No page_size method defined"
rg -n "@property.*page_size" || echo "No @property decorator on page_size"

echo
echo "4. Searching for page_count implementation to see how it uses page_size:"
rg -n "page_count" -C2 || echo "No page_count reference found"

Length of output: 7199


🏁 Script executed:

#!/bin/bash
set -e

echo "1. Inspect property page_count implementation in jm_entity.py:"
sed -n '580,630p' src/jmcomic/jm_entity.py || true

echo
echo "2. Locate the JmSearchPage class to see how total and page_count are set:"
rg -n "class JmSearchPage" -C5 src/jmcomic/jm_entity.py || true

Length of output: 1861


Avoid prints in tests & assert pagination metadata

The print in test_search clutters CI output. Instead, verify pagination values with assertions. Since page_size is already a @property returning an int, no decorator changes are needed.

• File: tests/test_jmcomic/test_jm_client.py (line 20)
• Replace:

-        print(f'总数: {page.total}, 分页大小: {page.page_size},页数: {page.page_count}')
+        import math
+        # Assert pagination metadata
+        self.assertIsInstance(page.total, int)
+        self.assertGreater(page.total, 0)
+        self.assertIsInstance(page.page_size, int)
+        self.assertGreater(page.page_size, 0)
+        self.assertEqual(
+            page.page_count,
+            math.ceil(page.total / page.page_size)
+        )

No changes required to the page_size property—it already returns an int as intended.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
print(f'总数: {page.total}, 分页大小: {page.page_size},页数: {page.page_count}')
import math
# Assert pagination metadata
self.assertIsInstance(page.total, int)
self.assertGreater(page.total, 0)
self.assertIsInstance(page.page_size, int)
self.assertGreater(page.page_size, 0)
self.assertEqual(
page.page_count,
math.ceil(page.total / page.page_size)
)
🤖 Prompt for AI Agents
In tests/test_jmcomic/test_jm_client.py at line 20, replace the print statement
that outputs pagination metadata with assertions that verify the expected values
of page.total, page.page_size, and page.page_count. This removes clutter from CI
output and ensures the test validates pagination correctly without modifying the
existing page_size property.

@@ -0,0 +1,42 @@
[build-system]
requires = ["setuptools"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Specify an explicit minimum setuptools version and include wheel

PEP-517/518 front-ends expect the build backend to be able to build wheels. Without a wheel requirement older environments will fail, and setuptools < 61.0 will ignore most of the PEP 621 metadata used below.

-requires = ["setuptools"]
+requires = ["setuptools>=61", "wheel"]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
requires = ["setuptools"]
requires = ["setuptools>=61", "wheel"]
🤖 Prompt for AI Agents
In pyproject.toml at line 2, update the requires list to specify a minimum
setuptools version of 61.0 or higher and add wheel as a required build
dependency. This ensures compatibility with PEP 517/518 front-ends and proper
handling of PEP 621 metadata by requiring setuptools >= 61.0 and including wheel
for building wheels.

Comment on lines +25 to +31
dependencies = [
"commonx>=0.6.38",
"curl-cffi",
"pillow",
"pycryptodome",
"pyyaml",
]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Pin or bound the remaining dependencies

All runtime dependencies except commonx are completely unpinned, which can lead to sudden breakage on fresh installs. At minimum, declare a lower bound that is known to work, e.g.:

-    "curl-cffi",
-    "pillow",
-    "pycryptodome",
-    "pyyaml",
+    "curl-cffi>=0.6",
+    "pillow>=10.0",
+    "pycryptodome>=3.19",
+    "pyyaml>=6.0",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
dependencies = [
"commonx>=0.6.38",
"curl-cffi",
"pillow",
"pycryptodome",
"pyyaml",
]
dependencies = [
"commonx>=0.6.38",
"curl-cffi>=0.6",
"pillow>=10.0",
"pycryptodome>=3.19",
"pyyaml>=6.0",
]
🤖 Prompt for AI Agents
In pyproject.toml around lines 25 to 31, the dependencies other than commonx are
unpinned, risking breakage on fresh installs. Add version constraints with lower
bounds for curl-cffi, pillow, pycryptodome, and pyyaml that are known to work,
using syntax like "package>=version" to ensure compatibility and stability.

Comment on lines +14 to +20
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Programming Language :: Python :: 3.13 is not (yet) a valid PyPI trove classifier

Uploading the package will be rejected by PyPI until that classifier is officially added. Remove or comment it out for now.

-    "Programming Language :: Python :: 3.13",
🤖 Prompt for AI Agents
In pyproject.toml around lines 14 to 20, the classifier "Programming Language ::
Python :: 3.13" is not yet valid on PyPI and will cause upload rejection. Remove
or comment out this line to ensure the package can be uploaded successfully.

"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: MacOS",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Incorrect OS classifier – use the canonical “MacOS :: MacOS X”

"Operating System :: MacOS" is invalid. The accepted classifier is:

-    "Operating System :: MacOS",
+    "Operating System :: MacOS :: MacOS X",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Operating System :: MacOS",
"Operating System :: MacOS :: MacOS X",
🤖 Prompt for AI Agents
In pyproject.toml at line 21, the operating system classifier "Operating System
:: MacOS" is incorrect. Replace it with the canonical classifier "Operating
System :: MacOS :: MacOS X" to comply with accepted Python package classifiers.

@hect0x7 hect0x7 merged commit 7a59d55 into master Jul 16, 2025
@hect0x7 hect0x7 deleted the dev branch July 16, 2025 17:07
@coderabbitai coderabbitai bot mentioned this pull request Jan 8, 2026
Merged
@coderabbitai coderabbitai bot mentioned this pull request Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant