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

recipe for pgrc #50973

Merged
merged 7 commits into from
Sep 27, 2024
Merged

recipe for pgrc #50973

merged 7 commits into from
Sep 27, 2024

Conversation

kowallus
Copy link
Contributor

@kowallus kowallus commented Sep 26, 2024

Adds pgrc, a tool for compressing the DNA stream of FASTQ datasets.


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>.

Summary by CodeRabbit

  • New Features

    • Introduced a new package pgrc (version 2.0) for compressing FASTQ datasets.
    • Automated build process with a new shell script for easier installation.
  • Documentation

    • Added meta.yaml file detailing package configuration, dependencies, and metadata.

Copy link

coderabbitai bot commented Sep 26, 2024

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Files that changed from the base of the PR and between 69cf7e3 and ba4a400.

📒 Files selected for processing (1)
  • recipes/pgrc/meta.yaml (1 hunks)
___________________________________
< I like big bugs and I cannot lie. >
-----------------------------------
 \
  \   (\__/)
      (•ㅅ•)
      /   づ
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes introduce a new shell script build.sh to automate the build process for the PgRC project, along with a new meta.yaml file that defines the package configuration for pgrc, version 2.0. The build.sh script sets environment variables, configures the project with cmake, and compiles the executable, while meta.yaml specifies package details, dependencies, and metadata.

Changes

Files Change Summary
recipes/pgrc/build.sh Introduced a shell script to automate the build process, including directory creation, environment variable settings, and compilation steps.
recipes/pgrc/meta.yaml Added a package configuration file for pgrc version 2.0, detailing source, dependencies, and metadata.

Possibly related PRs

Suggested reviewers

  • gbayarri
  • martin-g

Tip

You can customize the tone of the review comments and chat replies.

Set the tone_instructions setting in your project's settings in CodeRabbit to customize the tone of the review comments and chat replies. For example, you can set the tone to Act like a strict teacher, Act like a pirate and more.


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

@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: 3

🧹 Outside diff range and nitpick comments (2)
recipes/pgrc/meta.yaml (2)

13-15: LGTM! Source section is correctly defined.

The URL and SHA256 are properly set, with good use of Jinja2 variables and Linux-specific conditionals.

There's a trailing space on line 15. Consider removing it:

-  sha256: {{ sha256 }} 
+  sha256: {{ sha256 }}
🧰 Tools
🪛 yamllint

[error] 15-15: trailing spaces

(trailing-spaces)


17-36: LGTM! Requirements, test, about, and extra sections are well-defined.

The build requirements are appropriate for a C++ project. The about section provides complete license information and a concise summary. The maintainer is correctly listed in the extra section.

Consider enhancing the test command to ensure the tool runs without errors:

test:
  commands:
    - PgRC -v 2>&1 | grep -F {{ version }}
    - PgRC --help

This additional test will verify that the tool can execute its help command without errors, providing a more robust check of its functionality.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d6403ea and 7d69ef4.

📒 Files selected for processing (2)
  • recipes/pgrc/build.sh (1 hunks)
  • recipes/pgrc/meta.yaml (1 hunks)
🧰 Additional context used
🪛 Shellcheck
recipes/pgrc/build.sh

[warning] 8-8: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🪛 yamllint
recipes/pgrc/meta.yaml

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

(syntax)


[error] 15-15: trailing spaces

(trailing-spaces)

🔇 Additional comments (5)
recipes/pgrc/build.sh (1)

1-3: LGTM: Proper script setup and binary directory creation.

The script starts with the correct shebang for a bash script and creates the necessary directory for binary files. This is a good practice for ensuring the installation location is available.

recipes/pgrc/meta.yaml (4)

1-3: LGTM! Version and SHA256 are correctly defined.

The version and SHA256 are properly set using Jinja2 templating. The conditional SHA256 for Linux is a good practice.

Note: The yamllint error about the '%' character is a false positive. Jinja2 templating is valid in YAML files used for Conda recipes.

🧰 Tools
🪛 yamllint

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

(syntax)


4-6: LGTM! Package name and version are correctly defined.

The package name "pgrc" and version (using the Jinja2 variable) are properly set.


8-11: LGTM! Build section is well-configured.

The build number is correctly set, and the use of run_exports with pin_subpackage is an excellent practice. This configuration ensures that packages depending on pgrc will automatically use compatible versions, reducing the risk of version conflicts.

The max_pin="x" setting allows compatibility with future minor and patch versions, which is generally a good balance between stability and flexibility.


1-36: Summary: The pgrc recipe is well-structured and ready for inclusion in Bioconda.

The recipe follows Bioconda guidelines and properly defines all necessary sections for a Conda package. Minor improvements were suggested for trailing spaces and test commands, but these are not blocking issues.

To ensure all requirements are met, please run the following script:

If all checks pass, you can proceed with the following steps:

  1. Apply the suggested minor improvements.
  2. Run conda-build locally to ensure the package builds successfully.
  3. Use the command @BiocondaBot please add label to indicate that the PR is ready for merging.
🧰 Tools
🪛 yamllint

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

(syntax)


[error] 15-15: trailing spaces

(trailing-spaces)

recipes/pgrc/build.sh Outdated Show resolved Hide resolved
recipes/pgrc/build.sh Outdated Show resolved Hide resolved
recipes/pgrc/build.sh Show resolved Hide resolved
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

🧹 Outside diff range and nitpick comments (4)
recipes/pgrc/meta.yaml (4)

1-12: LGTM! Consider using a more specific skip condition.

The package and build sections look good. The use of run_exports is a good practice for maintaining ABI compatibility.

Consider using a more specific skip condition:

-  skip: True  # [osx]
+  skip: True  # [osx or win]

This explicitly states that the package is not built for Windows either, which is implied by the Linux-specific build requirements.

🧰 Tools
🪛 yamllint

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

(syntax)


[error] 9-9: trailing spaces

(trailing-spaces)


14-16: LGTM! Consider consistent use of selectors.

The source section correctly specifies the URL and sha256 checksum.

For consistency, consider moving the Linux selector to the source level:

source:  # [linux]
  url: https://github.com/kowallus/PgRC/archive/refs/tags/v{{ version }}.tar.gz
  sha256: {{ sha256 }}

This avoids repetition and makes it clear that the entire source section is Linux-specific.

🧰 Tools
🪛 yamllint

[error] 16-16: trailing spaces

(trailing-spaces)


24-26: LGTM! Consider adding a basic functionality test.

The version check is a good basic test.

Consider adding a basic functionality test to ensure the tool runs without errors:

test:
  commands:
    - PgRC -v 2>&1 | grep -F {{ version }}
    - PgRC --help

This additional test ensures that the tool can be executed and responds to a basic command-line argument.


9-9: Remove trailing spaces for better code hygiene.

There are trailing spaces on lines 9 and 16. While they don't affect functionality, removing them improves code cleanliness.

Apply this diff to remove the trailing spaces:

-  skip: True  # [osx]  
+  skip: True  # [osx]
-  sha256: {{ sha256 }} 
+  sha256: {{ sha256 }}

Also applies to: 16-16

🧰 Tools
🪛 yamllint

[error] 9-9: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 7d69ef4 and 5e557e0.

📒 Files selected for processing (1)
  • recipes/pgrc/meta.yaml (1 hunks)
🧰 Additional context used
🪛 yamllint
recipes/pgrc/meta.yaml

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

(syntax)


[error] 9-9: trailing spaces

(trailing-spaces)


[error] 16-16: trailing spaces

(trailing-spaces)

🔇 Additional comments (2)
recipes/pgrc/meta.yaml (2)

28-37: LGTM! About and extra sections are well-defined.

The about section provides comprehensive information about the package, including the correct license details. The extra section properly lists the maintainer.


18-22: LGTM! Consider adding run-time requirements if needed.

The build requirements are appropriate for a C++ project using CMake.

It's common for C++ projects to have run-time dependencies. Please verify if any run-time requirements are needed. If so, add them to the requirements section:

requirements:
  build:
    - {{ compiler('cxx') }}  # [linux]
    - cmake >=3.5  # [linux]
    - make  # [linux]
  run:
    - {{ pin_compatible('libstdc++', max_pin='x.x') }}  # [linux]
    # Add any other run-time dependencies here

To verify if there are any additional run-time dependencies, you can check the project's documentation or run the following command:

@kowallus
Copy link
Contributor Author

@BiocondaBot please add label

@BiocondaBot BiocondaBot added the please review & merge set to ask for merge label Sep 26, 2024
@kowallus
Copy link
Contributor Author

ping @bioconda/core

@BiocondaBot
Copy link
Collaborator

Reposting for @kowallus to enable pings (courtesy of the BiocondaBot):

ping @bioconda/core


mkdir -p $PREFIX/bin

if [[ "$(uname)" == "Linux" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed ? You already have skip: True # [osx] in meta.yaml

cd build
export CPATH=${BUILD_PREFIX}/include
export CXXPATH=${BUILD_PREFIX}/include
export CFLAGS="$CFLAGS -I$BUILD_PREFIX/include"
Copy link
Contributor

Choose a reason for hiding this comment

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

You enhance the CFLAGS but later cmake does not make use of them via -DCMAKE_C_FLAGS=${CFLAGS}

export CXXFLAGS="$CFLAGS -I$BUILD_PREFIX/include"
export LDFLAGS="$LDFLAGS -L$BUILD_PREFIX/lib"
cmake ..
make PgRC
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
make PgRC
make -j ${CPU_COUNT} PgRC


requirements:
build:
- {{ compiler('cxx') }} # [linux]
Copy link
Contributor

Choose a reason for hiding this comment

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

The selector (# [linux]) is not needed


about:
home: https://github.com/kowallus/PgRC
license: GPL3
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use SPDX identifier

Suggested change
license: GPL3
license: GPL-3.0-or-later

home: https://github.com/kowallus/PgRC
license: GPL3
license_file: LICENSE
license_family: GPL
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
license_family: GPL
license_family: GPL3

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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5e557e0 and 69cf7e3.

📒 Files selected for processing (2)
  • recipes/pgrc/build.sh (1 hunks)
  • recipes/pgrc/meta.yaml (1 hunks)
🧰 Additional context used
🪛 Shellcheck
recipes/pgrc/build.sh

[warning] 6-6: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🪛 yamllint
recipes/pgrc/meta.yaml

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

(syntax)

🔇 Additional comments (12)
recipes/pgrc/build.sh (4)

1-3: LGTM: Initial setup is correct.

The shebang is properly set, and the bin directory is created correctly in $PREFIX.


7-10: Verify CMAKE_C_FLAGS usage in cmake command.

The environment variables are set correctly, but there's a concern that cmake might not be using these flags.

To ensure these flags are being used, you may need to pass them explicitly to cmake. Consider modifying the cmake command (on line 11) as follows:

-cmake ..
+cmake -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" ..

This change explicitly passes the flags to cmake, ensuring they are used in the build process.


1-14: Verify necessity of OS-specific code.

A past review comment mentioned OS-specific code and a skip directive in meta.yaml. However, the current script doesn't contain any OS-specific code.

Please confirm if any OS-specific code was removed from this script. If so, this is correct as it aligns with the skip directive in meta.yaml. If not, you can disregard this comment.

🧰 Tools
🪛 Shellcheck

[warning] 6-6: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)


14-14: 🛠️ Refactor suggestion

Improve robustness of the installation step.

The installation step is simple but could benefit from some improvements for better robustness and error handling.

Consider modifying the installation command as follows:

-cp PgRC $PREFIX/bin
+cp build/PgRC "${PREFIX}/bin/PgRC" || exit 1

This change:

  1. Specifies the full source path (build/PgRC), ensuring we're copying the correct file.
  2. Uses quotes around the destination path to handle potential spaces in $PREFIX.
  3. Adds error handling to exit if the copy fails.

These modifications will make the installation step more robust and less prone to errors.

Likely invalid or redundant comment.

recipes/pgrc/meta.yaml (8)

1-6: LGTM: Package and version section looks good.

The package name, version, and SHA256 checksum are correctly defined using Jinja2 templating.

🧰 Tools
🪛 yamllint

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

(syntax)


8-12: LGTM: Build section is well-configured.

The build configuration looks good:

  • Correctly skips build for macOS.
  • Build number is set to 0 for a new package.
  • Appropriate use of run_exports for version pinning.

14-16: LGTM: Source section is correctly configured.

The source URL and SHA256 checksum are properly defined, using the correct version tag and Jinja2 templating.


24-27: LGTM: Test commands are appropriate.

The test commands effectively verify the package version and basic functionality by checking the version output and running the help command.


29-34: LGTM: About section is complete and accurate.

The about section provides all necessary information:

  • Correct home URL
  • License using SPDX identifier (GPL-3.0-or-later)
  • Appropriate license file and family
  • Concise summary of the package functionality

The past comments regarding the license and license family have been addressed.


36-38: LGTM: Extra section correctly specifies the maintainer.

The maintainer information is properly provided in the extra section.


1-1: Note on static analysis warning: False positive

The yamllint tool reported a syntax error for the '%' character at the beginning of the file. This is a false positive as the '%' is part of the Jinja2 templating syntax, which is correct and commonly used in Conda recipe files.

🧰 Tools
🪛 yamllint

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

(syntax)


18-22: LGTM: Build requirements look appropriate.

The build requirements (C++ compiler, CMake >=3.5, and Make) are correctly specified for a C++ project.

Please verify if there are any runtime requirements needed for this package. If not, the current configuration is correct.

Comment on lines +5 to +6
mkdir build
cd build
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Improve error handling for directory change.

While the build directory creation is correct, it's important to handle potential failures when changing directories.

Apply this change to improve error handling:

 mkdir build
-cd build
+cd build || exit 1

This ensures the script exits if it fails to change to the build directory, preventing issues in subsequent steps.

📝 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
mkdir build
cd build
mkdir build
cd build || exit 1
🧰 Tools
🪛 Shellcheck

[warning] 6-6: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

Comment on lines +11 to +12
cmake ..
make -j ${CPU_COUNT} PgRC
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance build process with error handling and parallel jobs.

The build commands look good, but could benefit from improved error handling. The use of parallel jobs in the make command is excellent for performance.

Consider modifying the build commands as follows:

-cmake ..
-make -j ${CPU_COUNT} PgRC
+cmake .. || exit 1
+make -j${CPU_COUNT} PgRC || exit 1

These changes ensure that the script exits if either the cmake or make command fails, preventing issues with incomplete or failed builds. The space after -j has been removed as it's not necessary.

📝 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
cmake ..
make -j ${CPU_COUNT} PgRC
cmake .. || exit 1
make -j${CPU_COUNT} PgRC || exit 1

@kowallus
Copy link
Contributor Author

ping @bioconda/core

@BiocondaBot
Copy link
Collaborator

Reposting for @kowallus to enable pings (courtesy of the BiocondaBot):

ping @bioconda/core

@kowallus
Copy link
Contributor Author

ping @bioconda/core

@BiocondaBot
Copy link
Collaborator

Reposting for @kowallus to enable pings (courtesy of the BiocondaBot):

ping @bioconda/core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please review & merge set to ask for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants