Package: workspace-tools
workspace-toolsTools to simplify working with multiple Python repositories by seamlessly integrating git and tox,
where you can simply run one command instead of many native commands individually to do common tasks.It is mostly a wrapper on top of existing tools with the end goal of providing a simple, seamless,
and less repetive experience when working with one or more repositories. Feature support is mostly
limited to what the author uses as, currently, it is foremost a personal tool to enhance the
author’s own productivity, but sharing it as others might find it useful.OverviewOne tool to seamlessly manage / integrate all workspace tools, from setup to publish.Simplified command execution for common workflow - just run one command, instead of many individual native ones.Command execution is also smart / optimized - e.g. test command auto detects requirement changes to redevelop.Path aware context commands that run across all checkouts - e.g. see status / diff for all repos.Get the most out of other products by easily updating your dependencies to the latestTemplates included to setup new product quicklySupport for multiple branches with child/parent relationship.Cool and sensible shortcut aliases to help you do more by typing less - you will love “tv” [if you know ag]!Quick Start TutorialFirst, install it with:sudo pip3 install autopip
app install workspace-toolsSecond, optionally setup environment with bash functions/aliases:$cd~/workspace$wstsetup--commands-with-aliases[INFO] Added "ws" bash function with workspace directory set to ~/workspace
[INFO] Added bash functions: bump, checkout, clean, commit, log, publish, push, status, test, update
[INFO] Added aliases: co=checkout, ci=commit, di=diff, st=status, up=update
[INFO] Added special aliases: a='activate', d='deactivate',
       tv='open_files_from_last_command'  # from ag/ack/grep/find/which [t]o [v]im
[INFO] To use, run "source ~/.wstrc" or open a new shell.$source~/.wstrcThen witness the awesome power of workspace-tools:$ws#Runs`cd~/workspace&&ls`aiohttp-requests               localconfig              python-examples
ansible-hostmanager            pytest-fixtures          utils-core
...$cdlocalconfig#Useyourfavoriteeditortomakesomechanges$ci-tp'This adds/commits all files, runs style check/tests with coverage, and then pushes to all remotes!'Checking style
Running tests
...........................
----------- coverage: platform linux, python 3.6.5-final-0 -----------
Name                      Stmts   Miss  Cover
---------------------------------------------
localconfig/__init__.py       2      0   100%
localconfig/manager.py      215     14    93%
localconfig/utils.py         20      0   100%
---------------------------------------------
TOTAL                       237     14    94%
Required test coverage of 80% reached. Total coverage: 81.90%
==================  22 passed in 0.82 seconds  =======================
cover: OK
style: OK
[master d5f6e6b] This adds/commits all files, runs style check/tests with coverage, ...
 1 file changed, 78 insertions(+), 38 deletions(-)
Pushing masterThe remaining tutorial will assumewst setup -awas not run for the sake of clarity, though setup is
recommended as there are many useful aliases provided.To checkout a repo:$wstcheckoutmaxzheng/workspace-tools# Exact match from Github$wstcheckoutrequests# Best match from Github$wstcheckouthttps://github.com/maxzheng/aiohttp-requests.gitTo update all repos in your workspace concurrently:$wstupdateUpdating aiohttp-requests
Updating ansible-hostmanager
...Make a commit and create a new branch for it:$cdworkspace-tools#viREADME.rstandmakesomechanges$wstcommit"Updated README.rst"[updated-readme@master 0af8850] Updated README.rst
 1 file changed, 1 deletion(-)#Thecommitcreatedthebranch'updated-readme@master',addedallfiles,andthencommittedchange.#Noticethe"@master"thatindicatestheparentbranch.Theparentbranchwillbeused#duringpushwith--mergeandwhenupdatingthebranch(updatesparentandrebasesbranchontop).#Tocreateabranchwithoutparentrelationship,use--branchoptionwithanynamethatyoulike.To install your test environment and run all tests (via tox/pytest):$wsttest...
cover: OK
style: OK#Tosetupanewprojectwithtoxtest,cover,andstyleenvironments:$cdnew-product$wstsetup--product#Tocheckstyleorgeneratecoveragereport:$wstteststyle$wsttestcover#Torunaspecifictestonly:$wsttest-ktest_filterTo see status for a single repo or all of your repos:$wststatus#Branches:updated-readme@mastermaster$cd..$wststatus[ bumper-lib ]
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   src/bumper/cars.py

no changes added to commit (use "git add" and/or "git commit -a")

[ clicast ]#Branches:masterdisplay-changes@masterfix-download@master[ workspace-tools ]#Branches:updated-readme@mastermasterTo amend a change and push:$cdworkspace-tools#viREADME.rstandmakemorechanges$wstcommit--amend--push[updated-readme@master 738f659] Updated README.rst
1 file changed, 2 insertions(+), 1 deletion(-)
Pushing updated-readme@master#Itwillfailatpushasyouarenotacommitter,butthechangewascommittedtobranch,#andthenmergedintoitsparentbranch(master).Or simply push the change in your current branch:$wstpush--merge#Thiswillupdateitsparentbranch(master),rebasebranchwithparentbranchandmergeinto#parentbranchifonchildbranch(child@parent)andthenpush.#Uponsuccess,itwillremovethelocalandremotebranchifpushingfromchildbranch.If you have multiple upstream branches (defined by merge config in ~/.config/workspace.cfg) that you need to merge
your change into, use auto merge:#Assumingyouarecurrentlyon3.2.xbranchandhavethesebranches:3.3.x,master$wstmerge--all[INFO] Merging 3.2.x into 3.3.x
[INFO] Pushing 3.3.x
[INFO] Merging 3.3.x into master
[INFO] Pushing masterIf you have pinned your dependency requirements and want to update to latest version:$wstbump[INFO] Updating workspace-tools
[INFO] Checking bumper-lib
...
[INFO] Checking requests
[bump ac06160] Require remoteconfig==0.2.4, requests==2.6.0
 1 file changed, 2 insertions(+), 2 deletions(-)#Tobumptoaspecificversion(whynotjustvi?Thisvalidatestheversionforyouandpullsinthechangelog)$wstbumprequests==2.5.1To bump version, update changelog, and release to PyPI:$publishPyPI Password:
Updating master
Building source/built distribution
Uploading to PyPI
[master a58b001] Publish version 1.0.7
 2 files changed, 8 insertions(+), 2 deletions(-)
Pushing masterNow you are ready to try out the other commands yourself:$wst-husage: wst [-h] [-v] [--debug] <sub-command> ...

optional arguments:

  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  --debug               Turn on debug mode

sub-commands:
  {bump,checkout,co,clean,commit,ci,diff,di,log,publish,push,setup,status,st,test,update,up}
                        List of sub-commands
    bump                Bump dependency versions in requirements.txt,
                        pinned.txt, or any specified file.
    checkout (co)       Checkout products (repo urls) or revert files.
    clean               Clean workspace by removing build, dist, and .pyc
                        files
    commit (ci)         Commit all changes locally, including new files.
    diff (di)           Show diff on current product or all products in
                        workspace
    log                 Show commit logs
    merge               Merge changes from branch to current branch
    publish             Bumps version in setup.py (defaults to patch), writes
                        out changelog, builds a source distribution, and
                        uploads with twine.
    push                Push changes for branch
    setup               Optional (refer to setup --help). Setup workspace
                        environment. Run from primary workspace directory.
    status (st)         Show status on current product or all products in
                        workspace
    test                Run tests and manage test environments for product.
    update (up)         Update current product or all products in workspaceTo configure wst, refer toConfigurationdoc.Links & Contact InfoDocumentation:http://workspace-tools.readthedocs.orgPyPI Package:https://pypi.python.org/pypi/workspace-toolsGitHub Source:https://github.com/maxzheng/workspace-toolsReport Issues/Bugs:https://github.com/maxzheng/workspace-tools/issuesFollow:https://twitter.com/MaxZhengXConnect:https://www.linkedin.com/in/maxzhengContact: maxzheng.os @t gmail.com