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
f1a97118
Commit
f1a97118
authored
Apr 18, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass flags programmatically, avoiding deprecating trailing pattern flags syntax revealed in #1015.
parent
413d1e9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
setuptools/command/egg_info.py
setuptools/command/egg_info.py
+2
-1
setuptools/tests/test_manifest.py
setuptools/tests/test_manifest.py
+13
-13
No files found.
setuptools/command/egg_info.py
View file @
f1a97118
...
...
@@ -112,7 +112,8 @@ def translate_pattern(glob):
if
not
last_chunk
:
pat
+=
sep
return
re
.
compile
(
pat
+
r'\
Z(?ms)
')
pat
+=
r'\
Z
'
return re.compile(pat, flags=re.MULTILINE|re.DOTALL)
class egg_info(Command):
...
...
setuptools/tests/test_manifest.py
View file @
f1a97118
...
...
@@ -71,26 +71,26 @@ def get_pattern(glob):
def
test_translated_pattern_test
():
l
=
make_local_path
assert
get_pattern
(
'foo'
)
==
r'foo\
Z
(?ms)
'
assert get_pattern(l('
foo
/
bar
')) == l(r'
foo
\
/
bar
\
Z
(
?
ms
)
')
assert
get_pattern
(
'foo'
)
==
r'foo\
Z
'
assert get_pattern(l('
foo
/
bar
')) == l(r'
foo
\
/
bar
\
Z
')
# Glob matching
assert get_pattern('
*
.
txt
') == l(r'
[
^
\
/
]
*
\
.
txt
\
Z
(
?
ms
)
')
assert get_pattern('
dir
/*
.
txt
') == l(r'
dir
\
/
[
^
\
/
]
*
\
.
txt
\
Z
(
?
ms
)
')
assert get_pattern('
*/*
.
py
') == l(r'
[
^
\
/
]
*
\
/
[
^
\
/
]
*
\
.
py
\
Z
(
?
ms
)
')
assert get_pattern('
*
.
txt
') == l(r'
[
^
\
/
]
*
\
.
txt
\
Z
')
assert get_pattern('
dir
/*
.
txt
') == l(r'
dir
\
/
[
^
\
/
]
*
\
.
txt
\
Z
')
assert get_pattern('
*/*
.
py
') == l(r'
[
^
\
/
]
*
\
/
[
^
\
/
]
*
\
.
py
\
Z
')
assert get_pattern('
docs
/
page
-
?
.
txt
')
\
== l(r'
docs
\
/
page
\
-
[
^
\
/
]
\
.
txt
\
Z
(
?
ms
)
')
== l(r'
docs
\
/
page
\
-
[
^
\
/
]
\
.
txt
\
Z
')
# Globstars change what they mean depending upon where they are
assert get_pattern(l('
foo
/**/
bar
')) == l(r'
foo
\
/
(
?
:[
^
\
/
]
+
\
/
)
*
bar
\
Z
(
?
ms
)
')
assert get_pattern(l('
foo
/**
')) == l(r'
foo
\
/
.
*
\
Z
(
?
ms
)
')
assert get_pattern(l('
**
')) == r'
.
*
\
Z
(
?
ms
)
'
assert get_pattern(l('
foo
/**/
bar
')) == l(r'
foo
\
/
(
?
:[
^
\
/
]
+
\
/
)
*
bar
\
Z
')
assert get_pattern(l('
foo
/**
')) == l(r'
foo
\
/
.
*
\
Z
')
assert get_pattern(l('
**
')) == r'
.
*
\
Z
'
# Character classes
assert get_pattern('
pre
[
one
]
post
') == r'
pre
[
one
]
post
\
Z
(
?
ms
)
'
assert get_pattern('
hello
[
!
one
]
world
') == r'
hello
[
^
one
]
world
\
Z
(
?
ms
)
'
assert get_pattern('
[]
one
].
txt
') == r'
[
\
]
one
]
\
.
txt
\
Z
(
?
ms
)
'
assert get_pattern('
foo
[
!
]
one
]
bar
') == r'
foo
[
^
\
]
one
]
bar
\
Z
(
?
ms
)
'
assert get_pattern('
pre
[
one
]
post
') == r'
pre
[
one
]
post
\
Z
'
assert get_pattern('
hello
[
!
one
]
world
') == r'
hello
[
^
one
]
world
\
Z
'
assert get_pattern('
[]
one
].
txt
') == r'
[
\
]
one
]
\
.
txt
\
Z
'
assert get_pattern('
foo
[
!
]
one
]
bar
') == r'
foo
[
^
\
]
one
]
bar
\
Z
'
class TempDirTestCase(object):
...
...
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