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
Rafael Monnerat
slapos.buildout
Commits
f548437e
Commit
f548437e
authored
Sep 02, 2009
by
Reinout van Rees
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trying to get scripts working. Not working yet...
parent
84ac008c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+1
-0
src/zc/buildout/easy_install.txt
src/zc/buildout/easy_install.txt
+26
-0
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+3
-0
No files found.
src/zc/buildout/easy_install.py
View file @
f548437e
...
...
@@ -927,6 +927,7 @@ def scripts(reqs, working_set, executable, dest,
initialization
=
'
\
n
'
+
initialization
+
'
\
n
'
entry_points
=
[]
distutils_scripts
=
[]
for
req
in
reqs
:
if
isinstance
(
req
,
str
):
req
=
pkg_resources
.
Requirement
.
parse
(
req
)
...
...
src/zc/buildout/easy_install.txt
View file @
f548437e
...
...
@@ -912,6 +912,32 @@ We specified an interpreter and its paths are adjusted too:
__import__("code").interact(banner="", local=globals())
Installing distutils-style scripts
----------------------------------
Most python libraries use the console_scripts entry point nowadays. But
several still have a ``scripts=['bin/something']`` in their setup() call.
Buildout also installs those:
>>> distdir = tmpdir('distutilsscriptdir')
>>> distbin = tmpdir('distutilsscriptbin')
>>> ws = zc.buildout.easy_install.install(
... ['other'], distdir,
... links=[link_server], index=link_server+'index/')
>>> scripts = zc.buildout.easy_install.scripts(
... ['other'], ws, sys.executable, distbin)
>>> ls(distbin)
- distutilsscript
Distutils copies the specified script files verbatim, apart from a line at the
top that looks like ``#!/usr/bin/python``, which gets replaced by the actual
python interpreter. Buildout does the same, but additionally also adds the
sys.path like for the console_scripts:
>>> cat(distbin, 'distutilsscript')
TODO
Handling custom build options for extensions provided in source distributions
-----------------------------------------------------------------------------
...
...
src/zc/buildout/tests.py
View file @
f548437e
...
...
@@ -2675,14 +2675,17 @@ def create_sample_eggs(test, executable=sys.executable):
)
zc
.
buildout
.
testing
.
sdist
(
tmp
,
dest
)
write
(
tmp
,
'distutilsscript'
,
'#!/usr/bin/python
\
n
print "distutils!"'
)
write
(
tmp
,
'setup.py'
,
"from setuptools import setup
\
n
"
"setup(name='other', zip_safe=False, version='1.0', "
"scripts=['distutilsscript'],"
"py_modules=['eggrecipedemoneeded'])
\
n
"
)
zc
.
buildout
.
testing
.
bdist_egg
(
tmp
,
executable
,
dest
)
os
.
remove
(
os
.
path
.
join
(
tmp
,
'distutilsscript'
))
os
.
remove
(
os
.
path
.
join
(
tmp
,
'eggrecipedemoneeded.py'
))
for
i
in
(
1
,
2
,
3
,
4
):
...
...
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