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
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
54d2f48d
Commit
54d2f48d
authored
Mar 02, 2022
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: test does not run on 2.7 and not very readable
Solution: rewrite in easy_install
parent
f1ecdf62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
20 deletions
+32
-20
doc/getting-started.rst
doc/getting-started.rst
+0
-20
src/zc/buildout/tests/easy_install.txt
src/zc/buildout/tests/easy_install.txt
+32
-0
No files found.
doc/getting-started.rst
View file @
54d2f48d
...
...
@@ -452,26 +452,6 @@ to restrict some requirements to i.e. a certain platform or python version:
.. -> src
>>> prefix = """
... [buildout]
... parts = bobo
... """
>>> with open('
buildout
.
cfg
', '
w
') as f:
... _ = f.write(prefix)
... _ = f.write(src)
>>> import shutil
>>> import sys
>>> v = sys.version_info
>>> shutil.rmtree('
eggs
')
>>> run_buildout('
buildout
show
-
picked
-
versions
=
true
')
>>> yup([n for n in ls('
eggs
') if n.startswith('
bobo
-
2.3.0
-
')])\
... if v.major >= 3 else\
... yup([n for n in ls('
eggs
') if n.startswith('
bobo
-
2.2.0
-
')])
>>> yup('
bobo
==
2.3.0
' in read('
out
'))\
... if v.major >= 3 else\
... yup('
bobo
==
2.2.0
' in read('
out
'))
The more common way to pin a version is using a ``versions`` section:
.. code-block:: ini
...
...
src/zc/buildout/tests/easy_install.txt
View file @
54d2f48d
...
...
@@ -1524,3 +1524,35 @@ This time, we didn't download from or even query the link server.
>>> zc.buildout.easy_install.install_from_cache(False)
True
Environment markers
-------------------
Specifications can include PEP 496 environment markers.
>>> _ = get(link_server + 'disable_server_logging')
>>> spec = ["demo ==0.1; python_version < '3.9'",
... "demo == 0.2; python_version >= '3.9'"]
>>> ws = zc.buildout.easy_install.install(
... spec, dest, links=[link_server], index=link_server+'index/')
>>> demo_version = None
>>> for egg in ws:
... if egg.project_name == 'demo':
... demo_version = egg.version
>>> demo_version is not None
True
>>> awaited = ('0.1'
... if (sys.version_info.major <= 3
... and sys.version_info.minor < 9)
... else '0.2')
>>> demo_version == awaited
True
Conflicts properly with version spec.
>>> ws = zc.buildout.easy_install.install(
... spec, dest, links=[link_server], index=link_server+'index/',
... versions = dict(demo='0.3'))
Traceback (most recent call last):
...
zc.buildout.easy_install.IncompatibleConstraintError: The requirement ('demo==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