Skip to content

Python packaging, testing suite, and general improvements#18

Open
vinisalazar wants to merge 6 commits intoKoslickiLab:mainfrom
vinisalazar:python-package
Open

Python packaging, testing suite, and general improvements#18
vinisalazar wants to merge 6 commits intoKoslickiLab:mainfrom
vinisalazar:python-package

Conversation

@vinisalazar
Copy link
Copy Markdown

@vinisalazar vinisalazar commented Mar 6, 2026

Hi @dkoslicki,

Thank you for providing fmh-funprofiler. We (@nickp60 and I) are hoping to use it for a new nf-core pipeline, funcprofiler. For that, it would be great if the code was packaged as a Python package (as proposed in #15), and ideally as a Bioconda package (happy to tackle this after this one is merged).

This PR converts the repository into an installable Python package fmhfunprofiler.

Installable package structure: source files are now organized under fmhfunprofiler/, with a pyproject.toml defining build metadata. Users get access to the funcprofiler.py and funcprofiler-many.py scripts in the PATH after install.

Direct install from GitHub: it can be installed with a single pip command straight from the repository, without requiring a PyPI release: pip install git+https://github.com/KoslickiLab/funprofiler.git

An environment.yaml is also provided for users who prefer to set up the full conda environment (including sourmash and biom-format) in one step.

Pytest test suite: added tests covering argument validation, argument parsing, package imports, version string, and CLI --help flags for both entry points. Tests can be run with pytest from the repo root.

Summary of changes:

  • fmhfunprofiler/ — Python package directory (scripts moved from repo root)
  • pyproject.toml — build config, dependencies, CLI entry points, dev extras
  • environment.yaml — conda environment definition
  • tests/ — pytest suite (test_package.py, test_funcprofiler.py, test_funcprofiler_many.py)
  • README.md — updated installation instructions
  • Bump version to 1.1.0

- Move funcprofiler.py and funcprofiler_many.py into fmh_funprofiler/ package
- Add fmh_funprofiler/__init__.py with version string
- Add pyproject.toml with build config, dependencies, and CLI entry points
- Update .gitignore with Python build artifact patterns
53 tests covering:
- Package import and version string
- CLI --help flags for both entry points
- check_args validation for funcprofiler and funcprofiler_many
  (file existence, ksize, scaled, threshold_bp)
- parse_args / parse_arguments positional and optional arguments

Also registers pytest testpaths and dev extras in pyproject.toml.
  - Update README.md install instructions
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.

1 participant