Skip to content

Commit

Permalink
Bump version to 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen committed Mar 19, 2023
1 parent 5661b7e commit 47451e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ requires-python = "<3.12.*,>=3.9.0"
scripts = {vamb = "vamb.__main__:main"}

[metadata]
authors = [{name="Pau Piera", email="[email protected]"}, {name="Jakob Nybo Nissen", email="[email protected]"}]
authors = [
{name="Jakob Nybo Nissen", email="[email protected]"},
{name="Pau Piera", email="[email protected]"},
{name="Simon Rasmussen", email="[email protected]"}
]
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"]
Expand Down
19 changes: 3 additions & 16 deletions test/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def validate_init(init):
isinstance(init, tuple)
and len(init) in (3, 4)
and all(isinstance(i, int) for i in init[:3])
and (len(init) == 3 or init[3] == "DEV")
):
raise ValueError("Wrong format of __version__ in __init__.py")

Expand All @@ -74,31 +73,20 @@ def head_git_tag():
m = regex.match(st)
if m is None:
raise ValueError("HEADs git tag is not a valid version number")
vnum = tuple(int(i) for i in m.groups()[1:4])
tagname = m.groups()[0]

# Check it's annotated if it exists - then returncode is 0
proc = subprocess.run(["git", "describe", tagname])
is_annotated = proc.returncode == 0
return (vnum, is_annotated)
return tuple(int(i) for i in m.groups()[1:4])


class TestVersions(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.v_snakemake_readme = readme_vamb_version("../workflow/README.md")
validate_init(vamb.__version__)
cls.v_init = vamb.__version__
cls.v_changelog = changelog_version("../CHANGELOG.md")
cls.last_tag = latest_git_tag()
head_tag, is_annotated = head_git_tag()
head_tag = head_git_tag()
cls.head_tag = head_tag
cls.is_annotated = is_annotated

def test_same_versions(self):
# envs/vamb version, versions in README and last tag must all point to the latest release
self.assertEqual(self.last_tag, self.v_snakemake_readme)

# The version in the changelog must fit the one in __init__
self.assertEqual(self.v_init, self.v_changelog)

Expand All @@ -107,9 +95,8 @@ def test_dev_version(self):
# than the latest release.
# If not, it must be the same version as the tag of the current commit,
# i.e. the current commit must be a release version.
if self.v_init[-1] == "DEV":
if len(self.v_init) > 3:
self.assertGreater(self.v_init[:3], self.last_tag)
else:
self.assertEqual(self.v_init, self.head_tag)
self.assertEqual(self.v_init[:3], self.last_tag)
self.assertTrue(self.is_annotated)
9 changes: 1 addition & 8 deletions vamb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@
7) Split bins using vamb.vambtools
"""

__authors__ = "Jakob Nybo Nissen", "Simon Rasmussen"
__licence__ = "MIT"
__version__ = (4, 0, 0, "DEV")

import sys as _sys

if _sys.version_info[:2] < (3, 9):
raise ImportError("Python version must be >= 3.9")
__version__ = (4, 0, 0)

from . import vambtools
from . import parsebam
Expand Down

0 comments on commit 47451e5

Please sign in to comment.