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
279d1bc0
Commit
279d1bc0
authored
Apr 22, 2020
by
Jason Madden
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'combine-tests'
parents
61432c16
75c11563
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
6 deletions
+96
-6
setup.cfg
setup.cfg
+2
-0
src/gevent/_util.py
src/gevent/_util.py
+71
-0
src/gevent/testing/modules.py
src/gevent/testing/modules.py
+23
-6
No files found.
setup.cfg
View file @
279d1bc0
...
...
@@ -4,6 +4,8 @@ universal = 0
[zest.releaser]
python-file-with-version = src/gevent/__init__.py
create-wheel = no
prereleaser.middle =
gevent._util.prereleaser_middle
[metadata]
long_description_content_type = text/x-rst
...
...
src/gevent/_util.py
View file @
279d1bc0
...
...
@@ -214,3 +214,74 @@ except ImportError:
Interface
=
Interface
implementer
=
implementer
Attribute
=
Attribute
def
prereleaser_middle
(
data
):
# pragma: no cover
"""
zest.releaser prerelease middle hook for gevent.
The prerelease step:
asks you for a version number
updates the setup.py or version.txt and the
CHANGES/HISTORY/CHANGELOG file (with either
this new version
number and offers to commit those changes to git
The middle hook:
All data dictionary items are available and some questions
(like new version number) have been asked.
No filesystem changes have been made yet.
It is our job to finish up the filesystem changes needed, including:
- Calling towncrier to handle CHANGES.rst
- Add the version number to ``versionadded``, ``versionchanged`` and
``deprecated`` directives in Python source.
"""
if
data
[
'name'
]
!=
'gevent'
:
# We are specified in ``setup.cfg``, not ``setup.py``, so we do not
# come into play for other projects, only this one. We shouldn't
# need this check, but there it is.
return
import
re
import
os
import
subprocess
from
gevent.testing
import
modules
new_version
=
data
[
'new_version'
]
# Generate CHANGES.rst, remove old news entries.
subprocess
.
check_call
([
'towncrier'
,
'build'
,
'--version'
,
data
[
'new_version'
],
'--yes'
])
# Put the version number in source files.
regex
=
re
.
compile
(
b'.. (versionchanged|versionadded|deprecated):: NEXT'
)
replacement
=
r'.. \1:: %s'
%
(
new_version
,)
for
path
,
_
in
modules
.
walk_modules
(
# Start here
basedir
=
os
.
path
.
join
(
data
[
'reporoot'
],
'src'
,
'gevent'
),
# Include sub-dirs
recursive
=
True
,
# Include tests
include_tests
=
True
,
# and other things usually excluded
excluded_modules
=
(),
# Don't return build binaries
include_so
=
False
,
# Don't try to import things; we want all files.
check_optional
=
False
,
):
with
open
(
path
,
'rb'
)
as
f
:
contents
=
f
.
read
()
new_contents
,
count
=
regex
.
subn
(
replacement
,
contents
)
if
count
:
print
(
"Replaced version NEXT in"
,
path
)
with
open
(
path
,
'wb'
)
as
f
:
f
.
write
(
new_contents
)
src/gevent/testing/modules.py
View file @
279d1bc0
...
...
@@ -43,6 +43,16 @@ OPTIONAL_MODULES = frozenset({
'gevent.libuv.watcher'
,
})
EXCLUDED_MODULES
=
frozenset
({
'__init__'
,
'core'
,
'ares'
,
'_util'
,
'_semaphore'
,
'corecffi'
,
'_corecffi'
,
'_corecffi_build'
,
})
def
walk_modules
(
basedir
=
None
,
...
...
@@ -50,7 +60,9 @@ def walk_modules(
include_so
=
False
,
recursive
=
False
,
check_optional
=
True
,
include_tests
=
False
,
optional_modules
=
OPTIONAL_MODULES
,
excluded_modules
=
EXCLUDED_MODULES
,
):
"""
Find gevent modules, yielding tuples of ``(path, importable_module_name)``.
...
...
@@ -78,14 +90,20 @@ def walk_modules(
if
os
.
path
.
isdir
(
path
):
if
not
recursive
:
continue
if
fn
in
[
'testing'
,
'tests'
]:
if
not
include_tests
and
fn
in
[
'testing'
,
'tests'
]:
continue
pkg_init
=
os
.
path
.
join
(
path
,
'__init__.py'
)
if
os
.
path
.
exists
(
pkg_init
):
yield
pkg_init
,
modpath
+
fn
for
p
,
m
in
walk_modules
(
path
,
modpath
+
fn
+
"."
,
check_optional
=
check_optional
,
optional_modules
=
optional_modules
):
for
p
,
m
in
walk_modules
(
path
,
modpath
+
fn
+
"."
,
include_so
=
include_so
,
recursive
=
recursive
,
check_optional
=
check_optional
,
include_tests
=
include_tests
,
optional_modules
=
optional_modules
,
excluded_modules
=
excluded_modules
,
):
yield
p
,
m
continue
...
...
@@ -93,8 +111,7 @@ def walk_modules(
x
=
fn
[:
-
3
]
if
x
.
endswith
(
'_d'
):
x
=
x
[:
-
2
]
if
x
in
[
'__init__'
,
'core'
,
'ares'
,
'_util'
,
'_semaphore'
,
'corecffi'
,
'_corecffi'
,
'_corecffi_build'
]:
if
x
in
excluded_modules
:
continue
modname
=
modpath
+
x
if
check_optional
and
modname
in
optional_modules
:
...
...
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