Skip to content

Commit

Permalink
Merge pull request #23 from rki-mf1/22-update-dependencies-resolve-de…
Browse files Browse the repository at this point in the history
…pendabot-alerts

Bump dependabot mentioned deps, bump version
  • Loading branch information
matthuska authored Nov 15, 2024
2 parents 4f406f7 + 805853b commit 12eb6ca
Show file tree
Hide file tree
Showing 9 changed files with 389 additions and 183 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: x64
- run: pip install nox==2022.1.7
- run: pip install poetry==1.1.13
- run: pip install nox==2024.10.9
- run: pip install poetry==1.8.4
- run: nox
- run: poetry build
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: x64
- run: pip install nox==2022.1.7
- run: pip install poetry==1.1.13
- run: pip install nox==2024.10.9
- run: pip install poetry==1.8.4
- run: nox
- run: version=$(poetry version --short) && poetry version $version.dev.$(date +%s)
- run: poetry build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
python-version: ['3.10']
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: pip install nox==2022.1.7
- run: pip install poetry==1.1.13
- run: pip install nox==2024.10.9
- run: pip install poetry==1.8.4
- run: nox
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 12eb6ca

Please sign in to comment.