Skip to content

Commit f42f314

Browse files
authored
Harmonize versions (#231)
1 parent a4ba397 commit f42f314

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

gramps_webapi/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
# You should have received a copy of the GNU Affero General Public License
1717
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
#
19+
20+
from ._version import __version__

gramps_webapi/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
#
1919

20-
__version__ = "0.1"
20+
__version__ = "0.2-dev.1"

gramps_webapi/data/apispec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ info:
88
99
1010
* More about Gramps and the numerous features it provides for genealogists can be found at https://gramps-project.org
11-
version: "0.99.0"
11+
version: "0.2-dev.1"
1212
license:
1313
name: "GNU Affero General Public License v3.0"
1414
url: "http://www.gnu.org/licenses/agpl-3.0.html"

tests/test_version.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Gramps Web API - A RESTful API for the Gramps genealogy program
3+
#
4+
# Copyright (C) 2021 David Straub
5+
#
6+
# This program is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU Affero General Public License as published by
8+
# the Free Software Foundation; either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU Affero General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Affero General Public License
17+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
18+
#
19+
20+
"""Test consistent version numbers."""
21+
22+
import unittest
23+
24+
import yaml
25+
from pkg_resources import resource_filename
26+
27+
from gramps_webapi import __version__
28+
29+
30+
class TestVersion(unittest.TestCase):
31+
"""Test the version specifiers are consistent."""
32+
33+
def test_version(self):
34+
"""Test version in setup and apispec are equal."""
35+
with open(
36+
resource_filename("gramps_webapi", "data/apispec.yaml")
37+
) as file_handle:
38+
schema = yaml.safe_load(file_handle)
39+
self.assertEqual(__version__, schema["info"]["version"])

0 commit comments

Comments
 (0)