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
20ac4827
Commit
20ac4827
authored
Dec 18, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20 from dstufft/dont-warn-empty
Don't warn on empty non PEP 440 versions
parents
4bf1bfad
6d98caab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
pkg_resources.py
pkg_resources.py
+17
-9
No files found.
pkg_resources.py
View file @
20ac4827
...
@@ -2415,15 +2415,23 @@ class Distribution(object):
...
@@ -2415,15 +2415,23 @@ class Distribution(object):
self
.
_parsed_version
=
parse_version
(
self
.
version
)
self
.
_parsed_version
=
parse_version
(
self
.
version
)
if
isinstance
(
if
isinstance
(
self
.
_parsed_version
,
packaging
.
version
.
LegacyVersion
):
self
.
_parsed_version
,
packaging
.
version
.
LegacyVersion
):
warnings
.
warn
(
# While an empty version is techincally a legacy version and
"'%s (%s)' is being parsed as a legacy, non PEP 440, "
# is not a valid PEP 440 version, it's also unlikely to
"version. You may find odd behavior and sort order. In "
# actually come from someone and instead it is more likely that
"particular it will be sorted as less than 0.0. It is "
# it comes from setuptools attempting to parse a filename and
"recommend to migrate to PEP 440 compatible versions."
%
(
# including it in the list. So for that we'll gate this warning
self
.
project_name
,
self
.
version
,
# on if the version is anything at all or not.
),
if
self
.
version
:
RuntimeWarning
,
warnings
.
warn
(
)
"'%s (%s)' is being parsed as a legacy, non PEP 440, "
"version. You may find odd behavior and sort order. "
"In particular it will be sorted as less than 0.0. It "
"is recommend to migrate to PEP 440 compatible "
"versions."
%
(
self
.
project_name
,
self
.
version
,
),
RuntimeWarning
,
)
return
self
.
_parsed_version
return
self
.
_parsed_version
...
...
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