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
454b7a8b
Commit
454b7a8b
authored
Jan 31, 2017
by
Jim Fulton
Committed by
GitHub
Jan 31, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #327 from buildout/fix-326
Fixes #326
parents
7a1741fc
63cf3a6b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
25 deletions
+73
-25
CHANGES.rst
CHANGES.rst
+5
-1
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+27
-20
src/zc/buildout/repeatable.txt
src/zc/buildout/repeatable.txt
+2
-4
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+39
-0
No files found.
CHANGES.rst
View file @
454b7a8b
...
...
@@ -4,7 +4,11 @@ Change History
2.7.1
(
unreleased
)
==================
-
Nothing
changed
yet
.
-
Fixed
a
bug
introduced
in
2.6.0
:
zc
.
buildout
and
its
dependeoncies
were
reported
as
picked
even
when
their
versions
were
fixed
in
a
``
versions
``
section
.
Worse
,
when
the
``
update
-
versions
-
file
``
option
was
used
,
the
``
versions
``
section
was
updated
needlessly
on
every
run
.
2.7.0
(
2017
-
01
-
30
)
...
...
src/zc/buildout/easy_install.py
View file @
454b7a8b
...
...
@@ -188,7 +188,8 @@ class Installer:
newest
=
True
,
versions
=
None
,
use_dependency_links
=
None
,
allow_hosts
=
(
'*'
,)
allow_hosts
=
(
'*'
,),
check_picked
=
True
,
):
assert
executable
==
sys
.
executable
,
(
executable
,
sys
.
executable
)
self
.
_dest
=
dest
...
...
@@ -218,6 +219,7 @@ class Installer:
self
.
_env
=
pkg_resources
.
Environment
(
path
)
self
.
_index
=
_get_index
(
index
,
links
,
self
.
_allow_hosts
)
self
.
_requirements_and_constraints
=
[]
self
.
_check_picked
=
check_picked
if
versions
is
not
None
:
self
.
_versions
=
normalize_versions
(
versions
)
...
...
@@ -558,8 +560,9 @@ class Installer:
self
.
_links
,
self
.
_allow_hosts
)
for
dist
in
dists
:
if
self
.
_check_picked
:
# Check whether we picked a version and, if we did, report it:
for
dist
in
dists
:
if
not
(
dist
.
precedence
==
pkg_resources
.
DEVELOP_DIST
or
...
...
@@ -573,7 +576,8 @@ class Installer:
if
not
self
.
_allow_picked_versions
:
raise
zc
.
buildout
.
UserError
(
'Picked: %s = %s'
%
(
dist
.
project_name
,
dist
.
version
)
'Picked: %s = %s'
%
(
dist
.
project_name
,
dist
.
version
)
)
return
dists
...
...
@@ -875,6 +879,7 @@ def install(specs, dest,
use_dependency_links
=
None
,
allow_hosts
=
(
'*'
,),
include_site_packages
=
None
,
allowed_eggs_from_site_packages
=
None
,
check_picked
=
True
,
):
assert
executable
==
sys
.
executable
,
(
executable
,
sys
.
executable
)
assert
include_site_packages
is
None
...
...
@@ -883,14 +888,16 @@ def install(specs, dest,
installer
=
Installer
(
dest
,
links
,
index
,
sys
.
executable
,
always_unzip
,
path
,
newest
,
versions
,
use_dependency_links
,
allow_hosts
=
allow_hosts
)
allow_hosts
=
allow_hosts
,
check_picked
=
check_picked
)
return
installer
.
install
(
specs
,
working_set
)
buildout_and_setuptools_dists
=
list
(
install
([
'zc.buildout'
],
None
))
buildout_and_setuptools_dists
=
list
(
install
([
'zc.buildout'
],
None
,
check_picked
=
False
))
buildout_and_setuptools_path
=
[
d
.
location
for
d
in
buildout_and_setuptools_dists
]
setuptools_path
=
[
d
.
location
for
d
in
install
([
'setuptools'
],
None
)]
for
d
in
install
([
'setuptools'
],
None
,
check_picked
=
False
)]
setuptools_pythonpath
=
os
.
pathsep
.
join
(
setuptools_path
)
def
build
(
spec
,
dest
,
build_ext
,
...
...
src/zc/buildout/repeatable.txt
View file @
454b7a8b
...
...
@@ -420,10 +420,8 @@ The versions file now contains the extra pin:
And re-running buildout doesn't report any picked versions anymore:
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Updating foo.
recipe v2
...
>>> 'picked' in system(buildout)
False
If you've enabled ``update-versions-file`` but not ``show-picked-versions``,
buildout will append the versions to your versions file anyway (without
...
...
src/zc/buildout/tests.py
View file @
454b7a8b
...
...
@@ -3062,6 +3062,45 @@ def test_abi_tag_eggs():
...
"""
def
test_buildout_doesnt_keep_adding_itself_to_versions
():
r"""
We were constantly writing to versions.cfg for buildout and setuptools
>>> write('buildout.cfg',
... '''
... [buildout]
... parts =
... extends = versions.cfg
... show-picked-versions = true
... update-versions-file = versions.cfg
... extends = versions.cfg
... ''')
>>> write('versions.cfg',
... '''[versions]
... ''')
>>> _ = system(join('bin', 'buildout'))
>>> with open('versions.cfg') as f:
... versions = f.read()
>>> _ = system(join('bin', 'buildout'))
On the first run, some pins were added:
>>> cat('versions.cfg') # doctest: +ELLIPSIS
[versions]
<BLANKLINE>
# Added by buildout...
setuptools = 34.0.3
...
>>> _ = system(join('bin', 'buildout'))
>>> _ = system(join('bin', 'buildout'))
Subsequent runs didn't add additional text:
>>> with open('versions.cfg') as f:
... versions == f.read()
True
"""
if
sys
.
platform
==
'win32'
:
del
buildout_honors_umask
# umask on dohs is academic
...
...
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