Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
0465490e
Commit
0465490e
authored
May 24, 2013
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated get_next_version to bump arbitrary versions and added doctests.
parent
f1427c0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
release.py
release.py
+25
-5
No files found.
release.py
View file @
0465490e
...
...
@@ -25,12 +25,32 @@ except Exception:
VERSION
=
'0.7b1'
PACKAGE_INDEX
=
'https://pypi.python.org/pypi'
def
get_next_version
():
digits
=
map
(
int
,
VERSION
.
split
(
'.'
))
digits
[
-
1
]
+=
1
return
'.'
.
join
(
map
(
str
,
digits
))
def
get_next_version
(
version
):
"""
Infer a next version from the current version by incrementing the last
number or appending a number.
>>> get_next_version('1.0')
'1.1'
>>> get_next_version('1.0b')
'1.0b1'
>>> get_next_version('1.0.9')
'1.0.10'
>>> get_next_version('1')
'2'
>>> get_next_version('')
'1'
"""
def
incr
(
match
):
ver
=
int
(
match
.
group
(
0
)
or
'0'
)
return
str
(
ver
+
1
)
return
re
.
sub
(
'
\
d*$
'
, incr, version)
NEXT_VERSION
=
get_next_version
()
NEXT_VERSION = get_next_version(
VERSION
)
files_with_versions = '
docs
/
conf
.
py
', '
setup
.
py
', '
release
.
py
', '
ez_setup
.
py
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment