-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix: setup.py #43
fix: setup.py #43
Conversation
images not included in pypi package
WalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested reviewers
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: 0
🧹 Outside diff range and nitpick comments (2)
setup.py (2)
Line range hint
51-59
: Consider enhancing resource file discoveryWhile the current implementation will fix the image packaging issue, here are some suggested improvements:
- Add explicit file patterns for images (*.png, *.jpg, etc.)
- Add error handling for non-existent resource directories
- Consider logging when resource directories are found/not found
Here's a suggested enhancement:
def find_resource_files(): - resource_base_dirs = ("locale", "gui", "sounds") - package_data = ["*.json"] - for res in resource_base_dirs: - if path.isdir(path.join(BASE_PATH, res)): - for directory, _, files in walk(path.join(BASE_PATH, res)): - if files: - package_data.append(path.join(directory.replace(BASE_PATH, "").lstrip("/"), "*")) - return package_data + resource_base_dirs = ("locale", "gui", "sounds") + package_data = ["*.json"] + image_patterns = ["*.png", "*.jpg", "*.jpeg", "*.gif", "*.svg"] + + for res in resource_base_dirs: + res_path = path.join(BASE_PATH, res) + if not path.isdir(res_path): + print(f"Warning: Resource directory '{res}' not found") + continue + + print(f"Including resources from '{res}' directory") + for directory, _, files in walk(res_path): + if files: + rel_path = path.join(directory.replace(BASE_PATH, "").lstrip("/")) + package_data.append(path.join(rel_path, "*")) + # Add specific patterns for gui directory + if res == "gui": + for pattern in image_patterns: + package_data.append(path.join(rel_path, pattern)) + + return package_data
Line range hint
51-59
: Consider adding package manifestTo ensure consistent packaging across different environments, consider adding a MANIFEST.in file to explicitly declare resource files.
Example MANIFEST.in content:
include README.md include requirements.txt include requirements-dev.txt recursive-include gui * recursive-include locale * recursive-include sounds *
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
setup.py
(1 hunks)
🔇 Additional comments (1)
setup.py (1)
51-51
: Verify removal of 'intents' and 'dialog' directories
The change adds support for GUI resources (including images) but removes 'intents' and 'dialog' directories. Please confirm that these directories are no longer needed in the package.
images not included in pypi package
Summary by CodeRabbit