Skip to content
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

Add deepchopper-cli #51780

Merged
merged 8 commits into from
Oct 29, 2024
Merged

Add deepchopper-cli #51780

merged 8 commits into from
Oct 29, 2024

Conversation

cauliyang
Copy link
Contributor

Describe your pull request here

A CLI for Language models identify chimeric artificial reads in NanoPore direct-RNA sequencing data.

Please read the guidelines for Bioconda recipes before opening a pull request (PR).

General instructions

  • If this PR adds or updates a recipe, use "Add" or "Update" appropriately as the first word in its title.
  • New recipes not directly relevant to the biological sciences need to be submitted to the conda-forge channel instead of Bioconda.
  • PRs require reviews prior to being merged. Once your PR is passing tests and ready to be merged, please issue the @BiocondaBot please add label command.
  • Please post questions on Gitter or ping @bioconda/core in a comment.

Instructions for avoiding API, ABI, and CLI breakage issues

Conda is able to record and lock (a.k.a. pin) dependency versions used at build time of other recipes.
This way, one can avoid that expectations of a downstream recipe with regards to API, ABI, or CLI are violated by later changes in the recipe.
If not already present in the meta.yaml, make sure to specify run_exports (see here for the rationale and comprehensive explanation).
Add a run_exports section like this:

build:
  run_exports:
    - ...

with ... being one of:

Case run_exports statement
semantic versioning {{ pin_subpackage("myrecipe", max_pin="x") }}
semantic versioning (0.x.x) {{ pin_subpackage("myrecipe", max_pin="x.x") }}
known breakage in minor versions {{ pin_subpackage("myrecipe", max_pin="x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
known breakage in patch versions {{ pin_subpackage("myrecipe", max_pin="x.x.x") }} (in such a case, please add a note that shortly mentions your evidence for that)
calendar versioning {{ pin_subpackage("myrecipe", max_pin=None) }}

while replacing "myrecipe" with either name if a name|lower variable is defined in your recipe or with the lowercase name of the package in quotes.

Bot commands for PR management

Please use the following BiocondaBot commands:

Everyone has access to the following BiocondaBot commands, which can be given in a comment:

@BiocondaBot please update Merge the master branch into a PR.
@BiocondaBot please add label Add the please review & merge label.
@BiocondaBot please fetch artifacts Post links to CI-built packages/containers.
You can use this to test packages locally.

Note that the @BiocondaBot please merge command is now depreciated. Please just squash and merge instead.

Also, the bot watches for comments from non-members that include @bioconda/<team> and will automatically re-post them to notify the addressed <team>.

Copy link
Contributor

coderabbitai bot commented Oct 29, 2024

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces two main files: build.sh and meta.yaml, aimed at facilitating the setup and packaging of the deepchopper-cli project. The build.sh script automates the installation of Rust and builds the Python package using maturin. It employs strict error handling and command tracing, installs Rust with a specific toolchain, updates the PATH, and builds the project in the py_cli directory. The script concludes by installing the generated wheel file via pip, ensuring no dependencies are installed. The meta.yaml file defines the package's metadata, including its name, version, SHA256 checksum, and build specifications. It outlines build, host, and run requirements, including dependencies on Rust and Python tools. The test section specifies a command to verify installation, while the about section provides additional project details. The file also lists additional supported platforms and recipe maintainers.

Possibly related PRs

  • Update deepchopper to 1.2.5 #51752: This PR updates the deepchopper package to version 1.2.5, which is directly related to the changes made in the main PR that introduces the deepchopper-cli package and its build process.

Suggested labels

please review & merge


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.

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1138219 and 5b97b98.

📒 Files selected for processing (2)
  • recipes/deepchopper-cli/build.sh (1 hunks)
  • recipes/deepchopper-cli/meta.yaml (1 hunks)
🧰 Additional context used
🪛 yamllint
recipes/deepchopper-cli/meta.yaml

[error] 38-38: trailing spaces

(trailing-spaces)


[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

🔇 Additional comments (3)
recipes/deepchopper-cli/build.sh (3)

1-5: LGTM! Good error handling setup.

The script properly uses set -ex for strict error handling and command tracing, which is essential for debugging build issues.


1-19: Verify compliance with Bioconda build requirements.

As this is a Bioconda recipe, please ensure:

  1. The build process is reproducible across different platforms
  2. All build dependencies are properly declared in meta.yaml
  3. The package follows Bioconda's guidelines for CLI tools
#!/bin/bash
# Check if meta.yaml includes all necessary build dependencies
rg -l 'rust-.*|maturin' recipes/*/meta.yaml

# Check for similar Rust-based CLI tools in Bioconda
rg -l 'rust.*toolchain' recipes/*/build.sh

7-9: Verify if macOS temporary home directory is needed.

The commented code for creating a temporary home directory on macOS is a common pattern in Bioconda recipes. Please verify if this is necessary for macOS builds of deepchopper-cli.

Comment on lines +11 to +13
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly --profile=minimal -y

export PATH="$HOME/.cargo/bin:$PATH"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Consider using stable Rust toolchain for better reproducibility.

Using the nightly toolchain could lead to build reproducibility issues as it changes frequently. Consider:

  1. Using the stable toolchain unless nightly is specifically required
  2. Pinning the exact nightly version if it's necessary
  3. Adding checksum verification for the rustup script

If nightly is required, consider pinning the version:

-curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly --profile=minimal -y
+curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2024-01-01 --profile=minimal -y

Committable suggestion was skipped due to low confidence.

Comment on lines 15 to 19
cd py_cli

maturin build --interpreter python --release -b bin

$PYTHON -m pip install target/wheels/*.whl --no-deps --ignore-installed -vv
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 directory checks and improve wheel installation.

The build process could be more robust with the following improvements:

  1. Verify the py_cli directory exists
  2. Clean up build artifacts after installation
  3. Use a more specific wheel path pattern

Consider this improved version:

-cd py_cli
-maturin build --interpreter python --release -b bin
-$PYTHON -m pip install target/wheels/*.whl --no-deps --ignore-installed -vv
+if [ ! -d "py_cli" ]; then
+    echo "Error: py_cli directory not found"
+    exit 1
+fi
+
+cd py_cli
+maturin build --interpreter python --release -b bin
+
+WHEEL_PATH=$(find target/wheels -name "*.whl" -type f)
+if [ -z "$WHEEL_PATH" ]; then
+    echo "Error: No wheel file found"
+    exit 1
+fi
+
+$PYTHON -m pip install "$WHEEL_PATH" --no-deps --ignore-installed -vv
+
+# Clean up build artifacts
+rm -rf target/
📝 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
cd py_cli
maturin build --interpreter python --release -b bin
$PYTHON -m pip install target/wheels/*.whl --no-deps --ignore-installed -vv
if [ ! -d "py_cli" ]; then
echo "Error: py_cli directory not found"
exit 1
fi
cd py_cli
maturin build --interpreter python --release -b bin
WHEEL_PATH=$(find target/wheels -name "*.whl" -type f)
if [ -z "$WHEEL_PATH" ]; then
echo "Error: No wheel file found"
exit 1
fi
$PYTHON -m pip install "$WHEEL_PATH" --no-deps --ignore-installed -vv
# Clean up build artifacts
rm -rf target/

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 (3)
recipes/deepchopper-cli/meta.yaml (3)

19-32: Consider adding version constraints for dependencies.

While maturin has version constraints, other dependencies like setuptools-rust and setuptools should also have version constraints to ensure reproducible builds.

Consider adding version constraints like:

  host:
    - python
    - pip
    - maturin >=1.2.1,<2
-   - setuptools-rust
-   - setuptools
+   - setuptools-rust >=1.0
+   - setuptools >=65.0

35-38: Enhance test coverage and fix formatting.

  1. Consider adding more test commands to verify key functionality.
  2. Remove trailing whitespace on line 38.

Suggested additional tests:

test:
  commands:
    - deepchopper-chop -h
    - deepchopper-chop --version
    # Add more commands to test core functionality
🧰 Tools
🪛 yamllint

[error] 38-38: trailing spaces

(trailing-spaces)


51-56: Consider adding more maintainers.

Having multiple maintainers helps ensure long-term maintenance of the package. Consider adding more maintainers from the development team.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5b97b98 and 26149b4.

📒 Files selected for processing (2)
  • recipes/deepchopper-cli/build.sh (1 hunks)
  • recipes/deepchopper-cli/meta.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/deepchopper-cli/build.sh
🧰 Additional context used
🪛 yamllint
recipes/deepchopper-cli/meta.yaml

[error] 38-38: trailing spaces

(trailing-spaces)


[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

🔇 Additional comments (4)
recipes/deepchopper-cli/meta.yaml (4)

1-3: LGTM! Package metadata is well-defined.

The package name follows conda naming conventions, and the version and checksum are properly specified.

🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)


13-17: LGTM! Build configuration is well-structured.

The build section correctly:

  • Sets build number to 0 for new package
  • Constrains Python version appropriately
  • Uses run_exports for version pinning

39-49: LGTM! About section is comprehensive.

All required metadata fields are present with clear descriptions and appropriate license information.


9-11: Verify the source URL format.

The package name in the URL uses an underscore (deepchopper_cli) while the package name is defined with a hyphen (deepchopper-cli). Please verify that this is the correct URL format on PyPI.

✅ Verification successful

Let me try another verification approach to check both URL formats and get more information.


Let me try one final verification by checking the actual PyPI API to determine the correct package name and URL format.


Source URL format is correct

The current source URL format using deepchopper_cli in the tarball name is correct. This is verified through the PyPI API which shows the official source distribution URL uses underscore format: deepchopper_cli-1.2.5.tar.gz. While the package name uses a hyphen, the source distribution tarball name consistently uses an underscore.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the PyPI package URL exists and is accessible
curl -s -I "https://pypi.io/packages/source/d/deepchopper-cli/deepchopper_cli-1.2.5.tar.gz" | head -n 1

Length of output: 115


Script:

#!/bin/bash
# Check both hyphen and underscore variants
echo "Checking URL with hyphens:"
curl -s -I "https://pypi.io/packages/source/d/deepchopper-cli/deepchopper-cli-1.2.5.tar.gz" | head -n 1

echo -e "\nChecking URL with underscores:"
curl -s -I "https://pypi.io/packages/source/d/deepchopper-cli/deepchopper_cli-1.2.5.tar.gz" | head -n 1

# Check if we can find the actual package name format in the meta.yaml
echo -e "\nChecking package name in meta.yaml:"
cat recipes/deepchopper-cli/meta.yaml | grep "name:"

# Let's also check if there's a setup.py or pyproject.toml that might indicate the correct package name
echo -e "\nLooking for setup files:"
fd "setup.py|pyproject.toml" recipes/deepchopper-cli/

Length of output: 659


Script:

#!/bin/bash
# Query PyPI API for the package information
echo "Querying PyPI API for deepchopper-cli:"
curl -s "https://pypi.org/pypi/deepchopper-cli/json" | jq -r '.urls[] | select(.packagetype=="sdist") | .url'

echo -e "\nQuerying PyPI API for deepchopper_cli:"
curl -s "https://pypi.org/pypi/deepchopper_cli/json" | jq -r '.urls[] | select(.packagetype=="sdist") | .url'

Length of output: 671

Copy link
Contributor

@mencian mencian left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @cauliyang!

@mencian mencian enabled auto-merge (squash) October 29, 2024 19:47
@mencian mencian merged commit fe83aa5 into bioconda:master Oct 29, 2024
6 checks passed
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.

2 participants