Skip to content

Commit

Permalink
Improve build process and basic documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelLipski committed Dec 7, 2019
1 parent d36ab18 commit 46a8abf
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 23 deletions.
35 changes: 25 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
os: linux
language: python
matrix:
jobs:
include:
- python: 2.7
env: TOXENV=py27
Expand All @@ -9,15 +10,29 @@ matrix:
env: TOXENV=py36
- python: 3.6
env: TOXENV=pep8
- python: 3.8
env: TOXENV=py38
- python: 3.8
env: TOXENV=pep8
cache: pip
install: pip install tox
script: tox
deploy:
provider: pypi
user: "__token__"
password:
secure: U6JJcByjLv2PutUpnpqDT7cNIUYu9Ap9t4G90KULEn6Syxa49aX14BT6k2jBakWbQgrPCxLLNSWeCoC4xPl/Z2/9HLEFxZLVovtVbiaJ8HrTcoWmEZijnGob9Ofh94TFP8VtifjqHXeIrPi78XyZEks/ed0Sj3jSH4BL74PDHvqbD1RnsezFm4QGI2ESOWY+laJ2ralcpHRJh0hJb0QHxOpbKPVM+QefiFs+VFkFP25hQcn/G3qdduzW5NQ8OHBYCbevy6/1yt/M67ZzAeA0n4UrkZ/3vBsMJJ3wynWWZ3xO+lGs6eqZ31E8vicogYbw5hXs119JRkKUrcU5uqVL1mogf8N6y76w2xNV6Aul/XtpBiuPQsHm0tChwTI6yyGzAZBRPMB1KzRclDKGQThIBhpX+wfqHSpvdj1CZV5AMm3+6nHA0LSGWiuJ1BW7pTrAp9YFPbrQfH59JWMhy8ng5lexcQQj7spSO/DPw0VMIfUiw644BfSfyZwls5du4yYfWOkd8RoELEa2IGqCp1sTqjWvSuX3nzKCbJhxAwrVU5mK9fiMPcL1jURIwlFvooI+qKAp3CdGZ1IM+HFmpzXym2kvZvmrNXduVSZcqG3DrCFxt77FYsN5SNB/uly1vLq/6Y0BaCw9ao6YWfW3fvU2cCcyejjzPyfGzZ2jA5uOpZ8=
distributions: "sdist bdist_wheel"
on:
condition: $TOXENV = py36
python: 3.6
tags: true
- provider: pypi
username: "__token__"
password:
secure: U6JJcByjLv2PutUpnpqDT7cNIUYu9Ap9t4G90KULEn6Syxa49aX14BT6k2jBakWbQgrPCxLLNSWeCoC4xPl/Z2/9HLEFxZLVovtVbiaJ8HrTcoWmEZijnGob9Ofh94TFP8VtifjqHXeIrPi78XyZEks/ed0Sj3jSH4BL74PDHvqbD1RnsezFm4QGI2ESOWY+laJ2ralcpHRJh0hJb0QHxOpbKPVM+QefiFs+VFkFP25hQcn/G3qdduzW5NQ8OHBYCbevy6/1yt/M67ZzAeA0n4UrkZ/3vBsMJJ3wynWWZ3xO+lGs6eqZ31E8vicogYbw5hXs119JRkKUrcU5uqVL1mogf8N6y76w2xNV6Aul/XtpBiuPQsHm0tChwTI6yyGzAZBRPMB1KzRclDKGQThIBhpX+wfqHSpvdj1CZV5AMm3+6nHA0LSGWiuJ1BW7pTrAp9YFPbrQfH59JWMhy8ng5lexcQQj7spSO/DPw0VMIfUiw644BfSfyZwls5du4yYfWOkd8RoELEa2IGqCp1sTqjWvSuX3nzKCbJhxAwrVU5mK9fiMPcL1jURIwlFvooI+qKAp3CdGZ1IM+HFmpzXym2kvZvmrNXduVSZcqG3DrCFxt77FYsN5SNB/uly1vLq/6Y0BaCw9ao6YWfW3fvU2cCcyejjzPyfGzZ2jA5uOpZ8=
distributions: "sdist bdist_wheel"
on:
condition: $TOXENV = py36
python: 3.6
tags: true
- provider: releases # Github
api_key:
secure: arhgNhJMfVq8xaa5xMswvjkgfgE8dDJ6BM0X+HI28m7BrwjxaVyr5Ct1qIohEQSZOpihwHzFLLwzSICc5sR6H8Ai4yYcm/sLGOAHyp4p1HeAXPqbtyUtn3rbcjsKXSfwjntkGommC6sYoY5GZhJy2qcRQIADjRMPQWRURY5/6KBBY05scL2vVpQw2NHp2pNCiMSDhokFsN3mv1PX15QDJdKFuIrD61cD15ljkwol7OJ+wKzGozyJB6GHkWi7WsGXsgdzjruHY7tcqPEksa+sWxxGGMmLQ7gVruVUlguunACjh0xlZvMBDKWEeffvRy9JSkAKVccTtaiZw9beoCaihZOVys/Bw4Znv3e+UpkOOrBwMFOdjc1R/Kz1/aewuYFckKhP/opdkpOj3T0VIckmK4s/vWYWhHLRiAHE4gb47UxYIKHGqPfs9XMyZryRF6iaTm3LKtTb+ufM0OQEKtWR0MBBRmpqapx74Jd6tuf7n4KbsS4ZuVeb27+OBhfogpYdfGW2KxzwCOwYl+iGCsNkPyMUOmqo8MfFvwEsHU7SnZ1G2tcSoptT8+Bj8n2lKB7sf/llywUJxKKG9kpK9Y9Tc6yvtgjj4ewjsjgaGCksS5jVPk223WEHu/iX4FK4Ftms9cXWLbQpMKW4dACyAEu8ONIRw+TXvUFA2J3wWsOiQNk=
file_glob: true
file: "dist/*"
on:
condition: $TOXENV = py36
python: 3.6
tags: true
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

[![Join the chat at https://gitter.im/VirtusLab/git-machete](https://badges.gitter.im/VirtusLab/git-machete.svg)](https://gitter.im/VirtusLab/git-machete)
[![TravisCI build status](https://api.travis-ci.org/VirtusLab/git-machete.svg?branch=master)](https://travis-ci.org/VirtusLab/git-machete)
[![PyPI package](https://badge.fury.io/py/git-machete.svg)](https://badge.fury.io/py/git-machete.svg)


![](logo.png)

**git machete is a versatile tool for organizing your git repo, including features like:**

* Automatic discovery of branch relations (`git machete discover`)

* Neat, customizable `git machete status` that shows what branches are in sync with their parent branch/remote tracking branch and which of them need to be rebased/pulled/pushed

![git machete status](https://raw.githubusercontent.com/PawelLipski/git-machete-blog-2/master/status.png)
Expand All @@ -17,6 +17,8 @@

![git machete traverse](https://raw.githubusercontent.com/PawelLipski/git-machete-blog-2/master/traverse.png)

* Automatic discovery of branch relations (`git machete discover`)


## Install

Expand Down
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release notes

## New in git-machete 2.12.3

- improved: build process

## New in git-machete 2.12.2

- fixed: `discover --checked-out-since` was crashing for branches that weren't referenced anywhere in `git reflog HEAD`
Expand Down
1 change: 1 addition & 0 deletions git_machete/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '2.12.3'
16 changes: 9 additions & 7 deletions git_machete/cmd.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from git_machete import __version__
import distutils.spawn
import getopt
import io
Expand All @@ -11,8 +12,6 @@
import sys
import textwrap

VERSION = '2.12.2'


# Core utils

Expand Down Expand Up @@ -305,7 +304,7 @@ def prev_branch(b):
def root_branch(b, accept_self):
if b not in managed_branches:
if roots:
sys.stderr.write("warn: %s is not a managed branch, assuming %s (the first root) instead as root\n" % (b, roots[0]))
sys.stderr.write("Warn: %s is not a managed branch, assuming %s (the first root) instead as root\n" % (b, roots[0]))
return roots[0]
else:
raise_no_branches_error()
Expand Down Expand Up @@ -1297,7 +1296,7 @@ def print_new_line(new_status):

if b != cb and (needs_slide_out or needs_rebase or needs_remote_sync):
print_new_line(False)
sys.stderr.write("Checking out %s\n" % bold(b))
sys.stdout.write("Checking out %s\n" % bold(b))
go(b)
cb = b
print_new_line(False)
Expand Down Expand Up @@ -1406,7 +1405,7 @@ def print_new_line(new_status):
msg = "Reached branch %s which has no successor" \
if cb == managed_branches[-1] else \
"No successor of %s needs sync with upstream branch or remote"
sys.stderr.write(msg % bold(cb) + "; nothing left to update\n")
sys.stdout.write(msg % bold(cb) + "; nothing left to update\n")


def status():
Expand Down Expand Up @@ -1919,7 +1918,7 @@ def usage(c=None):
for cm in cmds:
alias = (", " + aliases[cm]) if cm in aliases else ""
print(" %s%-18s%s%s" % (BOLD, cm + alias, ENDC, short_docs[cm]))
sys.stderr.write("\n")
sys.stdout.write("\n")
print(textwrap.dedent("""
%s\n
--debug Log detailed diagnostic info, including outputs of the executed git commands.
Expand All @@ -1934,7 +1933,7 @@ def short_usage():


def version():
print('git-machete version ' + VERSION)
print('git-machete version ' + __version__)


def main():
Expand Down Expand Up @@ -2184,6 +2183,9 @@ def parse_direction(b, down_pick_mode):
except MacheteException as e:
sys.stderr.write(str(e) + "\n")
sys.exit(1)
except KeyboardInterrupt:
sys.stderr.write("Interrupted by the user\n")
sys.exit(1)
except StopTraversal:
pass

Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[metadata]
name = git-machete
version = 2.12.2
summary = Probably the sharpest git repository organizer & rebase workflow automation tool you've ever seen ;)
description-file = README.md
long-description-content-type = text/markdown
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python

from git_machete import __version__
import setuptools

setuptools.setup(setup_requires=['pbr'], pbr=True)
setuptools.setup(setup_requires=['pbr'], pbr=True, version=__version__)
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = pep8,py27,py36
envlist = pep8,py27,py36,py38
minversion = 2.3.2
skipsdist = True

Expand All @@ -23,7 +23,7 @@ commands = flake8
commands = {posargs}

[flake8]
# E501 ignore line longer than 80 until code is refactored
# E501 ignore line longer than 80
# W504 ignore wrap line after binary operator
ignore = E501,W504
show-source = True
Expand Down

0 comments on commit 46a8abf

Please sign in to comment.