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

Bump package and tooling dependencies #88

Merged
merged 9 commits into from
Sep 3, 2023
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
activate-environment: covsonar
channels: conda-forge,bioconda,defaults
channel-priority: true
- run: pip install nox==2022.11.21
- run: pip install poetry==1.3.2
- run: pip install nox==2023.4.22
- run: pip install poetry==1.5.1
- run: nox
- run: poetry build
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
activate-environment: covsonar
channels: conda-forge,bioconda,defaults
channel-priority: true
- run: pip install nox==2022.11.21
- run: pip install poetry==1.3.2
- run: pip install nox==2023.4.22
- run: pip install poetry==1.5.1
- run: nox
- run: version=$(poetry version --short) && poetry version $version.dev.$(date +%s)
- run: poetry build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
python-version: 3.9
activate-environment: covsonar
use-mamba: true
- run: pip install nox==2022.11.21
- run: pip install poetry==1.3.2
- run: pip install nox==2023.4.22
- run: pip install poetry==1.5.1
- run: nox
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Use the table of contents icon on the top left corner of this document to get to
Clone the repo, and the you can run these commands from within the `covsonar/` directory:

```sh
mamba create -n covsonar-dev python=3.9 poetry=1.3.2 fortran-compiler nox=2022.11.21 pre-commit emboss=6.6.0
mamba env create -n covsonar-dev -f environment.yml
mamba activate covsonar-dev # needs to be activated for the following commands to work
git config blame.ignoreRevsFile .git-blame-ignore-revs # ignore black reformatting when doing git blame
pre-commit install # install pre-commit hooks for formatting and linting
Expand All @@ -32,7 +32,7 @@ covsonar is written in Python and tries to follow the excellent packaging guidel
Some tooling needs to be set up before you can work on covsonar. To install this we use mamba, a faster replacement for the conda package manager, and place them in their own environment:

```sh
mamba create -n covsonar-dev python=3.9 poetry=1.3.2 fortran-compiler nox=2022.11.21 pre-commit emboss=6.6.0
mamba env create -n covsonar-dev -f environment.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:
Expand Down
11 changes: 11 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: sonar2
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- nox=2023.4.22
- poetry=1.5.1
- pre-commit
- python=3.9
- sqlite>=3.38.0
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def lint(session: Session) -> None:
@nox.session(python="3.9", venv_backend="mamba")
def tests(session):
args = session.posargs or ["--cov"]
session.conda_install("parasail-python==1.3.3", "libiconv", channel="bioconda")
session.conda_install("parasail-python==1.3.4", "libiconv", channel="bioconda")
session.run("poetry", "install", "--only", "main", external=True)
install_with_constraints(
session, "coverage[toml]", "nox", "pytest", "pytest-cov", "pytest-sugar"
Expand Down
564 changes: 298 additions & 266 deletions poetry.lock

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@ homepage = "https://github.com/rki-mf1/covsonar"
repository = "https://github.com/rki-mf1/covsonar"

[tool.poetry.dependencies]
python = "^3.9"
biopython = "~1.79"
tqdm = "~4.59.0"
more-itertools = "~8.7.0"
pyaml = "~20.4.0"
tabulate = "~0.8.9"
mpire = "~2.3.3"
pandas = "~1.4.0"
requests = "^2.28.0"
pango-aliasor = "^0.2.0"
parasail = "^1.3.3"
sqlparse = "^v0.4.1"
python-magic = "^0.4.27"

[tool.poetry.dev-dependencies]
pytest = "^7.1.2"
coverage = {extras = ["toml"], version = "^6.4.1"}
pytest-cov = "^3.0.0"
black = "^22.6.0"
flake8 = "^4.0.1"
flake8-bandit = "^3.0.0"
flake8-black = "^0.3.3"
flake8-bugbear = "^22.6.22"
flake8-import-order = "^0.18.1"
safety = "^2.0.0"
zimports = "^0.6.0"
pytest-sugar = "^0.9.5"
python = "~3.9.16"
biopython = ">=1.79"
tqdm = ">=4.59.0"
more-itertools = ">=8.7.0"
pyaml = ">=20.4.0"
tabulate = ">=0.8.9"
mpire = ">=2.7.1"
pandas = ">=2.0.3"
requests = ">=2.28.0"
pango-aliasor = ">=0.2.0"
parasail = ">=1.3.3"
sqlparse = ">=0.4.1"
python-magic = ">=0.4.27"

[tool.poetry.group.dev.dependencies]
pytest = ">=7.1.2"
coverage = {extras = ["toml"], version = ">=6.4.1"}
pytest-cov = ">=4.1.0"
black = ">=22.6.0"
flake8 = ">=4.0.1"
flake8-bandit = ">=3.0.0"
flake8-black = ">=0.3.3"
flake8-bugbear = ">=22.6.22"
flake8-import-order = ">=0.18.1"
safety = ">=2.0.0"
zimports = ">=0.6.0"
pytest-sugar = ">=0.9.5"

[tool.poetry.scripts]
sonar = "covsonar.sonar:main"
Expand Down
27 changes: 0 additions & 27 deletions sonar.env.yml

This file was deleted.

7 changes: 5 additions & 2 deletions src/covsonar/dbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@ def lineage_sublineage_dict(self) -> Dict[str, str]:
dict: A dictionary where the keys are lineage and the values are sublineage.
"""
if not self.__lineage_sublineage_dict:
df = pd.read_sql("SELECT * FROM lineages", self.con)
self.__lineage_sublineage_dict = dict(zip(df.lineage, df.sublineage))
sql = "SELECT lineage, sublineage FROM lineages"
rows = self.cursor.execute(sql).fetchall()
self.__lineage_sublineage_dict = (
{} if not rows else {row["lineage"]: row["sublineage"] for row in rows}
)
return self.__lineage_sublineage_dict

# BASIC OPERATIONS
Expand Down
Loading