This commit is contained in:
Ask Solem 2016-07-01 14:20:43 -07:00
Родитель e9f1861b90
Коммит b99be09391
5 изменённых файлов: 49 добавлений и 21 удалений

14
.bumpversion.cfg Normal file
Просмотреть файл

@ -0,0 +1,14 @@
[bumpversion]
current_version = 4.0.0rc2
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<releaselevel>[a-z]+)?
serialize =
{major}.{minor}.{patch}{releaselevel}
{major}.{minor}.{patch}
[bumpversion:file:celery/__init__.py]
[bumpversion:file:docs/includes/introduction.txt]
[bumpversion:file:README.rst]

Просмотреть файл

@ -1,4 +1,5 @@
PROJ=celery
PGPIDENT="Celery Security Team"
PYTHON=python
GIT=git
TOX=tox
@ -43,11 +44,27 @@ help:
@echo " clean-pyc - Remove .pyc/__pycache__ files"
@echo " clean-docs - Remove documentation build artifacts."
@echo " clean-build - Remove setup artifacts."
@echo "bump - Bump patch version number."
@echo "bump-minor - Bump minor version number."
@echo "bump-major - Bump major version number."
@echo "release - Make PyPI release."
clean: clean-docs clean-pyc clean-build
clean-dist: clean clean-git-force
bump:
bumpversion patch
bump-minor:
bumpversion minor
bump-major:
bumpversion major
release:
python setup.py register sdist bdist_wheel upload --sign --identity="$(PGPIDENT)"
Documentation:
(cd "$(SPHINX_DIR)"; $(MAKE) html)
mv "$(SPHINX_HTMLDIR)" $(DOCUMENTATION)

Просмотреть файл

@ -9,18 +9,14 @@
from __future__ import absolute_import, print_function, unicode_literals
import os
import re
import sys
from collections import namedtuple
version_info_t = namedtuple(
'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'),
)
SERIES = '0today8'
VERSION = version_info = version_info_t(4, 0, 0, 'rc2', '')
__version__ = '{0.major}.{0.minor}.{0.micro}{0.releaselevel}'.format(VERSION)
__version__ = '4.0.0rc2'
__author__ = 'Ask Solem'
__contact__ = 'ask@celeryproject.org'
__homepage__ = 'http://celeryproject.org'
@ -37,6 +33,18 @@ __all__ = [
VERSION_BANNER = '{0} ({1})'.format(__version__, SERIES)
version_info_t = namedtuple(
'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'),
)
# bumpversion can only search for {current_version}
# so we have to parse the version here.
_temp = re.match(
r'(\d+)\.(\d+).(\d+)(.+)?', __version__).groups()
VERSION = version_info = version_info_t(
int(_temp[0]), int(_temp[1]), int(_temp[2]), _temp[3] or '', '')
del(_temp)
del(re)
if os.environ.get('C_IMPDEBUG'): # pragma: no cover
from .five import builtins

Просмотреть файл

@ -5,3 +5,4 @@ flakeplus>=1.1
tox>=2.3.1
sphinx2rst>=1.0
cyanide>=1.0.1
bumpversion

Просмотреть файл

@ -106,30 +106,18 @@ classifiers = [s.strip() for s in classes.split('\n') if s]
# -*- Distribution Meta -*-
re_meta = re.compile(r'__(\w+?)__\s*=\s*(.*)')
re_vers = re.compile(r'VERSION\s*=.*?\((.*?)\)')
re_doc = re.compile(r'^"""(.+?)"""')
def rq(s):
return s.strip("\"'")
def add_default(m):
attr_name, attr_value = m.groups()
return ((attr_name, rq(attr_value)),)
def add_version(m):
v = list(map(rq, m.groups()[0].split(', ')))
return (('VERSION', '.'.join(v[0:3]) + ''.join(v[3:])),)
return ((attr_name, attr_value.strip("\"'")),)
def add_doc(m):
return (('doc', m.groups()[0]),)
pats = {re_meta: add_default,
re_vers: add_version,
re_doc: add_doc}
pats = {re_meta: add_default, re_doc: add_doc}
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'celery/__init__.py')) as meta_fh:
meta = {}
@ -203,7 +191,7 @@ extra['extras_require'] = extras_require
setup(
name=NAME,
version=meta['VERSION'],
version=meta['version'],
description=meta['doc'],
author=meta['author'],
author_email=meta['contact'],