diff --git a/CHANGES.rst b/CHANGES.rst index 325a53c..745582e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,7 +1,8 @@ 3.0b2 (unreleased) ------------------ -- Nothing changed yet. +- Implementing a separate API version for more version flexibility, as I'm + releasing more often than I expected. 3.0b1 (2024-10-11) diff --git a/Makefile b/Makefile index 6740bd5..2bb20eb 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ coverage: devenv $(bin_dir)/coverage report test: devenv - $(bin_dir)/pytest + PATH=$(bin_dir):$$PATH $(bin_dir)/pytest release: devenv $(bin_dir)/fullrelease diff --git a/src/unoserver/client.py b/src/unoserver/client.py index 3e1eb9a..1e98e4c 100644 --- a/src/unoserver/client.py +++ b/src/unoserver/client.py @@ -7,6 +7,8 @@ from importlib import metadata from xmlrpc.client import ServerProxy +from .server import API_VERSION + __version__ = metadata.version("unoserver") logger = logging.getLogger("unoserver") @@ -50,10 +52,10 @@ def _connect(self, proxy, retries=5, sleep=10): while retries > 0: try: info = proxy.info() - if not info["unoserver"] == __version__: + if not info["api"] == API_VERSION: raise RuntimeError( - f"Version mismatch. Client runs {__version__} while " - f"Server runs {info['unoserver']}" + f"API Version mismatch. Client {__version__} uses API {API_VERSION} " + f"while Server {info['unoserver']} uses API {info['api']}." ) return info except ConnectionError as e: diff --git a/src/unoserver/server.py b/src/unoserver/server.py index abe94cd..3748c4f 100644 --- a/src/unoserver/server.py +++ b/src/unoserver/server.py @@ -20,6 +20,7 @@ from unoserver import converter, comparer +API_VERSION = "3" __version__ = metadata.version("unoserver") logger = logging.getLogger("unoserver") @@ -147,6 +148,7 @@ def info(): ) return { "unoserver": __version__, + "api": API_VERSION, "import_filters": import_filters, "export_filters": export_filters, }