Browse Source

create symlink in top dir for clean src; doc fix

Matthew Wang 11 years ago
parent
commit
f623f2e844
5 changed files with 21 additions and 15 deletions
  1. 5
    4
      .gitignore
  2. 1
    0
      MANIFEST.in
  3. 2
    1
      Makefile
  4. 9
    6
      README.rst
  5. 4
    4
      setup.py

+ 5
- 4
.gitignore View File

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

+ 1
- 0
MANIFEST.in View File

@@ -2,3 +2,4 @@ include LICENSE
2 2
 include Makefile
3 3
 include README.rst
4 4
 include tests/*
5
+exclude cdiff

+ 2
- 1
Makefile View File

@@ -21,7 +21,8 @@ $(TESTS):
21 21
 	python3 src/cdiff.py tests/$@.diff | diff -u tests/$@.diff -
22 22
 
23 23
 clean:
24
-	rm -rf src/cdiff MANIFEST build/ cdiff.egg-info/ dist/
24
+	rm -f cdiff MANIFEST
25
+	rm -rf build/ cdiff.egg-info/ dist/
25 26
 
26 27
 dist-test:
27 28
 	./setup.py build sdist upload -r $(TESTPYPI)

+ 9
- 6
README.rst View File

@@ -16,16 +16,18 @@ with **auto pager**.  Requires python (>= 2.5.0) and ``less``.
16 16
 Installation
17 17
 ------------
18 18
 
19
-**Install with pip**
19
+Install with pip
20
+~~~~~~~~~~~~~~~~
20 21
 
21
-Cdiff is already listed on `PyPI <http://pypi.python.org/pypi/cdiff>`, you can
22
+Cdiff is already listed on `PyPI <http://pypi.python.org/pypi/cdiff>`_, you can
22 23
 install with ``pip`` if you have the tool.
23 24
 
24 25
 .. code:: sh
25 26
  
26 27
     sudo pip install cdiff
27 28
 
28
-**Install with setup.py**
29
+Install with setup.py
30
+~~~~~~~~~~~~~~~~~~~~~
29 31
 
30 32
 You can also run the setup.py from the source if you don't have ``pip``.
31 33
 
@@ -35,12 +37,13 @@ You can also run the setup.py from the source if you don't have ``pip``.
35 37
     cd cdiff
36 38
     sudo ./setup.py install
37 39
 
38
-**Download directly**
40
+Download directly
41
+~~~~~~~~~~~~~~~~~
39 42
 
40 43
 Both ``pip`` and ``setup.py`` installs cdiff to system wide directory, if you
41 44
 want a minimal tool without the boring external dependencies (like me), just
42
-save `src/cdiff.py <https://raw.github.com/ymattw/cdiff/master/src/cdiff.py>` to
43
-whatever directory which is in your ``$PATH``, for example, ``$HOME/bin`` is
45
+save `src/cdiff.py <https://raw.github.com/ymattw/cdiff/master/src/cdiff.py>`_
46
+to whatever directory which is in your ``$PATH``, for example, ``$HOME/bin`` is
44 47
 in my ``$PATH``, so I save the script there and name as ``cdiff``.
45 48
 
46 49
 .. code:: sh

+ 4
- 4
setup.py View File

@@ -5,17 +5,17 @@ from distutils.core import setup
5 5
 import os
6 6
 
7 7
 # Create symlink so that to use 'scripts' w/o '.py'
8
-link_name = 'src/cdiff'
8
+link_name = 'cdiff'
9 9
 if os.path.exists(link_name):
10 10
     os.unlink(link_name)
11
-os.symlink('cdiff.py', 'src/cdiff')
11
+os.symlink('src/cdiff.py', link_name)
12 12
 
13 13
 with open('README.rst') as doc:
14 14
     long_description = doc.read()
15 15
 
16 16
 setup(
17 17
     name = 'cdiff',
18
-    version = '0.0.2',
18
+    version = '0.0.3',
19 19
     author = 'Matthew Wang',
20 20
     author_email = 'mattwyl@gmail.com',
21 21
     license = 'BSD-3',
@@ -38,5 +38,5 @@ setup(
38 38
     package_dir = {'': 'src'},
39 39
     packages = [''],
40 40
     py_modules = ['cdiff'],
41
-    scripts = ['src/cdiff'],
41
+    scripts = [link_name],
42 42
 )