From a98e178debac8b143f0eda78506b20b3a9b06234 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Thu, 28 Jan 2021 16:04:07 +0100 Subject: [PATCH] setup.py: read version from ocrd-tool.json --- README-DEV.md | 3 +-- setup.py | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README-DEV.md b/README-DEV.md index 40a237a..e490f49 100644 --- a/README-DEV.md +++ b/README-DEV.md @@ -10,8 +10,7 @@ make test Releasing --------- -* Update `ocrd-tool.json` version -* Update `setup.py` version +* Update `ocrd-tool.json` version (the `setup.py` version is read from this) * `git commit -m 'v'` * `git tag -m 'v' 'v'` * `git push --tags` diff --git a/setup.py b/setup.py index 2a98d62..db1926d 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,15 @@ # -*- coding: utf-8 -*- from pathlib import Path +import json from setuptools import setup, find_packages +with open('./ocrd-tool.json', 'r') as f: + version = json.load(f)['version'] + setup( name='ocrd_calamari', - version='1.0.1', + version=version, description='Calamari bindings', long_description=Path('README.md').read_text(), long_description_content_type='text/markdown',