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
8ed00a70
Commit
8ed00a70
authored
Feb 12, 2017
by
Jason R. Coombs
Committed by
GitHub
Feb 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #968 from moriyoshi/moriyoshi/local-version-label-in-egg-fragment
A local version label starts with a '+' sign
parents
5470fb8f
f33cfac3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
CHANGES.rst
CHANGES.rst
+4
-0
setuptools/package_index.py
setuptools/package_index.py
+1
-1
setuptools/tests/test_packageindex.py
setuptools/tests/test_packageindex.py
+42
-0
No files found.
CHANGES.rst
View file @
8ed00a70
...
...
@@ -4,6 +4,10 @@ v34.2.0
*
#
966
:
Add
support
for
reading
dist
-
info
metadata
and
thus
locating
Distributions
from
zip
files
.
*
#
968
:
Allow
'+'
and
'!'
in
egg
fragments
so
that
it
can
take
package
names
that
contain
PEP
440
conforming
version
specifiers
.
v34
.1.1
-------
...
...
setuptools/package_index.py
View file @
8ed00a70
...
...
@@ -30,7 +30,7 @@ from fnmatch import translate
from
setuptools.py26compat
import
strip_fragment
from
setuptools.py27compat
import
get_all_headers
EGG_FRAGMENT
=
re
.
compile
(
r'^egg=([-A-Za-z0-9_.]+)$'
)
EGG_FRAGMENT
=
re
.
compile
(
r'^egg=([-A-Za-z0-9_.
+!
]+)$'
)
HREF
=
re
.
compile
(
"""href
\
\
s*=
\
\
s*['"]?([^'"> ]+)"""
,
re
.
I
)
# this is here to fix emacs' cruddy broken syntax highlighting
PYPI_MD5
=
re
.
compile
(
...
...
setuptools/tests/test_packageindex.py
View file @
8ed00a70
...
...
@@ -181,6 +181,48 @@ class TestPackageIndex:
res
=
setuptools
.
package_index
.
local_open
(
url
)
assert
'content'
in
res
.
read
()
def
test_egg_fragment
(
self
):
"""
EGG fragments must comply to PEP 440
"""
epoch
=
[
''
,
'1!'
,
]
releases
=
[
'0'
,
'0.0'
,
'0.0.0'
,
]
pre
=
[
'a0'
,
'b0'
,
'rc0'
,
]
post
=
[
'.post0'
]
dev
=
[
'.dev0'
,
]
local
=
[
(
''
,
''
),
(
'+ubuntu.0'
,
'+ubuntu.0'
),
(
'+ubuntu-0'
,
'+ubuntu.0'
),
(
'+ubuntu_0'
,
'+ubuntu.0'
),
]
versions
=
[
[
''
.
join
([
e
,
r
,
p
,
l
])
for
l
in
ll
]
for
e
in
epoch
for
r
in
releases
for
p
in
sum
([
pre
,
post
,
dev
],
[
''
])
for
ll
in
local
]
for
v
,
vc
in
versions
:
dists
=
list
(
setuptools
.
package_index
.
distros_for_url
(
'http://example.com/example.zip#egg=example-'
+
v
))
assert
dists
[
0
].
version
==
''
assert
dists
[
1
].
version
==
vc
class
TestContentCheckers
:
def
test_md5
(
self
):
...
...
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