Tristan Van Berkom pushed to branch chandan/pip-install-instructions at BuildStream / buildstream
Commits:
-
56096b60
by Chandan Singh at 2018-08-24T02:12:03Z
-
86e4729d
by Tristan Van Berkom at 2018-08-24T06:42:03Z
-
d88568ef
by Valentin David at 2018-08-24T06:48:08Z
-
f7ef151b
by Tristan Van Berkom at 2018-08-24T07:36:19Z
-
fa476d79
by Tristan Van Berkom at 2018-08-24T07:55:43Z
-
255f9ee3
by Tristan Van Berkom at 2018-08-24T08:39:19Z
-
5bd6f762
by Chandan Singh at 2018-08-24T10:20:18Z
6 changed files:
- .gitlab-ci.yml
- doc/source/install_linux_distro.rst
- tests/integration/project/elements/base/base-alpine.bst
- tests/integration/project/project.conf
- tests/integration/source-determinism.py
- tests/testutils/runcli.py
Changes:
... | ... | @@ -36,6 +36,11 @@ source_dist: |
36 | 36 |
- tar -ztf dist/*
|
37 | 37 |
- tarball=$(cd dist && echo $(ls *))
|
38 | 38 |
|
39 |
+ # Verify that the source distribution tarball can be installed correctly
|
|
40 |
+ #
|
|
41 |
+ - pip3 install dist/*.tar.gz
|
|
42 |
+ - bst --version
|
|
43 |
+ |
|
39 | 44 |
# unpack tarball as `dist/buildstream` directory
|
40 | 45 |
- |
|
41 | 46 |
cat > dist/unpack.sh << EOF
|
... | ... | @@ -152,8 +152,29 @@ for advice on this. |
152 | 152 |
|
153 | 153 |
Installing
|
154 | 154 |
~~~~~~~~~~
|
155 |
-Once you have the base system dependencies, you can clone the BuildStream
|
|
156 |
-git repository and install it as a regular user::
|
|
155 |
+Once you have the base system dependencies, you can install the BuildStream
|
|
156 |
+python package as a regular user.
|
|
157 |
+ |
|
158 |
+Via PyPI (recommended)
|
|
159 |
+++++++++++++++++++++++
|
|
160 |
+::
|
|
161 |
+ |
|
162 |
+ pip3 install --user BuildStream
|
|
163 |
+ |
|
164 |
+This will install latest stable version of BuildStream and its pure python
|
|
165 |
+dependencies into your user's homedir in ``~/.local``.
|
|
166 |
+ |
|
167 |
+Keep following the instructions below to ensure that the ``bst``
|
|
168 |
+command is in your ``PATH`` and to enable bash completions for it.
|
|
169 |
+ |
|
170 |
+.. note::
|
|
171 |
+ |
|
172 |
+ If you want a specific version of BuildStream, you can install it using
|
|
173 |
+ ``pip install --user BuildStream==<version-number>``
|
|
174 |
+ |
|
175 |
+Via Git checkout
|
|
176 |
+++++++++++++++++
|
|
177 |
+::
|
|
157 | 178 |
|
158 | 179 |
git clone https://gitlab.com/BuildStream/buildstream.git
|
159 | 180 |
cd buildstream
|
... | ... | @@ -206,9 +227,19 @@ to your ``~/.bash_completion``: |
206 | 227 |
|
207 | 228 |
Upgrading BuildStream
|
208 | 229 |
~~~~~~~~~~~~~~~~~~~~~
|
209 |
-Assuming you have followed the default instructions above, all
|
|
210 |
-you need to do to upgrade BuildStream is to update your local git
|
|
211 |
-checkout::
|
|
230 |
+ |
|
231 |
+Via PyPI
|
|
232 |
+++++++++
|
|
233 |
+ |
|
234 |
+If you installed BuildStream from PyPI, you can update it like so::
|
|
235 |
+ |
|
236 |
+ pip install --user --upgrade BuildStream
|
|
237 |
+ |
|
238 |
+Via Git checkout
|
|
239 |
+++++++++++++++++
|
|
240 |
+ |
|
241 |
+If you installed BuildStream from a local git checkout using ``-e`` option, all
|
|
242 |
+you need to do to upgrade BuildStream is to update your local git checkout::
|
|
212 | 243 |
|
213 | 244 |
cd /path/to/buildstream
|
214 | 245 |
git pull --rebase
|
... | ... | @@ -7,6 +7,6 @@ description: | |
7 | 7 |
|
8 | 8 |
sources:
|
9 | 9 |
- kind: tar
|
10 |
- url: sysroot:tarballs/integration-tests-base.v1.x86_64.tar.xz
|
|
10 |
+ url: alpine:integration-tests-base.v1.x86_64.tar.xz
|
|
11 | 11 |
base-dir: ''
|
12 | 12 |
ref: 3eb559250ba82b64a68d86d0636a6b127aa5f6d25d3601a79f79214dc9703639
|
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
name: test
|
3 | 3 |
element-path: elements
|
4 | 4 |
aliases:
|
5 |
- sysroot: https://gnome7.codethink.co.uk/
|
|
5 |
+ alpine: https://gnome7.codethink.co.uk/tarballs/
|
|
6 | 6 |
project_dir: file://{project_dir}
|
7 | 7 |
options:
|
8 | 8 |
linux:
|
... | ... | @@ -2,7 +2,8 @@ import os |
2 | 2 |
import pytest
|
3 | 3 |
|
4 | 4 |
from buildstream import _yaml, utils
|
5 |
-from tests.testutils import cli, create_repo, ALL_REPO_KINDS
|
|
5 |
+from tests.testutils import create_repo, ALL_REPO_KINDS
|
|
6 |
+from tests.testutils import cli_integration as cli
|
|
6 | 7 |
|
7 | 8 |
|
8 | 9 |
DATA_DIR = os.path.join(
|
... | ... | @@ -28,7 +29,7 @@ def create_test_directory(*path, mode=0o644): |
28 | 29 |
@pytest.mark.integration
|
29 | 30 |
@pytest.mark.datafiles(DATA_DIR)
|
30 | 31 |
@pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS] + ['local'])
|
31 |
-def test_deterministic_source_umask(cli, tmpdir, datafiles, kind):
|
|
32 |
+def test_deterministic_source_umask(cli, tmpdir, datafiles, kind, integration_cache):
|
|
32 | 33 |
project = str(datafiles)
|
33 | 34 |
element_name = 'list'
|
34 | 35 |
element_path = os.path.join(project, 'elements', element_name)
|
... | ... | @@ -91,14 +92,16 @@ def test_deterministic_source_umask(cli, tmpdir, datafiles, kind): |
91 | 92 |
return f.read()
|
92 | 93 |
finally:
|
93 | 94 |
os.umask(old_umask)
|
94 |
- cli.remove_artifact_from_cache(project, element_name)
|
|
95 |
+ cache_dir = os.path.join(integration_cache, 'artifacts')
|
|
96 |
+ cli.remove_artifact_from_cache(project, element_name,
|
|
97 |
+ cache_dir=cache_dir)
|
|
95 | 98 |
|
96 | 99 |
assert get_value_for_umask(0o022) == get_value_for_umask(0o077)
|
97 | 100 |
|
98 | 101 |
|
99 | 102 |
@pytest.mark.integration
|
100 | 103 |
@pytest.mark.datafiles(DATA_DIR)
|
101 |
-def test_deterministic_source_local(cli, tmpdir, datafiles):
|
|
104 |
+def test_deterministic_source_local(cli, tmpdir, datafiles, integration_cache):
|
|
102 | 105 |
"""Only user rights should be considered for local source.
|
103 | 106 |
"""
|
104 | 107 |
project = str(datafiles)
|
... | ... | @@ -150,6 +153,8 @@ def test_deterministic_source_local(cli, tmpdir, datafiles): |
150 | 153 |
with open(os.path.join(checkoutdir, 'ls-l'), 'r') as f:
|
151 | 154 |
return f.read()
|
152 | 155 |
finally:
|
153 |
- cli.remove_artifact_from_cache(project, element_name)
|
|
156 |
+ cache_dir = os.path.join(integration_cache, 'artifacts')
|
|
157 |
+ cli.remove_artifact_from_cache(project, element_name,
|
|
158 |
+ cache_dir=cache_dir)
|
|
154 | 159 |
|
155 | 160 |
assert get_value_for_mask(0o7777) == get_value_for_mask(0o0700)
|
... | ... | @@ -198,8 +198,10 @@ class Cli(): |
198 | 198 |
for key, val in config.items():
|
199 | 199 |
self.config[key] = val
|
200 | 200 |
|
201 |
- def remove_artifact_from_cache(self, project, element_name):
|
|
202 |
- cache_dir = os.path.join(project, 'cache', 'artifacts')
|
|
201 |
+ def remove_artifact_from_cache(self, project, element_name,
|
|
202 |
+ *, cache_dir=None):
|
|
203 |
+ if not cache_dir:
|
|
204 |
+ cache_dir = os.path.join(project, 'cache', 'artifacts')
|
|
203 | 205 |
|
204 | 206 |
cache_dir = os.path.join(cache_dir, 'cas', 'refs', 'heads')
|
205 | 207 |
|