Sfoglia il codice sorgente

Use wrapper `cdiff` instead of symlink for future unit test; doc update

Matthew Wang 11 anni fa
parent
commit
329760c5c8
9 ha cambiato i file con 31 aggiunte e 17 eliminazioni
  1. 0
    1
      .gitignore
  2. 5
    0
      CHANGES
  3. 0
    1
      MANIFEST.in
  4. 1
    1
      Makefile
  5. 3
    3
      README.rst
  6. 12
    0
      cdiff
  7. 2
    3
      cdiff.py
  8. 7
    7
      setup.py
  9. 1
    1
      tests/regression.sh

+ 0
- 1
.gitignore Vedi File

1
 *.pyc
1
 *.pyc
2
 *~
2
 *~
3
 /MANIFEST
3
 /MANIFEST
4
-/cdiff
5
 /build/
4
 /build/
6
 /cdiff.egg-info/
5
 /cdiff.egg-info/
7
 /dist/
6
 /dist/

+ 5
- 0
CHANGES Vedi File

2
 Change log
2
 Change log
3
 ==========
3
 ==========
4
 
4
 
5
+Version 0.4 (2013-02-16)
6
+
7
+  - New option *-c WHEN* (*--color WHEN*) to support auto test
8
+  - Auto regression test now on Travis
9
+
5
 Version 0.3 (2013-02-07)
10
 Version 0.3 (2013-02-07)
6
 
11
 
7
   - Support compare two files (wrapper of diff)
12
   - Support compare two files (wrapper of diff)

+ 0
- 1
MANIFEST.in Vedi File

4
 include README.rst
4
 include README.rst
5
 include tests/*
5
 include tests/*
6
 include tests/*/*
6
 include tests/*/*
7
-exclude cdiff

+ 1
- 1
Makefile Vedi File

13
 	tests/regression.sh
13
 	tests/regression.sh
14
 
14
 
15
 clean:
15
 clean:
16
-	rm -f cdiff MANIFEST
16
+	rm -f MANIFEST
17
 	rm -rf build/ cdiff.egg-info/ dist/ __pycache__/
17
 	rm -rf build/ cdiff.egg-info/ dist/ __pycache__/
18
 
18
 
19
 build:
19
 build:

+ 3
- 3
README.rst Vedi File

29
 
29
 
30
 .. code:: sh
30
 .. code:: sh
31
  
31
  
32
-    sudo pip install cdiff
32
+    pip install --upgrade cdiff
33
 
33
 
34
 Install with setup.py
34
 Install with setup.py
35
 ~~~~~~~~~~~~~~~~~~~~~
35
 ~~~~~~~~~~~~~~~~~~~~~
40
 
40
 
41
     git clone https://github.com/ymattw/cdiff.git
41
     git clone https://github.com/ymattw/cdiff.git
42
     cd cdiff
42
     cd cdiff
43
-    sudo ./setup.py install
43
+    ./setup.py install
44
 
44
 
45
 Download directly
45
 Download directly
46
 ~~~~~~~~~~~~~~~~~
46
 ~~~~~~~~~~~~~~~~~
102
 
102
 
103
 .. code:: sh
103
 .. code:: sh
104
 
104
 
105
-    svn diff | cdiff -s > my.patch
105
+    svn diff -r PREV | cdiff -s > my.patch
106
 
106
 
107
 Notes
107
 Notes
108
 -----
108
 -----

+ 12
- 0
cdiff Vedi File

1
+#!/usr/bin/env python
2
+# -*- coding: utf-8 -*-
3
+
4
+import sys
5
+import cdiff
6
+
7
+try:
8
+    sys.exit(cdiff.main())
9
+except:
10
+    sys.exit(1)
11
+
12
+# vim:set et sts=4 sw=4 tw=80:

+ 2
- 3
cdiff.py Vedi File

8
 """
8
 """
9
 
9
 
10
 META_INFO = {
10
 META_INFO = {
11
-    'version'     : '0.3',
11
+    'version'     : '0.4',
12
     'license'     : 'BSD-3',
12
     'license'     : 'BSD-3',
13
     'author'      : 'Matthew Wang',
13
     'author'      : 'Matthew Wang',
14
     'email'       : 'mattwyl(@)gmail(.)com',
14
     'email'       : 'mattwyl(@)gmail(.)com',
22
 import sys
22
 import sys
23
 
23
 
24
 if sys.hexversion < 0x02050000:
24
 if sys.hexversion < 0x02050000:
25
-    sys.stderr.write("*** Requires python >= 2.5.0\n")
26
-    sys.exit(1)
25
+    raise SystemExit("*** Requires python >= 2.5.0")
27
 IS_PY3 = sys.hexversion >= 0x03000000
26
 IS_PY3 = sys.hexversion >= 0x03000000
28
 
27
 
29
 import os
28
 import os

+ 7
- 7
setup.py Vedi File

1
 #!/usr/bin/env python
1
 #!/usr/bin/env python
2
+# -*- coding: utf-8 -*-
2
 
3
 
3
 from __future__ import with_statement
4
 from __future__ import with_statement
4
 from distutils.core import setup
5
 from distutils.core import setup
5
 import os
6
 import os
6
 from cdiff import META_INFO as _meta
7
 from cdiff import META_INFO as _meta
7
 
8
 
8
-# Create symlink so that to use 'scripts' w/o '.py'
9
-link_name = 'cdiff'
10
-if os.path.exists(link_name):
11
-    os.unlink(link_name)
12
-os.symlink('cdiff.py', link_name)
9
+import sys
10
+if sys.hexversion < 0x02050000:
11
+    raise SystemExit("*** Requires python >= 2.5.0")
13
 
12
 
14
 with open('README.rst') as doc:
13
 with open('README.rst') as doc:
15
     long_description = doc.read()
14
     long_description = doc.read()
37
         'Operating System :: Unix',
36
         'Operating System :: Unix',
38
         'Programming Language :: Python',
37
         'Programming Language :: Python',
39
     ],
38
     ],
40
-    packages = [],
41
     py_modules = ['cdiff'],
39
     py_modules = ['cdiff'],
42
-    scripts = [link_name],
40
+    scripts = ['cdiff'],
43
 )
41
 )
42
+
43
+# vim:set et sts=4 sw=4 tw=80:

+ 1
- 1
tests/regression.sh Vedi File

3
 set -o errexit
3
 set -o errexit
4
 
4
 
5
 SELF_DIR=$(cd $(dirname $0) && pwd) || exit 1
5
 SELF_DIR=$(cd $(dirname $0) && pwd) || exit 1
6
-CDIFF=$SELF_DIR/../cdiff.py
6
+CDIFF=$SELF_DIR/../cdiff
7
 
7
 
8
 function pass()
8
 function pass()
9
 {
9
 {