summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/cli.py
Commit message (Collapse)AuthorAgeFilesLines
* _frontend/cli.py: Reinstate support for guessing targetsjuerg/source-guess-targetJürg Billeter2019-01-041-0/+10
| | | | | | Moving fetch and track to the source command group accidentally dropped the support for guessing targets for these commands when invoked from a workspace directory. This brings it back.
* _frontend/cli.py: Fixing new (unnecessary-pass) linter errorsTristan Van Berkom2018-12-261-3/+0
|
* Basic options for shell --build to use buildtreesWilliam Salmon2018-12-191-2/+25
| | | | Fixes issue #740
* Introduce new "source" command groupChandan Singh2018-12-141-102/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the message thread https://mail.gnome.org/archives/buildstream-list/2018-November/msg00106.html, implement a new command group called `source`. Move existing `track`, `fetch`, and the recently added `source-checkout` commands under this group. For `track` and `fetch`, this is a BREAKING change, as the old commands have been marked as obsolete. Using them will result in an error message that refers people to use the new versions, like `bst source fetch` instead of old `bst fetch`. `source-checkout` will now become `source checkout` (the dash has turned into a space), and is not a breaking change as it was added in the current development cycle. Note that the functionality to hide commands from help output was added only recently in Click, so the minimum version of Click that we now require is 7.0. Summary of changes: * _frontend/cli.py: Add `source` command group, mark previous versions as obsolete and hide them from the help output. * _frontend/complete.py: Fix completion for hidden commands. * setup.py: Bump Click minimum version to 7.0. * tests: Update to cope with the new command names. Fixes #814.
* cli: Add artifact log commandRichard Maw2018-12-121-0/+59
|
* cli: Add artifact command groupRichard Maw2018-12-121-0/+42
|
* cli: Add support for auto-completing artifact ref namesRichard Maw2018-12-121-7/+26
|
* Remove source bundle commandPhil Dawson2018-12-121-31/+0
| | | | This is part of the work towards #672
* Add option to source-checkout command to generate build scriptsPhil Dawson2018-12-121-4/+6
|
* Add --force / -f option to source-checkout commandPhil Dawson2018-12-121-1/+4
|
* Add --tar option to source-checkout commandPhil Dawson2018-12-121-2/+6
| | | | This commit is part of the work towards #672
* Make specifying elements optional in bst commandsJonathan Maw2018-12-111-13/+85
| | | | | | | | | | | | | | | | | | | | | | Known issues: * `bst shell` works, but `bst shell COMMANDS...` doesn't, because click has no way of separating optional args from variable-length args. * `bst checkout` and `bst source-checkout`'s usage strings mark LOCATION as an optional argument. Because click gets confused if there's an optional argument before a mandatory argument, I had to mark LOCATION as optional internally. * `bst workspace open` makes no sense with element being optional, so I skipped it. * `bst workspace close` will probably need to be revisited when multiple projects can own one workspace. * `bst workspace reset` will happily delete the directory you're currently in, requiring you to `cd $PWD` to see the contents of your directory. I could exclude the top-level directory of the workspace being deleted, but it is entirely valid to run workspace commands from deeper in the workspace. This is a part of #222
* cli: Interactively warn if the user is trying to close the workspace they're ↵Jonathan Maw2018-12-111-1/+9
| | | | | | | | | | | | | | | | | | | using to load the project This involves changes in: * _stream.py: * Add the helper Stream.workspace_is_required() * userconfig.yaml: * Add a default value for prompt.really-workspace-close-project-inaccessible * _context.py: * Load the prompt 'really-workspace-close-project-inaccessible' from user config. * cli.py: * If buildstream is invoked interactively, prompt the user to confirm that they want to close the workspace they're using to load this project. This is a part of #222
* cli.py: Use utils' search upwards helper when searching for project.confJonathan Maw2018-12-111-11/+2
| | | | This is a part of #222
* Refactor and simplify _prepare_sandbox for elementsBenjamin Schubert2018-12-031-1/+9
| | | | | | | | Before we would have a intricate logics with multiple arguments that might get ignored. This simplifies the design and introduces a bool `shell` instead of having two different variables concerned about scope
* Add `--deps build` option to `bst checkout`Chandan Singh2018-12-031-1/+1
| | | | | | | | | | | | | | | As discussed in https://mail.gnome.org/archives/buildstream-list/2018-September/msg00064.html, add `--deps build` option to `bst checkout`. This will allow users to checkout the all build dependencies of a given element using a single command. - _frontend/cli.py: Add `--deps build` option for `bst checkout`. - element.py: Support `deps='build'` in Element._prepare_sandbox(). - tests/frontend/buildcheckout.py: Ensure `--deps build` works as expected.
* cli.py: no autocomplete on files without .bstPhillip Smyth2018-11-301-1/+5
|
* _stream.py: Ability to pull missing buildtrees outside of pull/buildTom Pollard2018-11-301-0/+4
| | | | | | | | | | | | | | | | | | Adds helper function _buildtree_pull_required() to determine if a pullqueue should be constructed, for commands outside of bst pull and build where it is determined that an element's buildtree artifact is to be required given the respective semantics and config. Utilised in push() to attempt to mitigate skipping the push of partial elements without the user having to have preceded it with an explicit pull. cli.py: Add new behaviour to push command description element.py: Move _cached_buildtree() to be non local private method, use _KeyStrength types to reduce duplication. tests/integration/pullbuildtrees.py also updated to cover this use-case.
* Workspace CLI updateWilliam Salmon2018-11-211-17/+9
| | | | | | | This is to update the workspace CLI to as agreed on the mailing list https://mail.gnome.org/archives/buildstream-list/2018-September/msg00046.html This patch also introduces the default workspace directory.
* Add prompt.workspace-... optionsAngelos Evripiotis2018-11-201-2/+2
| | | | | | | | | | Provide options in project.conf to disable the 'Are you sure ...' prompts when making destructive changes: - Add prompt.really-workspace-close-remove-dir - Add prompt.really-workspace-reset-hard Add a NEWS item for these.
* Add `bst source-checkout` commandChandan Singh2018-11-191-0/+27
| | | | | | | | | | | | As discussed in https://mail.gnome.org/archives/buildstream-list/2018-September/msg00064.html, add `bst source-checkout` command. This will allow users to checkout sources for a given target. * _frontend/cli.py: Add source-checkout command * _pipeline.py: Add assert_sources_cached() method * _stream.py: Add source_checkout method, abstract out __check_location_writable() method that used to part of checkout()
* Add cli main and user config option for 'pull-buildtrees' context.Tom Pollard2018-11-171-0/+2
| | | | | | | | | | | | _context.py: Add pull_buildtrees global user context, the default of which is set to False via the addition of pull-buildtrees to userconfig.yaml cache group. _frontend/app.py & cli.py: Add --pull-buildtrees as a bst main option, which when passed will override the default or user defined context for pull_buildtrees. tests/completions/completions.py: Update for the added flag.
* Fix spelling of it's and itsRichard Dale2018-10-161-1/+1
|
* Set default mirror via command-line or user configJonathan Maw2018-07-271-0/+2
| | | | | | | In user config (buildstream.conf), it is set with the "default-mirror" field. On the command-line, it is set with "--default-mirror"
* Add support for creating a tarball on bst checkouttiagogomes/tarball_checkoutTiago Gomes2018-07-201-7/+17
| | | | | | | | One of the tests added is configured to be skipped for now, as dumping binary data is causing a bad descriptor exception when using the pytest capture module. Closes #263.
* source-bundle: Enable --except optionfranred/fix-except-argument-in-source-bundleFrancisco Redondo Marchena2018-07-191-1/+2
| | | | | | | Before this option was listed in help but was ignored when creating the source-bundle. Issue #468
* _frontend/cli.py: Fix help text for `bst checkout --deps`Jürg Billeter2018-07-171-1/+1
|
* buildstream/_frontend/cli.py: Added a `--deps` flag to `bst checkout`Phillip Smyth2018-07-171-1/+5
| | | | | buildstream/_stream.py: Added deps param to _prepare_sandbox function call buildstream/element.py: Added deps param and logic to _prepare_sandbox function
* Only redirect elements for workspace and track operationsPRE_CAS_MERGE_JULY_2018Jonathan Maw2018-07-161-0/+4
| | | | It was redirecting for checkout operations
* cli.py: Make buildstream check element paths instead of clickTristan Maat2018-06-291-18/+18
| | | | | This is to avoid inconsistencies when dealing with paths inside an elements directory
* Handle cross junction elements in workspaces.Valentin David2018-06-081-2/+2
| | | | | | | | | | | Workspaces are now index by colon separated junction path. This now allows to create workspaces for elements in external projects. Workspaces are owned by context instead of root project. However it is initialized once top-level project is registered as we need to resolve paths relatively to this top-level project. Part of #359.
* _frontend/cli.py: Allow specifying commands in `bst help`Tristan Van Berkom2018-06-071-9/+62
| | | | | | o This supports deeply nested commands as well as shallow commands o Automated support for bash completions included
* Implement bst helpEd Baunton2018-06-071-3/+15
|
* Make `bst help` workEd Baunton2018-06-071-0/+4
|
* _frontend/cli.py: Try to autocomplete element paths when running from a ↵Chandan Singh2018-06-061-1/+17
| | | | | | | | subdirectory The previous commit added support for running bst commands form subdirectories of the project root. Make autocomplete also work in a similar way.
* Redirect elements when performing tracking and workspace commandsJonathan Maw2018-05-171-9/+5
| | | | i.e. when an element is specified, it may be replaced with its source element.
* _frontend: Notify failures when on linuxtristan/platform-appTristan Van Berkom2018-05-171-1/+1
| | | | | | | | Opens the door to platform specific frontend features, and implements a platform specific "notify" method. This is based on Valentin David's patch on merge request 447, and this fixes issue #385.
* _frontend/cli.py: Remove bst show --downloadable optionJürg Billeter2018-05-111-5/+2
| | | | This is in preparation for moving away from summary files.
* Add soft reset functionality for workspacesTristan Van Berkom2018-05-101-3/+5
| | | | | | | | | | | Add `--soft` option to `bst workspace reset` which would allow uses to reset workspace-related state without affecting its contents. This will be useful in case when an user wants to re-run configure-commands for a workspaced element. Patch originally by Chandan Singh, rebased against recent refactor. Fixes #375.
* _frontend/cli.py: Fetch all elements when tracking a build plantristan/pipeline-refactorTristan Van Berkom2018-05-081-0/+7
| | | | | | | | | | | | | | | | It makes not sense to type `bst fetch --track --deps all <targets>`, because tracking will inevitably modify the build plan. Stream initialization will not cope with this either, instead of silently doing something which does not make any sense, we add an assertion that this should not happen. Unfortunately since `plan` is the default deps type for `bst fetch`, this is likely to happen so it's important to correct. This patch adds a warning in the case tracking of the build plan elements is requested, and converts the request to track all elements instead.
* Moving 'fetch_subprojects' configuration to stream <--> loaderTristan Van Berkom2018-05-081-6/+6
| | | | | | | | | This was previously decided in CLI, but knowledge of what to initialize has been moved to Stream(). Now there is no more point to store this configuration in the Context, we just have the Stream() decide it when asking the Pipeline() to invoke the Loader().
* _stream.py, _frontend: Call Stream() APIs with CLI arguments directly.Tristan Van Berkom2018-05-081-113/+110
| | | | | | This shifts the whole responsibility of interpreting command line targets etc to the Stream() object itself. With this commit, the Pipeline() truly becomes slaved to the Stream().
* _stream.py: Absorb workspace functionality from App.Tristan Van Berkom2018-05-081-16/+25
|
* _stream.py: New Stream object, main calling interface for BuildStream coreTristan Van Berkom2018-05-081-8/+8
| | | | | | This is the first part of the pipeline refactor, at this stage all calling interfaces remain the same, except that invocation of the scheduler has been moved from Pipline to Stream.
* Use versioneer instead of setuptools_scmTristan Van Berkom2018-04-261-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using setuptools_scm had a couple of bad problems: o Unexpected versioning semantics, setuptools_scm would increment the micro version by itself in the case that we derive a version number from something that is not a tag, making the assumption that we are "leading up to" the next micro version. People mostly dont expect this. o When installing in developer mode, i.e. with `pip3 install --user -e .`, then we were always picking the generated version at install time and never again dynamically resolving it. Many of our users install this way and update through git, so it's important that we report more precise versions all the time. This commit needs to make a series of changes at the same time: o Adds versioneer.py to the toplevel, this is used by setup.py for various activities. This is modified only to inform the linter to skip o Adds buildstream/_version.py, which is generated by versioneer and gives us the machinery to automatically derive the correct version This is modified only to inform the linter to skip o Adds a .gitattributes file which informs git to substitute the buildstream/_version.py file, this is just to ensure that the versioning output would work if ever we used `git archive` to release a tarball. o Modifies setup.py and setup.cfg for versioneer o Modifies utils.py and _frontend/cli.py such as to avoid importing the derived version when running bash completion mode, we dont derive the version at completion time because this can result in running a subprocess (when running in developer install mode) and is an undesirable overhead. o Updates tests/frontend/version.py to expect changed version output
* _frontend/cli.py: Set the track_selection argument to the deps parameterTristan Van Berkom2018-04-191-1/+1
| | | | | | | Tell the pipeline to only track either 'none' or 'all' PipelineSelection modes. This fixes issue #367
* _pipeline.py: Added PipelineSelectionTristan Van Berkom2018-04-191-6/+6
| | | | | | | | Part of a slow, ongoing refactor to unmangle the pipeline into something which just creates pipelines of elements for a centerpiece to process. This also renames Pipeline.deps_elements() -> Pipeline.get_selection()
* _frontend/cli.py: Add option to reset multiple workspacesChandan Singh2018-04-171-6/+16
| | | | | | !357 added support for closing multiple workspaces. Similarly, also allow `bst workspace reset` to work on multiple workspaces, with `--all` as a helper to reset all open workspaces.
* refactor: Do not assume there is only one workspace target in app.pyChandan Singh2018-04-171-2/+6
| | | | | | | | | | | While working with workspaces in _frontend/app.py, we currently assume that there is only workspace in the pippeline. This limits our ability to support multiple workspaces in a given command. Remove this assumption from _frontend/app.py which will allow for the possibility of supporting multiple workspaces from _frontend/cli.py in future. This commit does not change the behavior of these commands though as the target is instead passed as an argument.
* _frontend: Earlier assertion for `bst workspace open` when directory is not ↵Tristan Van Berkom2018-04-171-0/+10
| | | | | | | | empty This just raises the error to the user that the checkout directory where they intend to create a workspace in is not empty, a little bit earlier, without bothering to initialize the pipeline first.