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

Use setuptools-scm for Vamb versioning #274

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ authors = [
url = "https://github.com/RasmussenLab/vamb"
description = "Variational and Adversarial autoencoders for Metagenomic Binning"
license = "MIT"
[tool.setuptools.dynamic]
version = {attr = "vamb.__version__"}
readme = {file = "README.md"}

[build-system]
requires = ["setuptools ~= 63.0", "Cython ~= 0.29.5"]
requires = [
"setuptools ~= 64.0",
"setuptools-scm >= 8.0",
"Cython ~= 0.29.5"
]
build-backend = "setuptools.build_meta"

[tool.ruff]
Expand All @@ -43,3 +45,5 @@ filterwarnings = [
"error",
"ignore::UserWarning",
]

[tool.setuptools_scm]
102 changes: 0 additions & 102 deletions test/ci.py

This file was deleted.

4 changes: 2 additions & 2 deletions vamb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
Documentation: https://github.com/RasmussenLab/vamb/
"""

__version__ = (4, 1, 3)

from . import vambtools
from . import parsebam
from . import parsecontigs
Expand All @@ -15,8 +13,10 @@
from . import taxvamb_encode
from . import reclustering

from importlib.metadata import version as get_version
from loguru import logger

__version_str__ = get_version("vamb")
logger.remove()

__all__ = [
Expand Down
6 changes: 3 additions & 3 deletions vamb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ def run(self):
)
logger.add(sys.stderr, format=format_log)
begintime = time.time()
logger.info("Starting Vamb version " + ".".join(map(str, vamb.__version__)))
logger.info("Starting Vamb version " + vamb.__version_str__)
logger.info("Random seed is " + str(self.vamb_options.seed))
self.run_inner()
logger.info(f"Completed Vamb in {round(time.time() - begintime, 2)} seconds.")
Expand Down Expand Up @@ -2071,7 +2071,7 @@ def add_reclustering_arguments(subparser):

def main():
doc = f"""
Version: {'.'.join([str(i) for i in vamb.__version__])}
Version: {vamb.__version_str__}

Default use, good for most datasets:
vamb bin default --outdir out --fasta my_contigs.fna --bamfiles *.bam -o C
Expand All @@ -2091,7 +2091,7 @@ def main():
helpos.add_argument(
"--version",
action="version",
version=f'Vamb {".".join(map(str, vamb.__version__))}',
version=f"Vamb {vamb.__version_str__}",
)

if len(sys.argv) == 1:
Expand Down