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

Initial add telosearchlr-v1.0.0 #51438

Merged
merged 9 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions recipes/telosearchlr/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

mkdir -p ${PREFIX}/bin
for f in *.py;
do
if ! grep -q "^#!/usr/bin/env python3" "$f"; then
sed -i "1i #!/usr/bin/env python3" "$f"
fi
done
chmod +x *.py
mv *.py $PREFIX/bin
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Restrict moving only executable Python scripts to $PREFIX/bin.

The current mv *.py $PREFIX/bin command moves all Python files, including non-executable modules and libraries, to the $PREFIX/bin directory. This can lead to unnecessary clutter and potential conflicts in the system-wide bin.

Recommended Action:

  • Modify the mv command to target only Python files with a shebang line. For example:
    grep -l '^#!/usr/bin/env python' *.py | xargs mv -t $PREFIX/bin
    This ensures that only executable Python scripts are moved to $PREFIX/bin, while non-executable modules and libraries remain in their original locations.
🔗 Analysis chain

Verify the inclusion of all Python files as executables.

The script correctly moves all Python files to the $PREFIX/bin directory, making them accessible system-wide after installation. This is consistent with conda build practices.

However, please verify that all Python files in the package are indeed meant to be executable scripts. If there are any modules or libraries that should not be in the PATH, consider modifying the script to move only specific files or to use a different destination for non-executable Python files.

To help with this verification, you can run the following command in the package source directory:

This will help identify which Python files are designed as executable scripts and which might be modules or libraries.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# List all Python files in the current directory along with their first line
# to check if they have a proper shebang for executable scripts

for file in *.py; do
    echo "File: $file"
    head -n 1 "$file"
    echo "---"
done

Length of output: 147


Script:

#!/bin/bash
# Find all Python files in the repository and display their first line to identify executables

find . -type f -name "*.py" -exec echo "File: {}" \; -exec head -n 1 {} \; -exec echo "---" \;

Length of output: 11734

36 changes: 36 additions & 0 deletions recipes/telosearchlr/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% set name = "TeloSearchLR" %}
{% set version = "1.0.1" %}

package:
name: "{{ name|lower }}"
version: "{{ version }}"

source:
url: "https://github.com/gchchung/{{ name }}/archive/refs/tags/v{{ version }}.tar.gz"
sha256: "1f3750f062af9996aba3d0bf6ec2096e8176e9a6597fb15cb91514d5264d3225"

build:
noarch: python
number: 0
run_exports:
- {{ pin_subpackage('telosearchlr', max_pin="x") }}
Comment on lines +12 to +16
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

Consider adding a build script

The build section is mostly well-configured with noarch: python and the correct use of run_exports. However, there's no build script specified. For most Python packages, it's recommended to use the standard Python build process.

Consider adding a build script:

build:
  noarch: python
  number: 0
  script: "{{ PYTHON }} -m pip install . -vv"
  run_exports:
    - {{ pin_subpackage('telosearchlr', max_pin="x") }}

This ensures that the package is installed using pip, which is the recommended method for Python packages in Conda.


requirements:
host:
- python >=3.9
run:
- python >=3.9
- Bio
- pillow
- svgutils
- plotly
- tidehunter

test:
commands:
- TeloSearchLR.py -h
Comment on lines +29 to +31
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

Consider adding more comprehensive tests

While the current test command ensures that the main script is accessible and can be executed, it doesn't verify the actual functionality of the package. Consider adding more comprehensive tests to ensure the package works as expected.

For example, you could add a simple test case that processes a small sample dataset, if available:

test:
  commands:
    - TeloSearchLR.py -h
    - TeloSearchLR.py --version
    - python -c "import telosearchlr; assert telosearchlr.__version__ == '{{ version }}'"
  # If a sample dataset is available:
  # - TeloSearchLR.py -i sample_data.fastq -o test_output

This would provide more confidence in the package's functionality.

about:
home: "https://github.com/gchchung/TeloSearchLR"
license: "Academic and Non-Commercial Research Use"
license_file: LICENSE
summary: "TeloSearchLR (telomere search using long sequencing reads) is a Python script for aiding the identificaiton of telomeric repeat motifs."
Comment on lines +32 to +36
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

License Specification Mismatch

  • The meta.yaml file specifies the license as "Academic and Non-Commercial Research Use", but the LICENSE file contains the MIT License. Please ensure that the license in meta.yaml accurately reflects the project's actual license.
🔗 Analysis chain

Please clarify the license and fix the typo in the summary

  1. The license "Academic and Non-Commercial Research Use" is somewhat unusual. Please confirm if this is the official license name. If possible, consider using a standard SPDX license identifier or provide a link to the full license text for clarity.

  2. There's a typo in the summary: "identificaiton" should be "identification".

Please correct the typo in the summary:

summary: "TeloSearchLR (telomere search using long sequencing reads) is a Python script for aiding the identification of telomeric repeat motifs."

To verify the license, please run the following script:

This will help ensure that the license in the meta.yaml file accurately reflects the project's actual license.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the content of the LICENSE file
cat LICENSE

Length of output: 1103