Skip to content

fixup package to use pyproject.toml #100

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pdh
Copy link

@pdh pdh commented Feb 16, 2025

fixes #94

The current setup.py depends on no-longer supported pip internals. This change updates to the common pyproject.toml format which should preserve all of the previous behavior moving the prior --install-option="--with-audio" to extras by defining the project's optional-dependencies for audio so now you can just pip install video-to-ascii[audio].

  • removes setup.py and use optional-dependencies for audio, pip install video-to-ascii[audio]

Summary by CodeRabbit

  • Documentation

    • Updated installation instructions to use a simplified pip command for easier setup.
  • Chores

    • Introduced an updated package configuration that refines dependency management.
    • Streamlined the installation process to support optional audio functionality via standard methods.

- remove setup.py and use optional-dependencies for audio, pip install video-to-ascii[audio]
Copy link

coderabbitai bot commented Feb 16, 2025

Walkthrough

The pull request updates the installation instructions by replacing pip3 with pip in the README. It introduces a new pyproject.toml file that provides project metadata, dependency specifications, and build system configurations for the package. Additionally, the setup.py file is simplified by removing custom installation logic and instead using setuptools’ extras_require for managing optional audio dependencies.

Changes

File(s) Change Summary
README.md and setup.py Updated installation commands and overall installation logic: the README now shows pip commands instead of pip3 and setup.py has been simplified by removing custom dependency handling in favor of setuptools’ built-in extras requirement for audio support.
pyproject.toml Introduces a new file with project metadata including package name, version, description, authorship, licensing, dependency declarations, and build system requirements.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant Setup as setup.py
  participant Setuptools as setuptools

  User->>Setup: Run installation command
  Setup->>Setuptools: Call setup(extras_require={"audio": ["pyaudio"]})
  Setuptools-->>User: Manage dependency installation (optional audio)
Loading

Poem

In the fields of code I hop so light,
Leaving pip3 far behind in flight.
With commands now clear and streamlined to see,
My package dances gracefully and free.
A joyful leap in every line—oh, what glee!

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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: 0

🧹 Nitpick comments (3)
setup.py (1)

1-8: Consider removing or aligning this minimal setup.py.
Since you’ve already defined project metadata in pyproject.toml, this minimal setup.py is somewhat redundant. You can either remove it entirely if you’re adopting a pure PEP 517 approach, or align the extras (e.g., enforce the same version constraint “>=0.2.14” for pyaudio as specified in your pyproject.toml) to avoid installing different versions unexpectedly.

README.md (2)

41-41: Remove the leading dollar sign or show the command output.
Markdown lint rules (MD014) suggest removing the $ prompt unless you’re also showing output. For consistency with standard practice, consider removing it to avoid linter warnings.

- $ pip install video-to-ascii
+ pip install video-to-ascii
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

41-41: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)


47-47: Consider removing the $ prompt for the audio installation command as well.
Similarly, removing the $ sign or showing example output will eliminate the lint warning and keep the README consistent.

- $ pip install video-to-ascii[audio] # or "video-to-ascii[audio]" on zsh
+ pip install video-to-ascii[audio] # or "video-to-ascii[audio]" on zsh
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

47-47: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4c6e5cd and 3802db0.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • pyproject.toml (1 hunks)
  • setup.py (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

41-41: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)


47-47: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)

🔇 Additional comments (1)
pyproject.toml (1)

1-44: Excellent transition to modern Python packaging.
This pyproject.toml follows recommended best practices, clearly specifying build requirements, project metadata, dependencies, optional dependencies, and scripts. If you want absolutely reproducible builds, consider pinning dependency versions more strictly. Otherwise, this setup is well-structured and aligns with current standards.

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.

Cannot install on MacOSx Ventura
1 participant