mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
7c63cb5231
commit
54911fff39
3 changed files with 26 additions and 3 deletions
20
setup.py
20
setup.py
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue