genotoul-bioinfo / Binette

A fast and accurate binning refinement tool to constructs high quality MAGs from the output of multiple binning tools.
https://binette.readthedocs.io
MIT License
16 stars 1 forks source link

Unit tests #15

Closed lskatz closed 2 months ago

lskatz commented 2 months ago

Hi, could you help me understand how to run the unit tests locally? This is part of the review at https://github.com/openjournals/joss-reviews/issues/6782.

JeanMainguy commented 2 months ago

Hello,

Absolutely, happy to help!

Set Up Your Environment

You’ll need to get Binette’s dependencies installed. The easiest way is with conda or mamba. Just run:

mamba create -c bioconda -c defaults -c conda-forge -n binette_test binette
conda activate binette_test

Clone the Repository

Next, grab the Binette repo and navigate into it:

git clone https://github.com/genotoul-bioinfo/Binette
cd Binette

Install Binette and Dev Dependencies

Now, install Binette along with its dev dependencies (like pytest and pytest-cov) using pip:

pip install .[dev]

Run the Unit Tests

Finally, you can run the unit tests with:

pytest .

Feel free to reach out if you hit any problem!

JeanMainguy commented 2 months ago

I just tried the commands above, and I ran into an issue with pyfastx. Conda downloads a very old version that doesn't work correctly. I'll need to fix the conda recipe to force the correct pyfastx version.

If you encounter the same problem, you can simply update pyfastx with conda or mamba:

mamba install 'pyfastx>=2'

or with pip directly:

pip install "pyfastx>=2"
JeanMainguy commented 2 months ago

The conda recipe is now fixed. I tried the commands and its working as expected 👌

lskatz commented 2 months ago

It worked!