Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
matthuska committed Nov 15, 2024
1 parent 4f406f7 commit f556425
Show file tree
Hide file tree
Showing 6 changed files with 377 additions and 171 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ breakfast is written in Python and tries to follow the excellent packaging guide

### Setting up your development tools

Some tooling needs to be set up before you can work on breakfast. To install this we use mamba, a faster replacement for the conda package manager, and place them in their own environment:
Some tooling needs to be set up before you can work on breakfast. To install this we use conda, and place them in their own environment:

```sh
mamba create -n breakfast-dev python=3 poetry fortran-compiler nox pre-commit
conda env create -n breakfast-dev -f envs/breakfast-dev.yml
```

Then when you want to work on the project, or at the very least if you want to use poetry commands or run tests, you need to switch to this environment:

```sh
mamba activate breakfast-dev
conda activate breakfast-dev
```

The rest of this document assumes that you have the breakfast-dev environment active.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
Breakfast is available in [bioconda](http://bioconda.github.io/recipes/breakfast/README.html). You can install it using either the conda command, or if you've installed [mamba](https://github.com/mamba-org/mamba) you can use that:

```
$ conda install breakfast
$ conda install -c bioconda breakfast
# or
$ mamba install breakfast
$ mamba install -c bioconda breakfast
```

### Installation using pip
Expand All @@ -43,7 +43,7 @@ You will find your results in `test-run/cluster.tsv`, which should be identical

### Using breakfast with input from covsonar

breakfast uses pre-calculated sequence features (= mutations) as input rather than raw sequences. These features can be calculated with several different programs, but the one we mainly use is [covSonar](https://github.com/rki-mf1/covsonar). It can be used to maintain a database of mutations for a large number of sequences, which can then be easily queried.
breakfast uses pre-calculated sequence features (= mutations) as input rather than raw sequences. These features can be calculated with several different programs, but the one we mainly use is [covsonar](https://github.com/rki-mf1/covsonar). It can be used to maintain a database of mutations for a large number of sequences, which can then be easily queried.

```
conda activate sonar
Expand Down
12 changes: 12 additions & 0 deletions envs/breakfast-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: breakfast-dev
channels:
- conda-forge
- bioconda
- nodefaults
dependencies:
- python>=3.9,<3.10
- poetry
- poetry-plugin-export
- fortran-compiler
- nox
- pre-commit
22 changes: 16 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

package = "breakfast"
nox.options.sessions = "lint", "tests"
locations = "src", "tests", "noxfile.py"
nox.options.default_venv_backend = "conda"
locations = "src", "tests", "./noxfile.py"


def install_with_constraints(session: Session, *args: str, **kwargs: Any) -> None:
Expand All @@ -25,23 +26,32 @@ def install_with_constraints(session: Session, *args: str, **kwargs: Any) -> Non
kwargs: Additional keyword arguments for Session.install.
"""
with tempfile.NamedTemporaryFile() as requirements:
# Hide a warning that I have already handled
session.run(
"poetry",
"config",
"warnings.export",
"false",
external=True,
)
session.run(
"poetry",
"export",
"--dev",
"--with",
"dev",
"--format=requirements.txt",
"--without-hashes",
f"--output={requirements.name}",
external=True,
)
session.install(f"--constraint={requirements.name}", *args, **kwargs)
session.install("-r", requirements.name, *args, **kwargs)


@nox.session(python="3.9")
def black(session: Session) -> None:
"""Run black code formatter."""
args = session.posargs or locations
install_with_constraints(session, "black")
install_with_constraints(session)
session.run("black", *args)


Expand All @@ -66,6 +76,6 @@ def lint(session: Session) -> None:
@nox.session(python=["3.10", "3.9"])
def tests(session):
args = session.posargs or ["--cov"]
session.run("poetry", "install", "--no-dev", external=True)
install_with_constraints(session, "coverage[toml]", "pytest", "pytest-cov")
session.run("poetry", "install", "--without", "dev", external=True)
install_with_constraints(session)
session.run("pytest", *args)
Loading

0 comments on commit f556425

Please sign in to comment.