Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Xavier Thompson
slapos
Commits
68d338fe
Commit
68d338fe
authored
Nov 17, 2022
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Use PYTHONPATH
parent
1de997e2
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
295 deletions
+73
-295
component/macros/macro.pythonpath.eggs.cfg
component/macros/macro.pythonpath.eggs.cfg
+24
-0
component/macros/macro.sub.buildout.cfg
component/macros/macro.sub.buildout.cfg
+0
-77
component/numpy/basic-numpy.cfg
component/numpy/basic-numpy.cfg
+0
-14
component/numpy/buildout.cfg
component/numpy/buildout.cfg
+17
-56
component/numpy/openblas-numpy.cfg
component/numpy/openblas-numpy.cfg
+0
-14
component/numpy/openblas.cfg
component/numpy/openblas.cfg
+12
-69
component/scipy/buildout.cfg
component/scipy/buildout.cfg
+17
-44
component/scipy/scipy.cfg
component/scipy/scipy.cfg
+0
-21
software/jupyter/software.cfg
software/jupyter/software.cfg
+3
-0
No files found.
component/macros/macro.pythonpath.eggs.cfg
0 → 100644
View file @
68d338fe
[buildout]
parts =
[macro.pythonpath.eggs]
recipe = slapos.recipe.build
_name_ = ${:_buildout_section_name_}
init =
prerequisite = """
[.%(_name_)s.prerequisite]
recipe = slapos.recipe.build
init =
section = self.buildout['%(_name_)s']
self.eggs = [e.strip() for e in section['eggs'].splitlines() if e.strip()]
update =
from zc.buildout.easy_install import working_set
buildout = self.buildout['buildout']
eggs_directory = buildout['eggs-directory']
develop_eggs_directory = buildout['develop-eggs-directory']
dists = working_set(self.eggs, [develop_eggs_directory, eggs_directory])
paths = ':'.join(dist.location for dist in dists)
self.buildout['%(environment)s']['PYTHONPATH'] = paths
print("PYTHONPATH=" + paths)
""" % options
self.buildout.parse(prerequisite)
component/macros/macro.sub.buildout.cfg
deleted
100644 → 0
View file @
1de997e2
[buildout]
parts =
[macro.sub.buildout]
recipe = slapos.recipe.build
install =
import os
from zc.buildout.buildout import _isurl, urljoin
from slapos.rebootstrap.bootstrap import setup_script
base = options['_profile_base_location_']
if _isurl(base):
abspath = lambda path: urljoin(base + '/', path)
else:
abspath = lambda path: os.path.realpath(os.path.join(base, path))
keep_options = (
'eggs-directory'
'develop-eggs-directory',
'bin-directory',
'parts-directory',
'extends-cache',
'extensions',
'download-cache',
'newest',
'shared-part-list',
)
buildout = {}
buildout_section = self.buildout['buildout']
for option in keep_options:
try:
value = options.get.get(option, buildout_section[option])
buildout[option] = '\n ' + value.replace('\n', '\n ')
except KeyError:
pass
extends = '\n '.join(
abspath(path.strip())
for path in options.get('extends', '').splitlines()
if path.strip()
)
parts = options['parts'].replace('\n', '\n ')
versions = self.buildout.get(buildout_section['versions'])
buildout['versions'] = 'versions'
os.mkdir(location)
with open(os.path.join(location, 'buildout.cfg'), 'w') as buildout_conf:
buildout_conf.write(
options['template'] % {
'buildout': '\n'.join('%s = %s' % item for item in buildout.items()),
'extends': extends,
'contents': options.get('contents', ''),
'parts': options['parts'],
'versions': '\n'.join('%s = %s' % item for item in versions.items()),
}
)
buildout = os.path.join(location, 'bin', 'buildout')
os.mkdir(os.path.dirname(buildout))
setup_script(buildout, options['python'])
call((buildout, '-U'), cwd=location)
template =
[buildout]
%(buildout)s
extends =
%(extends)s
parts =
%(parts)s
extensions -= slapos.rebootstrap
%(contents)s
[versions]
%(versions)s
component/numpy/basic-numpy.cfg
deleted
100644 → 0
View file @
1de997e2
[buildout]
parts = numpy
[numpy-env]
BLAS=None
LAPACK=None
ATLAS=None
[numpy]
recipe = zc.recipe.egg:custom
egg = numpy
[versions]
numpy = 1.16.4
component/numpy/buildout.cfg
View file @
68d338fe
[buildout]
extends =
basic-numpy.cfg
../cython/buildout.cfg
../
pygolang/buildout
.cfg
../
macros/macro.pythonpath.eggs
.cfg
parts = numpy
[python_for_numpy_build:sys.version_info >= (3,8)]
<= python-interpreter
interpreter = ${:_buildout_section_name_}
eggs =
${pygolang:egg}
${cython:egg}
executable = ${buildout:bin-directory}/${:interpreter}
[numpy-env]
BLAS=None
LAPACK=None
ATLAS=None
[numpy:sys.version_info >= (3,8)]
recipe = slapos.recipe.build
python = ${cython-interpreter:executable}
base = ${:_profile_base_location_}
install =
import os
from zc.buildout.buildout import _isurl, urljoin
from slapos.rebootstrap.bootstrap import setup_script
base = options['base']
if _isurl(base):
extends = lambda path: urljoin(base + '/', path)
else:
extends = lambda path: os.path.realpath(os.path.join(base, path))
[numpy]
recipe = zc.recipe.egg:custom
egg = numpy
environment = numpy-env
buildout_extra = []
buildout_section = self.buildout['buildout']
for option_name in ('download-cache', 'newest', 'shared-part-list'):
option_value = buildout_section.get(option_name)
if option_value:
buildout_extra.append('%s = %s' % (option_name, option_value))
[versions]
numpy = 1.16.4
os.mkdir(location)
with open(os.path.join(location, 'buildout.cfg'), 'w') as buildout_conf:
buildout_conf.write(
options['template'] % {
'extends': '\n '.join(map(extends, (
'../../stack/slapos.cfg',
'basic-numpy.cfg',
))),
'buildout': '\n'.join(buildout_extra),
}
)
buildout = os.path.join(location, 'bin', 'buildout')
os.mkdir(os.path.dirname(buildout))
setup_script(buildout, options['python'])
call((buildout, '-U'), cwd=location)
template =
[buildout]
extends = %(extends)s
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
bin-directory = ${buildout:bin-directory}
extensions -= slapos.rebootstrap
%(buildout)s
parts = numpy
[numpy:sys.version_info >= (3,8)]
depends = ${numpy-pythonpath:recipe}
[versions]
numpy = ${versions:numpy}
[numpy-pythonpath]
<= macro.pythonpath.eggs
environment = numpy-env
eggs = ${cython:egg}
[versions:sys.version_info >= (3,8)]
numpy = 1.22.0
component/numpy/openblas-numpy.cfg
deleted
100644 → 0
View file @
1de997e2
[buildout]
extends =
basic-numpy.cfg
../openblas/buildout.cfg
[numpy-env]
OPENBLAS = ${openblas:location}/lib/libopenblas.so
LAPACK = ${openblas:location}/lib/libopenblas.so
ATLAS = ${openblas:location}/lib/libopenblas.so
[numpy]
environment = numpy-env
rpath =
${openblas:location}/lib
component/numpy/openblas.cfg
View file @
68d338fe
[buildout]
extends =
openblas-numpy.cfg
../cython/buildout.cfg
../pygolang/buildout.cfg
parts =
numpy
[python_for_numpy_build:sys.version_info >= (3,8)]
<= python-interpreter
interpreter = ${:_buildout_section_name_}
eggs =
${pygolang:egg}
${cython:egg}
executable = ${buildout:bin-directory}/${:interpreter}
[numpy:sys.version_info >= (3,8)]
recipe = slapos.recipe.build
python = ${python_for_numpy_build:executable}
base = ${:_profile_base_location_}
install =
import os
from zc.buildout.buildout import _isurl, urljoin
from slapos.rebootstrap.bootstrap import setup_script
base = options['base']
if _isurl(base):
extends = lambda path: urljoin(base + '/', path)
else:
extends = lambda path: os.path.realpath(os.path.join(base, path))
buildout_extra = []
buildout_section = self.buildout['buildout']
for option_name in ('download-cache', 'newest', 'shared-part-list'):
option_value = buildout_section.get(option_name)
if option_value:
buildout_extra.append('%s = %s' % (option_name, option_value))
os.mkdir(location)
with open(os.path.join(location, 'buildout.cfg'), 'w') as buildout_conf:
buildout_conf.write(
options['template'] % {
'extends': '\n '.join(map(extends, (
'../../stack/slapos.cfg',
'openblas-numpy.cfg',
))),
'buildout': '\n'.join(buildout_extra),
}
)
buildout = os.path.join(location, 'bin', 'buildout')
os.mkdir(os.path.dirname(buildout))
setup_script(buildout, options['python'])
call((buildout, '-U'), cwd=location)
template =
[buildout]
extends = %(extends)s
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
bin-directory = ${buildout:bin-directory}
parts-directory = ${buildout:parts-directory}
extensions -= slapos.rebootstrap
%(buildout)s
parts = numpy
[versions]
numpy = ${versions:numpy}
[versions:sys.version_info >= (3,8)]
numpy = 1.22.0
buildout.cfg
../openblas/buildout.cfg
parts = numpy
[numpy-env]
OPENBLAS = ${openblas:location}/lib/libopenblas.so
LAPACK = ${openblas:location}/lib/libopenblas.so
ATLAS = ${openblas:location}/lib/libopenblas.so
[numpy]
environment = numpy-env
rpath = ${openblas:location}/lib
component/scipy/buildout.cfg
View file @
68d338fe
[buildout]
extends =
scipy.cfg
# ../macros/macro.sub.buildout.cfg
../numpy/openblas.cfg
../pandas/buildout.cfg
# ../pygolang/buildout.cfg
parts = scipy
parts =
scipy
[scipy-env]
<= numpy-env
[scipy-prerequisite]
recipe = slapos.recipe.build
depends = ${scipy-eggs:recipe}
install =
update =
from zc.buildout.easy_install import working_set
options = self.options
buildout = self.buildout['buildout']
scipy_eggs = self.buildout['scipy-eggs']
scipy_env = self.buildout['scipy-env']
eggs_directory = buildout['eggs-directory']
develop_eggs_directory = buildout['develop-eggs-directory']
setup_eggs = scipy_eggs['eggs'].splitlines()
setup_eggs = tuple(e.strip() for e in setup_eggs if e.strip())
dists = working_set(setup_eggs, [develop_eggs_directory, eggs_directory])
paths = ':'.join(dist.location for dist in dists)
scipy_env['PYTHONPATH'] = paths
[scipy]
recipe = zc.recipe.egg:custom
egg = scipy
environment = scipy-env
rpath = ${numpy:rpath}
[scipy-eggs]
recipe = zc.recipe.egg
eggs =
${cython:egg}
${numpy:egg}
${pandas:egg}
pythran
pybind11
[versions]
scipy = 1.0.1
[scipy:sys.version_info >= (3,8)]
depends = ${scipy-p
rerequisite
:recipe}
depends = ${scipy-p
ythonpath
:recipe}
[scipy-pythonpath]
<= macro.pythonpath.eggs
environment = scipy-env
eggs = ${scipy-setup-eggs:eggs}
[python_for_scipy_build:False]
<= python-interpreter
interpreter = ${:_buildout_section_name_}
[scipy-setup-eggs]
recipe = zc.recipe.egg
eggs =
${pygolang:egg}
${cython:egg}
${numpy:egg}
${pandas:egg}
pythran
pybind11
executable = ${buildout:bin-directory}/${:interpreter}
[scipy:False]
<= macro.sub.buildout
python = ${python_for_scipy_build:executable}
extends =
scipy.cfg
parts =
scipy
[versions:sys.version_info >= (3,8)]
pybind11 = 2.9.2
...
...
component/scipy/scipy.cfg
deleted
100644 → 0
View file @
1de997e2
[buildout]
extends =
../numpy/openblas.cfg
parts =
scipy
[scipy-env]
<= numpy-env
[scipy]
recipe = zc.recipe.egg:custom
egg = scipy
environment = scipy-env
setup-eggs =
${cython:egg}
${numpy:egg}
rpath = ${numpy:rpath}
[versions]
scipy = 1.0.1
software/jupyter/software.cfg
View file @
68d338fe
...
...
@@ -18,6 +18,9 @@ parts +=
# Always build GCC for Fortran (see openblas).
max_version = 0
[python]
part = python3.8
[jupyter]
python_executable = ${buildout:bin-directory}/${:interpreter}
...
...
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