Skip to content

Commit

Permalink
Use wrapper cdiff instead of symlink for future unit test; doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
ymattw committed Feb 16, 2013
1 parent 3b26195 commit 329760c
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 17 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
*.pyc
*~
/MANIFEST
/cdiff
/build/
/cdiff.egg-info/
/dist/
Expand Down
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Change log
==========

Version 0.4 (2013-02-16)

- New option *-c WHEN* (*--color WHEN*) to support auto test
- Auto regression test now on Travis

Version 0.3 (2013-02-07)

- Support compare two files (wrapper of diff)
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ include Makefile
include README.rst
include tests/*
include tests/*/*
exclude cdiff
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test:
tests/regression.sh

clean:
rm -f cdiff MANIFEST
rm -f MANIFEST
rm -rf build/ cdiff.egg-info/ dist/ __pycache__/

build:
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ install with ``pip`` if you have the tool.

.. code:: sh
sudo pip install cdiff
pip install --upgrade cdiff
Install with setup.py
~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -40,7 +40,7 @@ You can also run the setup.py from the source if you don't have ``pip``.
git clone https://github.com/ymattw/cdiff.git
cd cdiff
sudo ./setup.py install
./setup.py install
Download directly
~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -102,7 +102,7 @@ Redirect output to another patch file is safe:

.. code:: sh
svn diff | cdiff -s > my.patch
svn diff -r PREV | cdiff -s > my.patch
Notes
-----
Expand Down
12 changes: 12 additions & 0 deletions cdiff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import cdiff

try:
sys.exit(cdiff.main())
except:
sys.exit(1)

# vim:set et sts=4 sw=4 tw=80:
5 changes: 2 additions & 3 deletions cdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""

META_INFO = {
'version' : '0.3',
'version' : '0.4',
'license' : 'BSD-3',
'author' : 'Matthew Wang',
'email' : 'mattwyl(@)gmail(.)com',
Expand All @@ -22,8 +22,7 @@
import sys

if sys.hexversion < 0x02050000:
sys.stderr.write("*** Requires python >= 2.5.0\n")
sys.exit(1)
raise SystemExit("*** Requires python >= 2.5.0")
IS_PY3 = sys.hexversion >= 0x03000000

import os
Expand Down
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import with_statement
from distutils.core import setup
import os
from cdiff import META_INFO as _meta

# Create symlink so that to use 'scripts' w/o '.py'
link_name = 'cdiff'
if os.path.exists(link_name):
os.unlink(link_name)
os.symlink('cdiff.py', link_name)
import sys
if sys.hexversion < 0x02050000:
raise SystemExit("*** Requires python >= 2.5.0")

with open('README.rst') as doc:
long_description = doc.read()
Expand Down Expand Up @@ -37,7 +36,8 @@
'Operating System :: Unix',
'Programming Language :: Python',
],
packages = [],
py_modules = ['cdiff'],
scripts = [link_name],
scripts = ['cdiff'],
)

# vim:set et sts=4 sw=4 tw=80:
2 changes: 1 addition & 1 deletion tests/regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -o errexit

SELF_DIR=$(cd $(dirname $0) && pwd) || exit 1
CDIFF=$SELF_DIR/../cdiff.py
CDIFF=$SELF_DIR/../cdiff

function pass()
{
Expand Down

0 comments on commit 329760c

Please sign in to comment.