Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.buildout
Commits
20de9219
Commit
20de9219
authored
May 08, 2020
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make install of unpinned setuptools much quicker
by patching `pkg_resources.Distribution`.
parent
2aeca592
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
2 deletions
+63
-2
CHANGES.rst
CHANGES.rst
+2
-1
src/zc/buildout/__init__.py
src/zc/buildout/__init__.py
+3
-1
src/zc/buildout/patches.py
src/zc/buildout/patches.py
+58
-0
No files found.
CHANGES.rst
View file @
20de9219
...
...
@@ -4,7 +4,8 @@ Change History
2.13.4
(
unreleased
)
===================
-
Nothing
changed
yet
.
-
Patch
``
pkg_resources
.
Distribution
``
to
make
install
of
unpinned
versions
quicker
.
Most
obvious
with
``
setuptools
``.
2.13.3
(
2020
-
02
-
11
)
...
...
src/zc/buildout/__init__.py
View file @
20de9219
...
...
@@ -13,9 +13,11 @@
##############################################################################
"""Buildout package
"""
import
zc.buildout.patches
# NOQA
class
UserError
(
Exception
):
"""Errors made by a user
"""Errors made by a user
"""
def
__str__
(
self
):
...
...
src/zc/buildout/patches.py
0 → 100644
View file @
20de9219
##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
def
patch_Distribution
():
try
:
from
pkg_resources
import
_remove_md5_fragment
from
pkg_resources
import
Distribution
if
hasattr
(
Distribution
,
'location'
):
return
# prepare any Distribution built before monkeypatch
from
pkg_resources
import
working_set
for
dist
in
working_set
:
dist
.
_location
=
dist
.
location
dist
.
_location_without_md5
=
_remove_md5_fragment
(
dist
.
location
)
def
hashcmp
(
self
):
without_md5
=
getattr
(
self
,
'_location_without_md5'
,
''
)
return
(
self
.
parsed_version
,
self
.
precedence
,
self
.
key
,
without_md5
,
self
.
py_version
or
''
,
self
.
platform
or
''
,
)
def
get_location
(
self
):
try
:
result
=
self
.
_location
except
AttributeError
:
result
=
''
return
result
def
set_location
(
self
,
l
):
self
.
_location
=
l
self
.
_location_without_md5
=
_remove_md5_fragment
(
l
)
setattr
(
Distribution
,
'location'
,
property
(
get_location
,
set_location
))
setattr
(
Distribution
,
'hashcmp'
,
property
(
hashcmp
))
except
ImportError
:
return
patch_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