Consolidate version strings in pyproject.toml

Storing the current version in a single place greatly simplifies
issuing new package releases.
This commit is contained in:
Justin Mayer 2019-07-03 23:31:38 +02:00
commit 54911fff39
3 changed files with 26 additions and 3 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python
import re
import sys
from io import open
from os import walk
@ -6,6 +7,23 @@ from os.path import join, relpath
from setuptools import setup
def get_version():
VERSION_REGEX = re.compile(
r"^version\s*=\s*\"(?P<version>.*)\"$"
)
with open("pyproject.toml") as f:
for line in f:
match = VERSION_REGEX.match(line)
if match:
return match.group("version")
return None
version = get_version()
requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils',
'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4',
'python-dateutil']
@ -28,7 +46,7 @@ if sys.version_info.major < 3:
setup(
name='pelican',
version='4.0.2.dev0',
version=version,
url='https://getpelican.com/',
author='Alexis Metaireau',
maintainer='Justin Mayer',