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
 *.pyc
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
 include Makefile
2
 include Makefile
3
 include README.rst
3
 include README.rst
4
 include tests/*
4
 include tests/*
5
+exclude cdiff

+ 2
- 1
Makefile View File

21
 	python3 src/cdiff.py tests/$@.diff | diff -u tests/$@.diff -
21
 	python3 src/cdiff.py tests/$@.diff | diff -u tests/$@.diff -
22
 
22
 
23
 clean:
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
 dist-test:
27
 dist-test:
27
 	./setup.py build sdist upload -r $(TESTPYPI)
28
 	./setup.py build sdist upload -r $(TESTPYPI)

+ 9
- 6
README.rst View File

16
 Installation
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
 install with ``pip`` if you have the tool.
23
 install with ``pip`` if you have the tool.
23
 
24
 
24
 .. code:: sh
25
 .. code:: sh
25
  
26
  
26
     sudo pip install cdiff
27
     sudo pip install cdiff
27
 
28
 
28
-**Install with setup.py**
29
+Install with setup.py
30
+~~~~~~~~~~~~~~~~~~~~~
29
 
31
 
30
 You can also run the setup.py from the source if you don't have ``pip``.
32
 You can also run the setup.py from the source if you don't have ``pip``.
31
 
33
 
35
     cd cdiff
37
     cd cdiff
36
     sudo ./setup.py install
38
     sudo ./setup.py install
37
 
39
 
38
-**Download directly**
40
+Download directly
41
+~~~~~~~~~~~~~~~~~
39
 
42
 
40
 Both ``pip`` and ``setup.py`` installs cdiff to system wide directory, if you
43
 Both ``pip`` and ``setup.py`` installs cdiff to system wide directory, if you
41
 want a minimal tool without the boring external dependencies (like me), just
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
 in my ``$PATH``, so I save the script there and name as ``cdiff``.
47
 in my ``$PATH``, so I save the script there and name as ``cdiff``.
45
 
48
 
46
 .. code:: sh
49
 .. code:: sh

+ 4
- 4
setup.py View File

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