Skip to content
This repository has been archived by the owner on Dec 19, 2020. It is now read-only.

sifive/wit

Repository files navigation

GitHub tag (latest SemVer) Build Status Github

Wit

Workspace Integration Tool

What is this?

Wit is a tool for managing workspaces. It is intended as a supplement to (not a replacement for) Git-based workflows. The goal of wit is to enable development in a multiple user and repository environment.

A wit workspace is composed of one or more packages. A package is a git repository. Each package may optionally contain a wit-manifest.json file which defines other packages upon which it depends. Wit resolves this hierarchy of dependencies and generates a flattened directory structure in which each package may exist only once.

How does Wit deduplicate packages?

When multiple versions of the same package are requested, Wit chooses the latest requested version, making sure the selected version's commit is a descendant of every other requested versions' commits.

Installation

Wake is intended to be as lightweight as possible. It requires git and Python version 3.5 or greater.

Use pip to install from PyPI:

python3 -m pip install wit-sifive

Getting started

The best way to learn wit is to check out the tutorial.

How To Guides

See the How To Guides for list of guides for common wit operations.

Autocompletion

Tab completion can be enabled via source complete.bash. If you want it to persist, see below.

Bash

Linux

cp complete.bash /etc/bash_completion.d/wit

macOS

Homebrew

Install autocompletion for bash:

brew install bash-completion

After running the script, you should see instructions for how to finish installing it.

For example, on macOS 10.14.15, the output is:

==> Caveats
Add the following line to your ~/.bash_profile:
  [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

So, in the above case, we'd add the following to our ~/.bash_profile:

[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"

then run:

cp complete.bash /usr/local/etc/bash_completion.d/wit

Zsh

mkdir -p ~/.zsh/completion
cp complete.bash ~/.zsh/completion/_wit

Make sure the following is in your ~/.zshrc:

fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i

Then reload your shell:

exec $SHELL -l

GitHub Action

This repo also provides a GitHub Action that is available for use in GitHub CI/CD workflows. See actions/wit/README.md for more information.

Contributing

Please see doc/internals.md for information about development.

Installing development versions

Clone the repo and add it to your PATH, for example:

git clone https://github.com/sifive/wit.git -b $BRANCH
PATH=$PATH:$PWD/wit
which wit

It also includes a Makefile for installing specific versions (requires make).

make install PREFIX=/path/to/installation
export PYTHONPATH=$PYTHONPATH:/path/to/installation/$VERSION

The Makefile will create a directory with the version (it even works for commits between tags) and use pip to install the contents of the local clone excluding the tests and metadata.

License

See LICENSE.