forked from jupyterhub/nbgitpuller
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d234117
commit 35e92c9
Showing
9 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*.pyc | ||
|
||
dist/ | ||
build/ | ||
*.egg-info/ | ||
|
||
.tox/ | ||
.coverage | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
# gitautosync | ||
# gitautosync | ||
|
||
Synchronizes a github repository with a local repository. Automatically deals with conflicts and produces useful output to stdout. | ||
|
||
|
||
# Installation | ||
|
||
If you don't use `pipsi`, you're missing out. | ||
Here are [installation instructions](https://github.com/mitsuhiko/pipsi#readme). | ||
|
||
Simply run: | ||
|
||
$ pipsi install . | ||
|
||
|
||
# Usage | ||
|
||
To use it: | ||
|
||
$ gitautosync --help | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import click | ||
|
||
|
||
@click.command() | ||
@click.option('--as-cowboy', '-c', is_flag=True, help='Greet as a cowboy.') | ||
@click.argument('name', default='world', required=False) | ||
def main(name, as_cowboy): | ||
"""Synchronizes a github repository with a local repository. Automatically deals with conflicts and produces useful output to stdout.""" | ||
greet = 'Howdy' if as_cowboy else 'Hello' | ||
click.echo('{0}, {1}.'.format(greet, name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[wheel] | ||
universal = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
""" | ||
Synchronizes a github repository with a local repository. Automatically deals with conflicts and produces useful output to stdout. | ||
""" | ||
from setuptools import find_packages, setup | ||
|
||
dependencies = ['click'] | ||
|
||
setup( | ||
name='gitautosync', | ||
version='0.0.1', | ||
url='https://github.com/SaladRaider/gitautosync', | ||
license='BSD', | ||
author='Peter Veerman', | ||
author_email='[email protected]', | ||
description='Synchronizes a github repository with a local repository. Automatically deals with conflicts and produces useful output to stdout.', | ||
long_description=__doc__, | ||
packages=find_packages(exclude=['tests']), | ||
include_package_data=True, | ||
zip_safe=False, | ||
platforms='any', | ||
install_requires=dependencies, | ||
entry_points={ | ||
'console_scripts': [ | ||
'gitautosync = gitautosync.cli:main', | ||
], | ||
}, | ||
classifiers=[ | ||
# As from http://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
# 'Development Status :: 1 - Planning', | ||
# 'Development Status :: 2 - Pre-Alpha', | ||
# 'Development Status :: 3 - Alpha', | ||
'Development Status :: 4 - Beta', | ||
# 'Development Status :: 5 - Production/Stable', | ||
# 'Development Status :: 6 - Mature', | ||
# 'Development Status :: 7 - Inactive', | ||
'Environment :: Console', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Operating System :: POSIX', | ||
'Operating System :: MacOS', | ||
'Operating System :: Unix', | ||
'Operating System :: Microsoft :: Windows', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 3', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
from click.testing import CliRunner | ||
from gitautosync import cli | ||
|
||
|
||
@pytest.fixture | ||
def runner(): | ||
return CliRunner() | ||
|
||
|
||
def test_cli(runner): | ||
result = runner.invoke(cli.main) | ||
assert result.exit_code == 0 | ||
assert not result.exception | ||
assert result.output.strip() == 'Hello, world.' | ||
|
||
|
||
def test_cli_with_option(runner): | ||
result = runner.invoke(cli.main, ['--as-cowboy']) | ||
assert not result.exception | ||
assert result.exit_code == 0 | ||
assert result.output.strip() == 'Howdy, world.' | ||
|
||
|
||
def test_cli_with_arg(runner): | ||
result = runner.invoke(cli.main, ['Peter']) | ||
assert result.exit_code == 0 | ||
assert not result.exception | ||
assert result.output.strip() == 'Hello, Peter.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[tox] | ||
envlist=py26, py27, py33, py34, pypy, flake8 | ||
|
||
[testenv] | ||
commands=py.test --cov gitautosync {posargs} | ||
deps= | ||
pytest | ||
pytest-cov | ||
|
||
[testenv:flake8] | ||
basepython = python2.7 | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 gitautosync tests --max-line-length=120 |