mv ui.py -> ui.pyi, use PIL stubs in photos.pyi, update README - #10
Conversation
Reviewer's GuideThis PR modernizes project documentation and configuration by overhauling the README, enhancing type stubs for photos with PIL and ui imports, configuring Ruff in pyproject.toml, and introducing a Code of Conduct file. Class diagram for updated Asset class in photos.pyiclassDiagram
class Asset {
+get_image(original: bool = False) : PILImage
+get_ui_image(size: Optional[tuple[int, int]] = None, crop: bool = False) : UIImage
}
PILImage <.. Asset : uses
UIImage <.. Asset : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a PSF Code of Conduct; updates README and project metadata/tooling; introduces Black in CI and Ruff reconfiguration; modernizes many Pythonista type stubs (appex, dialogs, location, photos, objc_util, ui), replacing legacy typing with modern builtins, unions, TypeAlias, overloads and adding new API surface elements. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Graph Analysis (3)stubs/pythonista_stubs/dialogs.pyi (2)
stubs/pythonista_stubs/appex.pyi (4)
stubs/pythonista_stubs/photos.pyi (2)
🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Summary of Changes
Hello @hbmartin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
I've focused on enhancing the project's foundational elements. This includes refining type stub definitions for better code analysis, modernizing the project's documentation and build configurations, and formally establishing a Code of Conduct to ensure a positive and inclusive development environment. These changes aim to improve maintainability, developer experience, and community engagement.
Highlights
- Improved Type Stub Accuracy: I've updated the
photos.pyistub file to correctly utilize type hints from thePIL(Pillow) library and theuimodule, ensuring more accurate type checking for image-related operations. - Community Guidelines: I've added a comprehensive
CODE_OF_CONDUCT.mdfile, adopting the Python Software Foundation's guidelines to foster a welcoming and inclusive community environment. - Documentation and Build Tooling Updates: I've modernized the project's
README.mdto reflect current best practices, including updated badges, a switch touv addfor installation, and a clearer overview of API coverage. I also updatedpyproject.tomlto refine Ruff linting configurations.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
There was a problem hiding this comment.
Hey @hbmartin - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `stubs/pythonista_stubs/photos.pyi:28` </location>
<code_context>
...
def get_ui_image(
- self, size: Optional[Tuple[int, int]] = None, crop: bool = False
- ) -> ui_Image:
+ self, size: Optional[tuple[int, int]] = None, crop: bool = False
+ ) -> UIImage:
"""
</code_context>
<issue_to_address>
Using 'tuple[int, int]' in type hints may reduce compatibility with older Python versions.
If you need to support Python versions earlier than 3.9, use 'Tuple[int, int]' from the 'typing' module instead.
</issue_to_address>
### Comment 2
<location> `README.md:17` </location>
<code_context>
-* flake8: [flake8-mypy](https://github.com/ambv/flake8-mypy)
-
-See also: [mypy integrations](https://github.com/python/mypy#ide--linter-integrations)
+You can now develop from your computer editor with proper typing and completinos.
## API Coverage
</code_context>
<issue_to_address>
Typo: 'completinos' should be 'completions'.
Update the spelling to 'completions'.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
You can now develop from your computer editor with proper typing and completinos.
=======
You can now develop from your computer editor with proper typing and completions.
>>>>>>> REPLACE
</suggested_fix>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PR Code Suggestions ✨Latest suggestions up to d1166db
Previous suggestionsSuggestions up to commit 3740993
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Code Review
This pull request updates the project's stub files, documentation, and tooling configuration. The changes to use specific PIL and UI types in photos.pyi are a great improvement for type safety. The documentation and project configuration updates are also welcome modernizations.
I've found a critical issue in photos.pyi where a necessary type import was removed, which would break static analysis. I've also pointed out a typo in the updated README.md and suggested restoring some helpful information that was removed.
There was a problem hiding this comment.
Caution
Changes requested ❌
Reviewed everything up to 3740993 in 2 minutes and 0 seconds. Click for details.
- Reviewed
365lines of code in5files - Skipped
0files when reviewing. - Skipped posting
4draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. README.md:15
- Draft comment:
Consider providing pip install instructions in addition to 'uv add' for wider user clarity. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
2. stubs/pythonista_stubs/photos.pyi:67
- Draft comment:
The type 'List' is used (e.g. in 'media_subtypes: List[str]') without being imported. Either import List from typing or use the built-in 'list[str]' since the target is Python 3.10+. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. stubs/pythonista_stubs/photos.pyi:136
- Draft comment:
The return type of 'capture_image' is declared as 'Optional[Image]', but 'Image' is not imported. Clarify whether this should be 'PILImage' or 'UIImage'. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. README.md:17
- Draft comment:
Typographical error: 'completinos' should be corrected to 'completions'. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_gxEL6549cIhAFhxT
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed 73730df in 2 minutes and 10 seconds. Click for details.
- Reviewed
1241lines of code in8files - Skipped
0files when reviewing. - Skipped posting
8draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. README.md:17
- Draft comment:
Fixed typo: 'completinos' corrected to 'completions'. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, as it only points out a typo correction without suggesting any changes or improvements. It doesn't provide any actionable feedback or raise any concerns about the code.
2. pyproject.toml:2
- Draft comment:
The setuptools requirement is set to '>=80.1.0'; please ensure this high version is supported in all target environments. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. stubs/pythonista_stubs/appex.pyi:11
- Draft comment:
The try/except block for importing PIL.Image is handled correctly with a fallback type of Any. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. stubs/pythonista_stubs/dialogs.pyi:126
- Draft comment:
Type aliases _FieldType, _FieldDict, and _SectionTuple use modern syntax and look correct. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. stubs/pythonista_stubs/location.pyi:15
- Draft comment:
Location stubs use built-in generics (dict[str, float] | None, list[...]) and type aliases appropriately. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
6. stubs/pythonista_stubs/photos.pyi:78
- Draft comment:
Photos stubs use modern type annotations; consider refining the 'location' attribute type to be more specific (e.g. dict with defined key types) if possible. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
7. stubs/pythonista_stubs/ui.pyi:1
- Draft comment:
UI stubs look well structured; methods in the Image class (e.g. from_data, named, draw, to_png) are clearly annotated with proper types. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
8. uv.lock:2
- Draft comment:
The uv.lock file has been updated with the latest package versions and future upload timestamps (2025). Verify these future dates are intentional and acceptable for your release process. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the PR author to verify future dates in a lock file, which is not a specific code suggestion or a request for a test. It falls under the category of asking for confirmation of intention, which is against the rules.
Workflow ID: wflow_WrxreFtFK91tQ1kX
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (2)
README.md (1)
17-17: Fix typo: 'completinos' should be 'completions'.-You can now develop from your computer editor with proper typing and completinos. +You can now develop from your computer editor with proper typing and completions.stubs/pythonista_stubs/photos.pyi (1)
28-29: OK to use tuple[int, int] (Python 3.11 target)Given the project targets Python 3.11, using built-in generics like tuple[int, int] is correct. Prior concern about Tuple[...] compatibility (older Python) no longer applies.
🧹 Nitpick comments (8)
stubs/pythonista_stubs/ui.pyi (1)
121-130: Consider adding a type alias for the background_color union.The
background_colorparameter has a complex union type that could benefit from a type alias for better readability and reusability.+_Color: TypeAlias = str | tuple[int, int, int] | tuple[int, int, int, int] | float | None + class View: def __init__( self, frame: tuple[int, int, int, int] = (0, 0, 100, 100), flex: str = "", - background_color: ( - str | tuple[int, int, int] | tuple[int, int, int, int] | float | None - ) = None, + background_color: _Color = None, name: str | None = None, ) -> None: ...stubs/pythonista_stubs/appex.pyi (4)
12-14: Nice: PIL import with graceful fallbackThe try/except around PIL.Image prevents import-time failures when Pillow isn’t installed. Consider mirroring this pattern in photos.pyi for consistency.
65-67: Docstring style: align with built-in genericsDocstrings still use Optional/List/Union. For consistency with 3.11 types used in signatures, consider updating to built-in generics.
Example edits:
- Returns: list[Image | PilImage]
- Returns: Image | PilImage | None
Also applies to: 79-80
165-171: Docstring style: use built-in generics for dictTo match code style, prefer dict[str, str] over Dict[str, str] in docstrings.
178-193: Docstrings: reference imported types directlyDocstrings say Optional[ui.View]; in this stub you import View directly. Suggest “View | None” or just “View”.
stubs/pythonista_stubs/dialogs.pyi (2)
177-184: Docstring constant reference is misleadingThe default for autocapitalization mentions ui.AUTOCAPITALIZE_SENTENCES, but the constants are defined here on TextField. Suggest updating the docstring accordingly.
Proposed text: “Defaults to TextField.AUTOCAPITALIZE_SENTENCES.”
279-286: Mutable default argument in a stub — prefer ellipsis to reflect default existsWhile stubs aren’t executed, list defaults can be confusing. Using ... is idiomatic in .pyi to indicate a default exists without specifying the value.
Apply this diff:
-def pick_document(types: list[str] = ["public.data"]) -> str | None: +def pick_document(types: list[str] = ...) -> str | None:stubs/pythonista_stubs/photos.pyi (1)
28-31: Docstrings: modernize types to match signaturesDocstrings still use Optional[...] and ui.Image; prefer built-ins and the local alias name.
Suggested edits:
- size: tuple[int, int] | None
- Returns: UIImage
- Remove “Optional[...]” usages and use “X | None”.
Also applies to: 34-44
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (9)
CODE_OF_CONDUCT.md(1 hunks)README.md(2 hunks)pyproject.toml(3 hunks)stubs/pythonista_stubs/appex.pyi(2 hunks)stubs/pythonista_stubs/dialogs.pyi(15 hunks)stubs/pythonista_stubs/location.pyi(4 hunks)stubs/pythonista_stubs/photos.pyi(8 hunks)stubs/pythonista_stubs/ui.py(0 hunks)stubs/pythonista_stubs/ui.pyi(1 hunks)
💤 Files with no reviewable changes (1)
- stubs/pythonista_stubs/ui.py
🧰 Additional context used
🧬 Code Graph Analysis (5)
stubs/pythonista_stubs/ui.pyi (1)
stubs/pythonista_stubs/canvas.pyi (7)
begin_updates(54-56)clear(42-44)draw_path(134-136)clip(118-120)set_blend_mode(75-77)fill_path(146-148)set_alpha(71-73)
stubs/pythonista_stubs/appex.pyi (2)
stubs/pythonista_stubs/ui.pyi (2)
View(121-130)Image(5-119)stubs/pythonista_stubs/photos.pyi (1)
get_image(18-20)
stubs/pythonista_stubs/location.pyi (1)
stubs/pythonista_stubs/ui.pyi (1)
Image(5-119)
stubs/pythonista_stubs/dialogs.pyi (1)
stubs/pythonista_stubs/ui.pyi (1)
Image(5-119)
stubs/pythonista_stubs/photos.pyi (3)
stubs/pythonista_stubs/ui.pyi (2)
Image(5-119)size(39-41)stubs/pythonista_stubs/clipboard.pyi (1)
get_image(32-46)stubs/pythonista_stubs/appex.pyi (1)
get_image(71-82)
🪛 LanguageTool
CODE_OF_CONDUCT.md
[style] ~40-~40: Consider a more concise word here.
Context: ... * Creating additional online accounts in order to harass another person or circumvent a b...
(IN_ORDER_TO_PREMIUM)
🪛 markdownlint-cli2 (0.17.2)
README.md
13-13: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
14-14: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
15-15: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
16-16: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
17-17: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
18-18: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
19-19: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
20-20: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
21-21: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
34-34: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
35-35: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
36-36: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
37-37: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
38-38: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
39-39: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
40-40: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
41-41: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
42-42: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
43-43: Unordered list indentation
Expected: 0; Actual: 1
(MD007, ul-indent)
85-85: Unordered list indentation
Expected: 0; Actual: 2
(MD007, ul-indent)
🔇 Additional comments (14)
CODE_OF_CONDUCT.md (1)
1-167: Good addition of the PSF Code of Conduct.Adding a formal Code of Conduct helps establish community guidelines and expectations for contributors.
pyproject.toml (3)
8-8: LGTM! Author email added.Adding author contact information improves project metadata.
55-60: Good migration to dependency-groups.Using
[dependency-groups]follows modern Python packaging standards (PEP 735) for better dependency management.
66-73: Well-configured Ruff settings.The explicit Ruff configuration with Python 3.11 target and appropriate stub-specific lint ignores (PYI021, PYI048) is suitable for a type stubs project.
README.md (2)
4-6: Good badge updates.Replacing Travis CI with GitHub Actions and adding the Ruff badge accurately reflects the project's current tooling.
24-43: Excellent progress on API coverage.The updated table shows substantial completion of stub implementations, with appropriate issue tracking for work in progress.
stubs/pythonista_stubs/location.pyi (3)
5-13: Good typing modernization.Using
TypeAliasandLiteralfor the map type definition improves type safety and readability.
15-88: Consistent typing modernization across all functions.All function signatures properly use built-in generics (
dict,list) and PEP 604 union syntax (|), aligning with the Python 3.11 target.
25-27: Good API additions for location management.Adding
start_updates()andis_authorized()provides better control over location services and permission handling.Also applies to: 90-92
stubs/pythonista_stubs/ui.pyi (1)
1-119: Well-structured Image class with comprehensive API.The Image class provides a complete interface with proper type hints, class methods for construction, properties for metadata, and methods for drawing operations. The
_RenderingModeTypeAlias appropriately defines the allowed rendering modes.stubs/pythonista_stubs/appex.pyi (2)
8-8: Good: reuse UI types from ui stubsImporting View and Image from .ui keeps types consistent across modules.
56-56: TypeAlias for _ImageType is correct and future-proofLiteral union as a named alias is a clear improvement.
stubs/pythonista_stubs/dialogs.pyi (1)
21-21: LGTM: narrowed ListDataSource.items typeitems: list[dict[str, Any]] matches how ListDataSource is commonly used and improves static checking.
stubs/pythonista_stubs/photos.pyi (1)
134-137: LGTM: API typing improvements
- capture_image returns PILImage | None
- get_assets and album getters return list[...] with built-ins
- batch_delete/batch_revert use list[Asset]
These align with the broader modernization.Also applies to: 139-142, 149-160, 177-184
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed db38197 in 2 minutes and 45 seconds. Click for details.
- Reviewed
296lines of code in1files - Skipped
0files when reviewing. - Skipped posting
6draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. stubs/pythonista_stubs/objc_util.pyi:10
- Draft comment:
Consider importing Callable from 'typing' for consistency with other type imports. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. stubs/pythonista_stubs/objc_util.pyi:63
- Draft comment:
Specify a more precise return type for iter (e.g. Iterator[ObjCInstance]) instead of Any. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. stubs/pythonista_stubs/objc_util.pyi:104
- Draft comment:
Using '...' as the default for 'superclass' in create_objc_class may be unclear; consider a more explicit default or document this behavior. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
4. stubs/pythonista_stubs/objc_util.pyi:82
- Draft comment:
Using the internal type 'ctypes._SimpleCData' for restype/argtypes may be fragile; consider a public alternative if available. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50% This is a valid concern about API stability since internal types like _SimpleCData could change. However, looking at ctypes docs, there doesn't seem to be a good public alternative - this is the actual type that represents simple C data types. The comment suggests finding an alternative but doesn't propose one, making it not very actionable. Maybe there is a public alternative I'm not aware of? Or maybe using Any would be better than exposing internal types? While using Any would hide the internal type, it would also hide useful type information. The _SimpleCData type, despite being internal, is the most accurate way to type these parameters. The comment raises a valid concern but doesn't provide an actionable solution, and the current approach may be the best available option given ctypes' public API.
5. stubs/pythonista_stubs/objc_util.pyi:237
- Draft comment:
The 'fields' placeholder in CGPoint is acceptable for stubs, but consider adding a comment or concrete definitions to aid tooling if possible. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
6. stubs/pythonista_stubs/objc_util.pyi:152
- Draft comment:
Consider adding an ns() overload for int if integer inputs are common. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_3dS7QFnKvAA9Ho51
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed cf944e1 in 1 minute and 30 seconds. Click for details.
- Reviewed
33lines of code in3files - Skipped
0files when reviewing. - Skipped posting
3draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/ci.yml:29
- Draft comment:
Added Black check step is a good improvement. Ensure that Black and Ruff checks are aligned to avoid overlapping responsibilities. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment starts with praise but then asks to "ensure" something, which violates our rules. It's asking the author to verify/check something rather than pointing out a specific issue. While tool alignment is important, this is more of a discussion point than a concrete code change request. The comment does raise a valid concern about potential conflicts between formatting tools. Maybe there's a real issue here that needs addressing? While tool conflicts could be an issue, the comment doesn't point out any specific conflict or problem. It's just asking for verification, which our rules explicitly say to avoid. The comment should be deleted because it's asking for verification rather than pointing out a specific issue that needs fixing.
2. pyproject.toml:73
- Draft comment:
The lint.ignore list now includes 'A002' and a per-file-ignore is added for objc_util.pyi. Confirm these ignores are intentional to suppress false positives and document them if necessary. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =30%<= threshold50%The comment is asking the PR author to confirm their intention regarding the lint.ignore list and per-file-ignore. This violates the rule against asking the author to confirm their intention. However, it also suggests documenting the ignores if necessary, which is a specific action. Overall, the comment leans more towards asking for confirmation, which is not allowed.
3. setup.py:1
- Draft comment:
Suppressing the missing module docstring (D100) for setup.py is acceptable given its minimal content. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative and does not provide any actionable feedback or suggestions for improvement. It simply states that suppressing a warning is acceptable, which does not align with the rules for useful comments.
Workflow ID: wflow_mx8aJKnmV98H9tbx
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
29-30: Enhance Black check output and scopeRecommend adding --diff (clearer CI feedback) and an explicit path '.' for clarity.
- - name: Check code formatting with black - run: uv run black --check + - name: Check code formatting with black + run: uv run black --check --diff .
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/ci.yml(1 hunks)pyproject.toml(3 hunks)setup.py(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- setup.py
🚧 Files skipped from review as they are similar to previous changes (1)
- pyproject.toml
🔇 Additional comments (1)
.github/workflows/ci.yml (1)
28-30: Black integration verified
- pyproject.toml declares Black as a dev dependency (
"black>=25.1.0"on line 57).- uv.lock pins Black (version 25.1.0 and wheels present).
- No
[tool.black]section found in pyproject.toml – Black will use defaults. If you need custom settings (line length, exclusions, etc.), add a[tool.black]table.No further action required unless you want non-default Black options.
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like
Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed d1166db in 1 minute and 38 seconds. Click for details.
- Reviewed
239lines of code in3files - Skipped
0files when reviewing. - Skipped posting
5draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. stubs/pythonista_stubs/appex.pyi:55
- Draft comment:
Good use of @overload decorators on get_images; the multiple overloads clarify the return type based on the 'image_type' parameter. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. stubs/pythonista_stubs/appex.pyi:75
- Draft comment:
The overloaded get_image function is clearly defined with distinct overloads for 'pil' and 'ui'; this improves type inference and IDE support. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. stubs/pythonista_stubs/dialogs.pyi:71
- Draft comment:
Introducing the StrConvertible protocol and the type variable T in list_dialog boosts type safety. Consider using a more flexible type (e.g. Sequence[T]) for the items parameter if non-list iterables should be supported. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. stubs/pythonista_stubs/dialogs.pyi:252
- Draft comment:
The updated share_image function signature accepting both UIImage and PILImage ensures consistency with related modules. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. stubs/pythonista_stubs/photos.pyi:194
- Draft comment:
The overloads for pick_asset differentiate return types based on the 'multi' parameter, providing clearer type expectations for API consumers. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_FeJ2UjcpNXONLqrx
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
@o-murphy merging this now so I can make a follow up formatting PR but happy to continue discussing these changes. |
There are a whole bunch of ruff formatting auto fixes I will commit separately (either here or in a new PR) since they are a large volume of trivial changes.
PR Type
Documentation, Enhancement
Description
Add Python Software Foundation Code of Conduct
Update README with improved badges and coverage status
Rename
ui.pytoui.pyifor proper stub typingUpdate photos module to use proper PIL and UI imports
Diagram Walkthrough
File Walkthrough
CODE_OF_CONDUCT.md
Add Python Software Foundation Code of ConductCODE_OF_CONDUCT.md
README.md
Update badges, installation, and API coverageREADME.md
uvpyproject.toml
Update project metadata and linting configurationpyproject.toml
photos.pyi
Fix imports and modernize type hintsstubs/pythonista_stubs/photos.pyi
Imageandui_Imageclasses with proper PIL and UIimports
PILImageandUIImagefrom actual modulesTupletotuplefor modern Python typing syntaxImportant
Renamed
ui.pytoui.pyi, updatedphotos.pyiimports, and enhanced documentation and configuration for type hinting and development tools.ui.pytoui.pyifor improved type hinting.photos.pyito use proper PIL and UI imports.CODE_OF_CONDUCT.mdwith Python Software Foundation Code of Conduct.README.mdwith new badges and coverage status.pyproject.tomlto includeblack,mypy, andruffin dev dependencies.uv.lockto reflect new package versions and dependencies.This description was created by
for d1166db. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
New Features
Documentation
Chores