Skip to content

feat: support nox and update readme #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 26, 2024
Merged

feat: support nox and update readme #202

merged 12 commits into from
Nov 26, 2024

Conversation

shenxianpeng
Copy link
Contributor

@shenxianpeng shenxianpeng commented Nov 26, 2024

replaced #201 to closes #181 #190

Summary by CodeRabbit

  • New Features
    • Introduced a new session for live documentation updates using sphinx-autobuild.
  • Bug Fixes
    • Streamlined installation and commit check processes, enhancing reliability.
  • Documentation
    • Improved clarity and organization of the README file, including updated installation instructions and new examples.
  • Chores
    • Updated dependencies in requirements-dev.txt to use a direct Git repository link for nox.

@shenxianpeng shenxianpeng added the enhancement New feature or request label Nov 26, 2024
Copy link
Contributor

coderabbitai bot commented Nov 26, 2024

Walkthrough

The pull request introduces significant changes to the workflow configuration in .github/workflows/main.yml, transitioning to a more streamlined process using nox for dependency installation, testing, and documentation tasks. The README.rst file has been updated for clarity and detail, particularly in the usage of the commit-check tool. Additionally, the noxfile.py has been modified to enhance session definitions and functionality, including the addition of a live documentation session. The requirements-dev.txt file now references the nox dependency directly from its Git repository.

Changes

File Change Summary
.github/workflows/main.yml Simplified dependency installation, replaced pre-commit hooks with nox, updated wheel building, and documentation processes.
README.rst Improved clarity and organization, updated usage instructions, added examples, and restructured sections.
noxfile.py Updated session definitions, removed build session, integrated its functionality into install_wheel, and added docs-live session.
requirements-dev.txt Changed nox dependency to a direct Git repository link.

Assessment against linked issues

Objective Addressed Explanation
Add Examples (#181)

Possibly related PRs

  • feat: support new pre-commit hook check-merge-base #197: The changes in the main PR involve the integration of nox for commit checks, which relates to the introduction of the check-merge-base hook in this PR, enhancing the commit-check tool's functionality.
  • chore: update .pre-commit-config.yaml #198: This PR updates the .pre-commit-config.yaml file, which is relevant as the main PR also modifies the workflow to streamline commit checks and integrates nox, impacting how hooks are managed.

🐇 In the garden, we hop and play,
With nox to guide us on our way.
Commit checks are now a breeze,
Documentation flows with such ease.
From requirements to README bright,
Our project shines, oh what a sight! 🌼

Warning

Rate limit exceeded

@shenxianpeng has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c83e2db and 3ae5caf.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

@shenxianpeng shenxianpeng marked this pull request as ready for review November 26, 2024 14:09
Copy link
Contributor

@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: 4

🧹 Outside diff range and nitpick comments (9)
noxfile.py (4)

44-45: Consider session dependency tradeoffs

The removal of the install-wheel dependency makes this session more independent but might lead to duplicate work if both sessions are run in the same workflow.

Consider adding a comment explaining the rationale for removing the dependency, or explore using nox's session chaining features if the wheel installation is still needed.


46-47: Consider parameterizing commit-check options

The commit-check command options are currently hardcoded. Consider making them configurable through session arguments.

 @nox.session(name="commit-check")
 def commit_check(session):
     session.install(".")
-    session.run("commit-check", "--message", "--branch", "--author-email")
+    args = session.posargs or ["--message", "--branch", "--author-email"]
+    session.run("commit-check", *args)

63-64: Remove extra blank lines

Consider removing one of the consecutive blank lines to maintain consistent spacing.


64-68: Document the new docs-live feature

The new docs-live session is a great addition for development, but it needs documentation about its usage.

Add a docstring to explain the feature:

 @nox.session(name="docs-live")
 def docs_live(session):
+    """Start a live-reloading documentation server.
+    
+    This session provides real-time documentation updates while editing.
+    Access the live documentation at http://localhost:8000 by default.
+    """
     session.install(".")
     session.install("-r", REQUIREMENTS["docs"], "sphinx-autobuild")
     session.run("sphinx-autobuild", "-b", "html", "docs", "_build/html")
.github/workflows/main.yml (3)

24-24: Add error handling and caching for dependencies

Consider adding pip cache and error handling for more robust dependency installation.

+      - uses: actions/cache@v3
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
+          restore-keys: |
+            ${{ runner.os }}-pip-
+
-      - run: pip install -r requirements-dev.txt
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r requirements-dev.txt || (echo "::error::Failed to install dependencies" && exit 1)

85-88: Add docs build verification and caching

Consider adding verification and caching for the documentation build process.

+      - uses: actions/cache@v3
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-pip-docs-${{ hashFiles('requirements-dev.txt') }}
+          restore-keys: |
+            ${{ runner.os }}-pip-docs-
+
-      - run: pip install -r requirements-dev.txt
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r requirements-dev.txt || (echo "::error::Failed to install dependencies" && exit 1)

       - name: Build docs
-        run: nox -s docs
+        run: |
+          nox -s docs
+          # Verify docs were built successfully
+          test -f docs/_build/html/index.html || (echo "::error::Documentation build failed - index.html not found" && exit 1)

Line range hint 1-103: Consider using reusable workflows

The workflow could benefit from being split into reusable workflows for common steps (build, test, docs). This would:

  • Reduce duplication if more workflows are added in the future
  • Make maintenance easier
  • Allow other repositories to reuse these workflows

Example structure:

# .github/workflows/reusable-build.yml
name: Reusable Build
on:
  workflow_call:
    inputs:
      python-version:
        required: false
        type: string
        default: '3.x'
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # ... rest of build steps

Then in main.yml:

jobs:
  build:
    uses: ./.github/workflows/reusable-build.yml
    with:
      python-version: '3.x'
README.rst (2)

75-75: Enhance pre-commit hook documentation

The comment "requires prepare-commit-msg hook" might not be clear enough for users unfamiliar with git hooks. Consider adding:

  1. A brief explanation of why this hook is required
  2. Instructions on how to set up the prepare-commit-msg hook
-        -   id: check-message  # requires prepare-commit-msg hook
+        -   id: check-message  # requires prepare-commit-msg hook to validate commit messages
+            # To enable this hook, create .git/hooks/prepare-commit-msg with:
+            # #!/bin/sh
+            # exec < /dev/tty

177-198: Consider refactoring repeated ASCII art

The ASCII art error banner is duplicated across multiple examples. Consider:

  1. Moving the ASCII art to a separate section and referencing it
  2. Using a more concise representation in the examples
  3. Adding a note that this is how it appears in the terminal
+Error Banner
+~~~~~~~~~~~~
+
+All error messages are displayed with this banner:
+
+(ASCII art here)
+
+Examples
+~~~~~~~~
+
+Below are various error scenarios and their specific messages:
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1d194eb and 7bf6d64.

📒 Files selected for processing (4)
  • .github/workflows/main.yml (2 hunks)
  • README.rst (5 hunks)
  • noxfile.py (2 hunks)
  • requirements-dev.txt (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • requirements-dev.txt
🔇 Additional comments (4)
noxfile.py (2)

59-62: LGTM! Installation process simplified

The removal of the -e flag simplifies the installation process while maintaining functionality.


37-38: Verify wheel building process reliability

The removal of the build session dependency means we need to ensure the wheel building process is reliable within the install-wheel session itself.

✅ Verification successful

Wheel building process is properly integrated

The wheel building process is correctly handled within the install-wheel session:

  • Uses standard pip wheel command to build the wheel
  • Properly installs the built wheel using the correct path
  • Other sessions like coverage depend on install-wheel, ensuring proper build order
  • Build configuration in pyproject.toml is correctly set up with required dependencies
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if wheel building is consistently handled across the codebase
# Look for any other wheel building processes that might conflict

# Search for wheel building commands
rg -A 2 "pip.*wheel|setup.py.*bdist_wheel"

# Search for potential build configurations
fd -e toml -x cat {} \; | grep -A 5 "\[build-system\]"

Length of output: 431


Script:

#!/bin/bash
# Let's verify the implementation of install-wheel session to ensure it handles the build process correctly

# Check the complete implementation of install-wheel session
ast-grep --pattern 'def install_wheel(session):
  $$$
}'

# Also check if there are any other build-related sessions or functions
rg -l "def.*build|session.*build"

Length of output: 105


Script:

#!/bin/bash
# Let's check the complete noxfile.py to understand the full context
cat noxfile.py

Length of output: 1959

.github/workflows/main.yml (1)

80-81: LGTM! Good improvement for PR previews

Adding the branch ref ensures that documentation is built from the correct source, which is especially useful for PR previews.

README.rst (1)

103-103: Verify CLI documentation completeness

Please ensure that all command-line options mentioned in the Git Hooks section (--message, --branch, etc.) are fully documented in the CLI help output.

✅ Verification successful

Let me gather more information about the CLI documentation.


Let me try one more search to find the CLI argument definitions.


Let me get the full context of these CLI arguments to verify their documentation.


CLI documentation is consistent with implementation

All command-line options mentioned in the Git Hooks section (--message, --branch, --author-name, --author-email, --commit-signoff, --merge-base) are properly implemented in the CLI with corresponding help text. The README correctly directs users to run commit-check --help which will show these documented options. The documentation is complete and accurate.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if all command-line options are documented
rg --type rst "(-{1,2}[a-zA-Z\-]+)" | grep -v "commit-check-"

Length of output: 5322


Script:

#!/bin/bash
# Check the CLI help output and documentation
ast-grep --pattern 'def add_arguments(parser: ArgumentParser) -> None:
  $$$
}'

# Also check the documentation file mentioned in the README
cat docs/cli_args.html 2>/dev/null || echo "File not found"

Length of output: 145


Script:

#!/bin/bash
# Search for CLI argument definitions in Python files
rg -t py "add_argument\(" -A 1

Length of output: 911


Script:

#!/bin/bash
# Get full context of CLI argument definitions
rg -t py "add_argument\(" -B 1 -A 3

Length of output: 2054

@@ -79,20 +71,21 @@
- name: Install test
# using a wildcard as filename on Windows requires a bash shell
shell: bash
run: python3 -m pip install dist/*.whl
run: nox -s install-wheel
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Verify successful wheel installation

Add a verification step to ensure the wheel was installed correctly.

-        run: nox -s install-wheel
+        run: |
+          nox -s install-wheel
+          # Verify installation
+          python -c "import commit_check; print(commit_check.__version__)" || (echo "::error::Wheel installation verification failed" && exit 1)

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +33 to +37
**Commit Check** is a free, powerful tool that enforces commit metadata standards, including commit message, branch naming, committer name/email, commit signoff and more.

As an alternative to GitHub Enterprise `Metadata restrictions <https://docs.github.com/en/enterprise-server@3.11/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#metadata-restrictions>`_ and Bitbucket's paid puglin `Yet Another Commit Checker <https://marketplace.atlassian.com/apps/1211854/yet-another-commit-checker?tab=overview&hosting=datacenter>`_, Commit Check stands out by integrating DevOps principles and Infrastructure as Code (IaC).
Fully customizable with error messages and suggested commands, it ensures compliance across teams.

As an alternative to GitHub Enterprise `Metadata restrictions <https://docs.github.com/en/enterprise-server@3.11/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#metadata-restrictions>`_ and Bitbucket's paid plugin `Yet Another Commit Checker <https://marketplace.atlassian.com/apps/1211854/yet-another-commit-checker?tab=overview&hosting=datacenter>`_, Commit Check stands out by integrating DevOps principles and Infrastructure as Code (IaC).
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Add pyproject.toml examples as requested in issue #181

The documentation currently only shows YAML-based configuration via .commit-check.yml. Since issue #181 specifically requests pyproject.toml examples and is part of the v0.9.x milestone, please add a section demonstrating pyproject.toml configuration options.

  • Add a new section under "Configuration" showing how to configure commit-check in pyproject.toml
  • Include common usage examples similar to those shown in .commit-check.yml

Note: This verification confirms that:

  1. The current documentation only covers YAML configuration
  2. Issue Add Examples #181 explicitly requests pyproject.toml examples
  3. This feature is planned for the v0.9.x milestone
  4. The examples are indeed missing from the documentation
🔗 Analysis chain

Add pyproject.toml configuration examples as mentioned in issue #181

While the overview changes improve clarity, the PR objectives mention adding examples for pyproject.toml configuration (issue #181). Consider adding a section demonstrating how to configure commit-check within pyproject.toml.

Would you like me to help draft the pyproject.toml configuration examples section?


The previous search was too specific. Let's broaden our search to understand:

  1. What configuration examples currently exist
  2. Verify if issue Add Examples #181 exists and its content
    This will help us validate if pyproject.toml examples are indeed missing and required.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if pyproject.toml examples exist anywhere in the documentation
rg -i "pyproject.toml" 

Length of output: 22


Script:

#!/bin/bash
# Let's check if there are any existing configuration examples in the documentation
fd -e rst -e md | xargs rg -i "configuration|config" -A 5 -B 5

# Also check if issue #181 exists and its content
gh issue view 181

Length of output: 2987

Copy link
Contributor

@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: 0

🧹 Outside diff range and nitpick comments (2)
noxfile.py (2)

49-52: Document the commit-check flags

Consider adding inline comments to explain the purpose of each flag (--message, --branch, --author-email) to improve maintainability.

 @nox.session(name="commit-check")
 def commit_check(session):
     session.install(".")
+    # Run commit-check with flags to validate:
+    # --message: Commit message format
+    # --branch: Branch naming convention
+    # --author-email: Author's email format
     session.run("commit-check", "--message", "--branch", "--author-email")

69-73: Consider adding configuration options for sphinx-autobuild

The new docs-live session is a great addition for development! Consider enhancing it with useful sphinx-autobuild options:

 @nox.session(name="docs-live")
 def docs_live(session):
     session.install(".")
     session.install("-r", REQUIREMENTS["docs"], "sphinx-autobuild")
-    session.run("sphinx-autobuild", "-b", "html", "docs", "_build/html")
+    session.run(
+        "sphinx-autobuild",
+        "-b", "html",
+        "--open-browser",  # Open browser automatically
+        "--watch", "commit_check",  # Watch source code changes
+        "--ignore", "*.pyc",  # Ignore file patterns
+        "docs", "_build/html"
+    )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7bf6d64 and 4d34bf1.

📒 Files selected for processing (1)
  • noxfile.py (2 hunks)
🔇 Additional comments (2)
noxfile.py (2)

44-47: Previous review comment about error handling is still applicable

The implementation still needs proper error handling and cleanup for the wheel building process.


64-67: Verify the impact of removing editable mode installation

The removal of the -e flag from session.install(".") means the package is installed in non-editable mode. Please verify this won't impact the development workflow where live documentation updates might be needed.

✅ Verification successful

Let me check the content of CONTRIBUTING.md to understand the development workflow requirements.


Let me check if there are any other documentation-related tasks or development workflows in the codebase that might require live updates.


Let me check the content of docs/conf.py to see if there are any auto-documentation features that might require live updates.


Removal of editable mode installation is acceptable

The removal of -e flag from session.install(".") in the docs session is acceptable because:

  1. The only other usage of editable mode (-e) in the codebase is in CONTRIBUTING.md for debugging the commit-check package, not related to documentation.
  2. While autodoc is enabled in conf.py, the docs session is specifically for building final documentation (sphinx-build) rather than development/live documentation updates.
  3. There's no evidence of live documentation workflow (no sphinx-autobuild or livereload configurations) that would require editable mode.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if any other nox sessions or documentation tools rely on editable installation
rg -l '\-e\s+\.' | grep -v 'noxfile.py'

Length of output: 55


Script:

#!/bin/bash
# Check the content of CONTRIBUTING.md for editable installation requirements
rg -A 5 -B 5 '\-e\s+\.' CONTRIBUTING.md

Length of output: 229


Script:

#!/bin/bash
# Check for documentation-related tasks and development workflows
rg -l 'sphinx-autobuild|sphinx.ext.autosummary|sphinx.ext.autodoc' docs/
# Check other nox sessions that might need live updates
ast-grep --pattern 'def docs|def dev|def develop'

Length of output: 139


Script:

#!/bin/bash
# Check the content of docs/conf.py for auto-documentation configurations
rg -A 2 'sphinx.ext.autodoc|sphinx.ext.autosummary' docs/conf.py
# Also check if there's a live/autobuild configuration
rg 'autobuild|livereload' docs/conf.py

Length of output: 190

Copy link
Contributor

@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: 2

🧹 Outside diff range and nitpick comments (2)
.github/workflows/main.yml (2)

24-24: Add pip caching to speed up builds

Consider adding pip caching to improve build times.

      - uses: actions/setup-python@v5
        with:
          python-version: '3.x'
+      - uses: actions/cache@v3
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
+          restore-keys: |
+            ${{ runner.os }}-pip-
       - run: pip install -r requirements-dev.txt

64-64: Add pip caching to install job

Similar to the build job, add pip caching to improve installation times across matrix builds.

      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.py }}
+      - uses: actions/cache@v3
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-${{ matrix.py }}-pip-${{ hashFiles('requirements-dev.txt') }}
+          restore-keys: |
+            ${{ runner.os }}-${{ matrix.py }}-pip-
       - run: pip install -r requirements-dev.txt
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c83e2db and 3ae5caf.

📒 Files selected for processing (1)
  • .github/workflows/main.yml (3 hunks)
🔇 Additional comments (2)
.github/workflows/main.yml (2)

42-43: Reusing existing review comment

The previous review comment about adding a failure condition for coverage is still valid.


28-29: Consider combining lint and test-hook sessions

Running separate nox sessions for linting and test-hook might increase build time. Consider combining these into a single session in noxfile.py.


- name: Build wheel
run: python3 -m pip wheel --no-deps -w dist .
run: nox -s build
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add wheel build verification

Verify that the wheel was successfully built before uploading.

-        run: nox -s build
+        run: |
+          nox -s build
+          if [ ! -f dist/*.whl ]; then
+            echo "::error::Wheel file not found in dist directory"
+            exit 1
+          fi
📝 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
run: nox -s build
run: |
nox -s build
if [ ! -f dist/*.whl ]; then
echo "::error::Wheel file not found in dist directory"
exit 1
fi


- name: Build docs
working-directory: docs
run: sphinx-build -E -W -b html . _build/html
run: nox -s docs
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add documentation build verification

Verify that the documentation was built successfully before uploading.

-          run: nox -s docs
+          run: |
+            nox -s docs
+            if [ ! -d docs/_build/html ] || [ -z "$(ls -A docs/_build/html)" ]; then
+              echo "::error::Documentation not built successfully in docs/_build/html"
+              exit 1
+            fi
📝 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
run: nox -s docs
run: |
nox -s docs
if [ ! -d docs/_build/html ] || [ -z "$(ls -A docs/_build/html)" ]; then
echo "::error::Documentation not built successfully in docs/_build/html"
exit 1
fi

@shenxianpeng shenxianpeng changed the title feat: update noxfile.py and readme feat: support nox and update readme Nov 26, 2024
@shenxianpeng shenxianpeng merged commit 7de6ac2 into main Nov 26, 2024
25 checks passed
@shenxianpeng shenxianpeng deleted the feature/update-nox branch November 26, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Examples
1 participant