Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
1b65fff8
Commit
1b65fff8
authored
Oct 14, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'utilupdate'
parents
9b1bccff
c0991f95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
22 deletions
+26
-22
util/makedist.py
util/makedist.py
+7
-12
util/set_version.py
util/set_version.py
+19
-10
No files found.
util/makedist.py
View file @
1b65fff8
...
...
@@ -55,15 +55,11 @@ def makedist(*args, **kwargs):
os
.
chdir
(
cwd
)
def
_makedist
(
version
=
'dev'
,
dest
=
None
):
def
_makedist
(
version
=
None
,
dest
=
None
):
assert
exists
(
'gevent/__init__.py'
),
'Where am I?'
basedir
=
abspath
(
os
.
getcwd
())
if
version
.
lower
()
==
'dev'
:
set_version_command
=
'util/set_version.py gevent/__init__.py'
else
:
set_version_command
=
'util/set_version.py --version %s gevent/__init__.py'
%
version
version
=
version
or
'dev'
set_version_command
=
'util/set_version.py --version %s ./gevent/__init__.py'
%
version
os
.
chdir
(
'/tmp'
)
system
(
'rm -fr '
+
TMPDIR
)
os
.
mkdir
(
TMPDIR
)
...
...
@@ -75,6 +71,7 @@ def _makedist(version='dev', dest=None):
assert
len
(
directory
)
==
1
,
directory
os
.
chdir
(
directory
[
0
])
system
(
'git branch'
)
system
(
set_version_command
)
system
(
'git diff'
,
noisy
=
False
)
system
(
'python setup.py -q sdist'
)
...
...
@@ -99,12 +96,10 @@ def _makedist(version='dev', dest=None):
def
main
():
parser
=
optparse
.
OptionParser
()
parser
.
add_option
(
'--dest'
)
parser
.
add_option
(
'--version'
)
options
,
args
=
parser
.
parse_args
()
if
len
(
args
)
!=
1
:
sys
.
exit
(
'Expected one argument: version (could be "dev").'
)
return
makedist
(
args
[
0
],
dest
=
options
.
dest
)
assert
not
args
,
'Expected no arguments'
return
makedist
(
options
.
version
,
dest
=
options
.
dest
)
def
copy
(
source
,
dest
):
...
...
util/set_version.py
View file @
1b65fff8
...
...
@@ -12,8 +12,8 @@ from optparse import OptionParser
from
distutils.version
import
LooseVersion
version_re
=
re
.
compile
(
"__version__
\
s*=
\
s*'([^']+)'"
,
re
.
M
)
version_info_re
=
re
.
compile
(
r"
version_info\
s*=
\s*([^\n]+)"
)
version_re
=
re
.
compile
(
"
^
__version__
\
s*=
\
s*'([^']+)'"
,
re
.
M
)
version_info_re
=
re
.
compile
(
r"
^version_info\
s*=
\s*([^\n]+)"
,
re
.
M
)
strict_version_re
=
re
.
compile
(
r'^(\
d+)
\. (\
d+) (
\. (\
d+))? ([
ab](\
d+))?$
', re.VERBOSE)
...
...
@@ -129,16 +129,25 @@ def write(filename, data):
def main():
global options
parser = OptionParser()
parser.add_option('
--
version
')
parser.add_option('
--
version
', default='
dev
')
parser.add_option('
--
dry
-
run
', action='
store_true
')
options, args = parser.parse_args()
if options.version:
if strict_version_re.match(options.version) is None:
sys.exit('
Not
a
strict
version
:
%
r
(
bdist_msi
will
fail
)
' % options.version)
assert len(args) == 1, args
assert len(args) == 1, '
One
argument
is
expected
,
got
%
s
' % len(args)
version = options.version
if version.lower() == '
dev
':
version = ''
if version and strict_version_re.match(version) is None:
sys.stderr.write('
WARNING
:
Not
a
strict
version
:
%
r
(
bdist_msi
will
fail
)
' % version)
filename = args[0]
original_content, new_content = modify_version(filename, options.version)
write(filename, new_content)
print '
Updated
%
s
' % filename
original_content, new_content = modify_version(filename, version)
if options.dry_run:
tmpname = '
/
tmp
/
' + os.path.basename(filename) + '
.
set_version
'
write(tmpname, new_content)
if not os.system('
diff
-
u
%
s
%
s
' % (filename, tmpname)):
sys.exit('
No
differences
applied
')
else:
write(filename, new_content)
print '
Updated
%
s
' % filename
if __name__ == '
__main__
':
...
...
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