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
351b5fec
Commit
351b5fec
authored
Sep 14, 2016
by
Jason R. Coombs
Committed by
GitHub
Sep 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #786 from s-t-e-v-e-n-k/no-parse-requirement-arg-duplication
Don't duplicate error case in package_index
parents
629ad3da
1f23f9a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
18 deletions
+13
-18
setuptools/command/easy_install.py
setuptools/command/easy_install.py
+3
-11
setuptools/package_index.py
setuptools/package_index.py
+10
-7
No files found.
setuptools/command/easy_install.py
View file @
351b5fec
...
...
@@ -49,8 +49,9 @@ from setuptools.sandbox import run_setup
from
setuptools.py31compat
import
get_path
,
get_config_vars
from
setuptools.command
import
setopt
from
setuptools.archive_util
import
unpack_archive
from
setuptools.package_index
import
PackageIndex
from
setuptools.package_index
import
URL_SCHEME
from
setuptools.package_index
import
(
PackageIndex
,
parse_requirement_arg
,
URL_SCHEME
,
)
from
setuptools.command
import
bdist_egg
,
egg_info
from
pkg_resources
import
(
yield_lines
,
normalize_path
,
resource_string
,
ensure_directory
,
...
...
@@ -1522,15 +1523,6 @@ def get_exe_prefixes(exe_filename):
return
prefixes
def
parse_requirement_arg
(
spec
):
try
:
return
Requirement
.
parse
(
spec
)
except
ValueError
:
raise
DistutilsError
(
"Not a URL, existing file, or requirement spec: %r"
%
(
spec
,)
)
class
PthDistributions
(
Environment
):
"""A .pth file with Distribution paths in it"""
...
...
setuptools/package_index.py
View file @
351b5fec
...
...
@@ -52,6 +52,15 @@ _tmpl = "setuptools/{setuptools.__version__} Python-urllib/{py_major}"
user_agent = _tmpl.format(py_major=sys.version[:3], **globals())
def parse_requirement_arg(spec):
try:
return Requirement.parse(spec)
except ValueError:
raise DistutilsError(
"Not a URL, existing file, or requirement spec: %r" % (spec,)
)
def parse_bdist_wininst(name):
"""Return (base,pyversion) or (None,None) for possible .exe name"""
...
...
@@ -561,13 +570,7 @@ class PackageIndex(Environment):
# Existing file or directory, just return it
return spec
else:
try:
spec = Requirement.parse(spec)
except ValueError:
raise DistutilsError(
"Not a URL, existing file, or requirement spec: %r" %
(spec,)
)
spec = parse_requirement_arg(spec)
return getattr(self.fetch_distribution(spec, tmpdir), 'location', None)
def fetch_distribution(
...
...
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