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
e0d05d46
Commit
e0d05d46
authored
Jan 02, 2015
by
Donald Stufft
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade packaging lib to 15.0
parent
41f2c5ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
12 deletions
+75
-12
pkg_resources/_vendor/packaging/__about__.py
pkg_resources/_vendor/packaging/__about__.py
+1
-1
pkg_resources/_vendor/packaging/specifiers.py
pkg_resources/_vendor/packaging/specifiers.py
+48
-10
pkg_resources/_vendor/packaging/version.py
pkg_resources/_vendor/packaging/version.py
+25
-0
pkg_resources/_vendor/vendored.txt
pkg_resources/_vendor/vendored.txt
+1
-1
No files found.
pkg_resources/_vendor/packaging/__about__.py
View file @
e0d05d46
...
...
@@ -22,7 +22,7 @@ __title__ = "packaging"
__summary__
=
"Core utilities for Python packages"
__uri__
=
"https://github.com/pypa/packaging"
__version__
=
"1
4.5
"
__version__
=
"1
5.0
"
__author__
=
"Donald Stufft"
__email__
=
"donald@stufft.io"
...
...
pkg_resources/_vendor/packaging/specifiers.py
View file @
e0d05d46
...
...
@@ -458,21 +458,59 @@ class Specifier(_IndividualSpecifier):
@
_require_version_compare
def
_compare_less_than
(
self
,
prospective
,
spec
):
# Less than are defined as exclusive operators, this implies that
# pre-releases do not match for the same series as the spec. This is
# implemented by making <V imply !=V.*.
# Convert our spec to a Version instance, since we'll want to work with
# it as a version.
spec
=
Version
(
spec
)
return
(
prospective
<
spec
and
self
.
_get_operator
(
"!="
)(
prospective
,
str
(
spec
)
+
".*"
))
# Check to see if the prospective version is less than the spec
# version. If it's not we can short circuit and just return False now
# instead of doing extra unneeded work.
if
not
prospective
<
spec
:
return
False
# This special case is here so that, unless the specifier itself
# includes is a pre-release version, that we do not accept pre-release
# versions for the version mentioned in the specifier (e.g. <3.1 should
# not match 3.1.dev0, but should match 3.0.dev0).
if
not
spec
.
is_prerelease
and
prospective
.
is_prerelease
:
if
Version
(
prospective
.
base_version
)
==
Version
(
spec
.
base_version
):
return
False
# If we've gotten to here, it means that prospective version is both
# less than the spec version *and* it's not a pre-release of the same
# version in the spec.
return
True
@
_require_version_compare
def
_compare_greater_than
(
self
,
prospective
,
spec
):
# Greater than are defined as exclusive operators, this implies that
# pre-releases do not match for the same series as the spec. This is
# implemented by making >V imply !=V.*.
# Convert our spec to a Version instance, since we'll want to work with
# it as a version.
spec
=
Version
(
spec
)
return
(
prospective
>
spec
and
self
.
_get_operator
(
"!="
)(
prospective
,
str
(
spec
)
+
".*"
))
# Check to see if the prospective version is greater than the spec
# version. If it's not we can short circuit and just return False now
# instead of doing extra unneeded work.
if
not
prospective
>
spec
:
return
False
# This special case is here so that, unless the specifier itself
# includes is a post-release version, that we do not accept
# post-release versions for the version mentioned in the specifier
# (e.g. >3.1 should not match 3.0.post0, but should match 3.2.post0).
if
not
spec
.
is_postrelease
and
prospective
.
is_postrelease
:
if
Version
(
prospective
.
base_version
)
==
Version
(
spec
.
base_version
):
return
False
# Ensure that we do not allow a local version of the version mentioned
# in the specifier, which is techincally greater than, to match.
if
prospective
.
local
is
not
None
:
if
Version
(
prospective
.
base_version
)
==
Version
(
spec
.
base_version
):
return
False
# If we've gotten to here, it means that prospective version is both
# greater than the spec version *and* it's not a pre-release of the
# same version in the spec.
return
True
def
_compare_arbitrary
(
self
,
prospective
,
spec
):
return
str
(
prospective
).
lower
()
==
str
(
spec
).
lower
()
...
...
pkg_resources/_vendor/packaging/version.py
View file @
e0d05d46
...
...
@@ -95,6 +95,10 @@ class LegacyVersion(_BaseVersion):
def
public
(
self
):
return
self
.
_version
@
property
def
base_version
(
self
):
return
self
.
_version
@
property
def
local
(
self
):
return
None
...
...
@@ -103,6 +107,10 @@ class LegacyVersion(_BaseVersion):
def
is_prerelease
(
self
):
return
False
@
property
def
is_postrelease
(
self
):
return
False
_legacy_version_component_re
=
re
.
compile
(
r"(\
d+ | [
a-z]+ | \
.| -)
", re.VERBOSE,
...
...
@@ -269,6 +277,19 @@ class Version(_BaseVersion):
def public(self):
return str(self).split("
+
", 1)[0]
@property
def base_version(self):
parts = []
# Epoch
if self._version.epoch != 0:
parts.append("
{
0
}
!
".format(self._version.epoch))
# Release segment
parts.append("
.
".join(str(x) for x in self._version.release))
return "".join(parts)
@property
def local(self):
version_string = str(self)
...
...
@@ -279,6 +300,10 @@ class Version(_BaseVersion):
def is_prerelease(self):
return bool(self._version.dev or self._version.pre)
@property
def is_postrelease(self):
return bool(self._version.post)
def _parse_letter_version(letter, number):
if letter:
...
...
pkg_resources/_vendor/vendored.txt
View file @
e0d05d46
packaging==1
4.5
packaging==1
5.0
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