Chandan Singh pushed to branch chandan/import-is-not-buildelement at BuildStream / buildstream
Commits:
-
adfb9291
by Tristan Van Berkom at 2019-01-18T21:23:05Z
-
d114a6bd
by Tristan Van Berkom at 2019-01-18T22:07:22Z
-
bf591ade
by Chandan Singh at 2019-01-18T22:09:04Z
2 changed files:
Changes:
... | ... | @@ -28,17 +28,14 @@ some configuration data. |
28 | 28 |
The empty configuration is as such:
|
29 | 29 |
.. literalinclude:: ../../../buildstream/plugins/elements/import.yaml
|
30 | 30 |
:language: yaml
|
31 |
- |
|
32 |
-See :ref:`built-in functionality documentation <core_buildelement_builtins>` for
|
|
33 |
-details on common configuration options for build elements.
|
|
34 | 31 |
"""
|
35 | 32 |
|
36 | 33 |
import os
|
37 |
-from buildstream import Element, BuildElement, ElementError
|
|
34 |
+from buildstream import Element, ElementError
|
|
38 | 35 |
|
39 | 36 |
|
40 | 37 |
# Element implementation for the 'import' kind.
|
41 |
-class ImportElement(BuildElement):
|
|
38 |
+class ImportElement(Element):
|
|
42 | 39 |
# pylint: disable=attribute-defined-outside-init
|
43 | 40 |
|
44 | 41 |
# This plugin has been modified to avoid the use of Sandbox.get_directory
|
... | ... | @@ -93,10 +90,6 @@ class ImportElement(BuildElement): |
93 | 90 |
# And we're done
|
94 | 91 |
return '/output'
|
95 | 92 |
|
96 |
- def prepare(self, sandbox):
|
|
97 |
- # We inherit a non-default prepare from BuildElement.
|
|
98 |
- Element.prepare(self, sandbox)
|
|
99 |
- |
|
100 | 93 |
def generate_script(self):
|
101 | 94 |
build_root = self.get_variable('build-root')
|
102 | 95 |
install_root = self.get_variable('install-root')
|
1 |
-from setuptools.sandbox import run_setup
|
|
2 | 1 |
import os
|
3 | 2 |
import pytest
|
4 | 3 |
import re
|
5 | 4 |
import shutil
|
5 |
+import subprocess
|
|
6 | 6 |
|
7 | 7 |
|
8 | 8 |
SETUP_TEMPLATE = '''\
|
... | ... | @@ -88,7 +88,9 @@ def generate_pip_package(tmpdir, pypi, name, version='0.1'): |
88 | 88 |
f.write(INIT_TEMPLATE.format(name=name))
|
89 | 89 |
os.chmod(main_file, 0o644)
|
90 | 90 |
|
91 |
- run_setup(setup_file, ['sdist'])
|
|
91 |
+ # Run sdist with a fresh process
|
|
92 |
+ p = subprocess.run(['python3', 'setup.py', 'sdist'], cwd=tmpdir)
|
|
93 |
+ assert p.returncode == 0
|
|
92 | 94 |
|
93 | 95 |
# create directory for this package in pypi resulting in a directory
|
94 | 96 |
# tree resembling the following structure:
|