-
-
Notifications
You must be signed in to change notification settings - Fork 218
Sandbox: Add tasks configuration to pyproject.toml #532
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
Conversation
|
Warning Rate limit exceeded@amotl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 25 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. WalkthroughThe changes in this pull request involve updates to documentation and configuration files related to the development environment of the project. A new "Development Sandbox" section has been added to Changes
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 (3)
DEVELOP.md (3)
1-5: Enhance documentation clarity and completenessConsider improving the documentation structure by:
- Adding a brief explanation of what a "development sandbox" is and its purpose
- Including prerequisites (required Python version, git, etc.)
- Adding a table of contents for better navigation
Example addition:
# Development Sandbox -Set up a development sandbox. +This guide helps you set up a local development environment for contributing to the Responder framework. + +## Prerequisites +- Python 3.7 or higher +- Git + +## Table of Contents +- [Installation](#installation) +- [Development Commands](#development-commands)
6-12: Clarify installation options and add verification stepsThe installation command includes multiple extras without explanation. Consider:
- Documenting what each extra provides (graphql, develop, release, test)
- Adding verification steps to confirm successful installation
Example improvement:
Acquire sources and install project in editable mode. ```shell git clone https://github.com/kennethreitz/responder cd responder python3 -m venv .venv source .venv/bin/activate pip install --editable '.[graphql,develop,release,test]' + +# Verify installation +python -c "import responder; print(responder.__version__)"
+The installation includes the following optional dependencies:
+- graphql: GraphQL support
+- develop: Development tools (linting, formatting)
+- release: Package release utilities
+- test: Testing frameworks and dependencies--- `14-22`: **Document development commands and their configuration** The commands section needs more context about: 1. What `poe` is and its relationship to poethepoet 2. What each command does specifically 3. Where these commands are configured Example improvement: ```diff -Invoke linter and software tests. +## Development Commands + +The project uses [poethepoet](https://github.com/nat-n/poethepoet) for task management, configured in `pyproject.toml`. + +Run linting checks and tests: ```shell poe check+This command:
+- Runs type checking with mypy
+- Executes linting with flake8
+- Runs unit tests with pytest-Format code.
+Format code according to project standards:poe format+This command:
+- Formats code using black
+- Sorts imports using isort</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** <details> <summary>📥 Commits</summary> Files that changed from the base of the PR and between b39c539d576a4c3949d5692703aba7d3781bcf89 and 985d72e74be3b7f00b7bbebd4df511353e1ac36f. </details> <details> <summary>⛔ Files ignored due to path filters (2)</summary> * `.github/workflows/test.yaml` is excluded by `!**/*.yaml` * `pyproject.toml` is excluded by `!**/*.toml` </details> <details> <summary>📒 Files selected for processing (4)</summary> * DEVELOP.md (1 hunks) * README.md (1 hunks) * requirements-dev.txt (0 hunks) * setup.py (3 hunks) </details> <details> <summary>💤 Files with no reviewable changes (1)</summary> * requirements-dev.txt </details> <details> <summary>✅ Files skipped from review due to trivial changes (1)</summary> * README.md </details> <details> <summary>🔇 Additional comments (3)</summary><blockquote> <details> <summary>setup.py (3)</summary><blockquote> `35-35`: **LGTM! Version constraint maintained.** The version constraint for typesystem remains appropriate to prevent breaking changes. --- Line range hint `1-111`: **Verify removal of upload command references.** The migration from setup.py commands to pyproject.toml tasks is a good modernization step. Let's ensure there are no remaining references to the old upload command. ```shell #!/bin/bash # Description: Check for any remaining references to the old upload command echo "Checking for references to setup.py upload command..." rg -l "setup.py.*upload" --type md --type txt --type rst
89-91: Well-structured modernization of development tooling!The new development and release extras introduce modern, recommended tools that align with Python best practices. The
poethepoetaddition supports the PR's objective of task configuration.Let's verify these are the current recommended tools:
✅ Verification successful
Since the PyPI API calls didn't work in the sandbox environment, let's try a different approach to verify these tools by checking their usage patterns in the codebase and related configuration files.
This will help us understand:
- If these tools are properly configured in the project
- If there are any existing task runner patterns that poethepoet would replace
- If the build system is properly specified for using these tools
Let's examine the contents of pyproject.toml since it appears to contain configurations for these tools.
This will help us verify:
- If the new tools are properly configured in pyproject.toml
- What existing functionality these tools are replacing
- If the build system and tool configurations align with the extras being added
The new development tools are well-configured and actively used in the project
The verification shows that:
- All new tools are properly configured and integrated:
ruffhas detailed configuration for linting and formattingpoethepoethas comprehensive task definitions including lint, test, format, and release taskspyproject-fmtis used in the format taskvalidate-pyprojectis part of the lint taskbuildandtwineare configured in the release task- These tools are replacing a simpler custom
DebCommand, modernizing the project's development workflow- The tools are actively used with proper configurations, showing they're not just dependencies but integral parts of the development process
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if these are the latest recommended tools by examining the project's PyPI stats echo "Checking PyPI download stats and latest versions for the new tools..." for pkg in poethepoet pyproject-fmt ruff validate-pyproject build twine; do echo "=== $pkg ===" # Get latest version and weekly downloads curl -s "https://api.pypistats.org/packages/$pkg/recent" | jq '.data.last_week' curl -s "https://pypi.org/pypi/$pkg/json" | jq -r '.info.version' doneLength of output: 373
Script:
#!/bin/bash # Check for tool configurations and usage patterns echo "=== Checking for tool configurations ===" # Look for pyproject.toml which typically contains modern Python tool configs fd pyproject.toml # Check for ruff configuration fd '\.ruff\.toml|ruff\.toml' fd --type f -e toml -x grep -l 'tool.ruff' {} \; # Look for poe (poethepoet) task definitions fd --type f -e toml -x grep -l '\[tool.poe.tasks\]' {} \; # Check for any build system specifications fd --type f -e toml -x grep -l 'build-system' {} \; echo -e "\n=== Checking imports and usage patterns ===" # Check for imports/usage of these tools in Python files rg -l "from (poethepoet|ruff|twine|build|validate_pyproject)" --type py # Look for any existing task runner patterns rg -l "task_|tasks\." --type pyLength of output: 588
Script:
#!/bin/bash # Examine pyproject.toml contents echo "=== Checking pyproject.toml configuration ===" cat pyproject.toml # Also check for any existing setup.py task runners or commands that might be replaced echo -e "\n=== Checking setup.py for existing commands ===" rg -A 5 "class.*Command" setup.pyLength of output: 2677
97c8ba9 to
86456fc
Compare
The fundamental commands to mostly use are: - poe format - poe check
|
can we use 'uv' for checks? |
|
@amotl I’m leaning towards using |
|
Hi there. Thanks for your replies. If you agree in progressively modernizing the project metadata setup towards I will be very happy to learn about them from your expertise, as a few friends also started using them, and I am a bit behind, just being a user of
Excellent. Would you be able to carry over relevant advises here, or should I just cherry-pick from there on the next iteration? |
Using
|
|
Here's a revised version: @amotl, to provide some context: |
|
Yeah, I see little reason for us to use anything but uv. I can play with it in the future, i'm glad we're in a better spot now. |
|
@coderabbitai can you tell us how rye shouldn't be necessary with recent uv developments? |
|
Tip For best results, initiate chat on the files or code changes. @kennethreitz: Certainly! With recent developments, |
I see. I am excited to see if this feature of |
|
No problem! |
About
Add best-practice configuration for sandbox tasks to
pyproject.toml, using poethepoet.Details
The fundamental commands to use mostly, are:
poe formatpoe checkLater, there will also be another fundamental command:
poe releaseOther than those, there are more supportive commands, also to build Sphinx documentation and such.