Skip to content

Commit

Permalink
Merge pull request #83 from Clinical-Genomics/version_0.9.3
Browse files Browse the repository at this point in the history
Version 0.9.3
  • Loading branch information
dnil authored Nov 25, 2024
2 parents 5fbae0d + b86fb37 commit 08ef688
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased]
## [0.9.3]
### Fixed
- Switch build system to uv-hatchling
- Version from importlib metadata

## [0.9.2]
### Fixed
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "stranger"
version = "0.9.2"
version = "0.9.3"
description = "Annotate VCF files with STR variants with pathogenicity implications"
authors = [{name="Daniel Nilsson", email="[email protected]"}, {name="Mans Magnuson", email="[email protected]"}]
license = {text = "MIT License"}
Expand Down Expand Up @@ -36,7 +36,6 @@ Repository = "https://github.com/Clinical-Genomics/stranger"
Changelog = "https://github.com/Clinical-Genomics/stranger/blob/main/CHANGELOG.md"
"Bug Tracker" = "https://github.com/Clinical-Genomics/stranger/issues"


[project.scripts]
stranger = "stranger.cli:cli"

Expand Down
1 change: 0 additions & 1 deletion stranger/__version__.py

This file was deleted.

18 changes: 8 additions & 10 deletions stranger/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
import logging
from codecs import getreader, open

try:
from importlib.metadata import version
except ImportError:
# Try backported to piPY<37 `importlib_resources`.
from importlib_resources import version

import click
import coloredlogs

from stranger.__version__ import __version__
from stranger.constants import ANNOTATE_REPEAT_KEYS, ANNOTATE_REPEAT_KEYS_TRGT
from stranger.resources import repeats_json_path
from stranger.utils import (
Expand All @@ -23,13 +28,6 @@
LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]


def print_version(ctx, param, value):
if not value or ctx.resilient_parsing:
return
click.echo(__version__)
ctx.exit()


@click.command()
@click.argument("vcf")
@click.option(
Expand All @@ -45,19 +43,19 @@ def print_version(ctx, param, value):
)
@click.option("-i", "--family_id", default="1")
@click.option("-t", "--trgt", is_flag=True, help="File was produced with TRGT")
@click.option("--version", is_flag=True, callback=print_version, expose_value=False, is_eager=True)
@click.option(
"--loglevel",
default="INFO",
type=click.Choice(LOG_LEVELS),
help="Set the level of log output.",
show_default=True,
)
@click.version_option(version("stranger"))
@click.pass_context
def cli(context, vcf, family_id, repeats_file, loglevel, trgt):
"""Annotate str variants with str status"""
coloredlogs.install(level=loglevel)
LOG.info("Running stranger version %s", __version__)
LOG.info("Running stranger version %s", version("stranger"))

repeat_information = None
repeats_file_type = "tsv"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 08ef688

Please sign in to comment.