Skip to content

Commit 4ed24ae

Browse files
authored
Merge pull request #49 from matiasb/preparing-0.5.5
Minor updates preparing release.
2 parents 2e3b11a + 7638839 commit 4ed24ae

File tree

15 files changed

+117
-37
lines changed

15 files changed

+117
-37
lines changed

AUTHORS

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@ Contributors
1414
* Philipp Kewisch (`@kewisch`_)
1515
* Allan Lewis (`@allanlewis`_)
1616
* Andrew Lapidas (`@alapidas`_)
17-
* Daniel Thompson (`@daniel-thompson`)
18-
* Sebastian Kreft (`@sk-`)
17+
* Daniel Thompson (`@daniel-thompson`_)
18+
* Sebastian Kreft (`@sk-`_)
19+
* Thomas Grainger (`@graingert`_)
20+
* (`snake-scaly`_)
21+
* Dan Callaghan (`@danc86`_)
22+
* Max Bittker (`@MaxBittker`_)
23+
* Volo Zyko (`@volo-zyko`_)

HISTORY

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
History
22
-------
33

4+
0.5.5 - 2018-01-03
5+
------------------
6+
7+
* Updated PatchSet constructor to accept string data.
8+
* Added support to parse extended patch info.
9+
410
0.5.4 - 2017-05-26
511
------------------
612

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ include bin/*
22
include tests/samples/*
33
include HISTORY
44
include LICENSE
5-
include README.md
5+
include README.rst

README.md renamed to README.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@ Unidiff
33

44
Simple Python library to parse and interact with unified diff data.
55

6-
[![Build Status](https://travis-ci.org/matiasb/python-unidiff.png?branch=master)](https://travis-ci.org/matiasb/python-unidiff)
7-
6+
.. image:: https://travis-ci.org/matiasb/python-unidiff.svg?branch=master
7+
:target: https://travis-ci.org/matiasb/python-unidiff
88

99
Installing unidiff
1010
------------------
1111

12+
::
13+
1214
$ pip install unidiff
1315

1416

1517
Quick start
1618
-----------
1719

20+
::
21+
1822
>>> import urllib2
1923
>>> from unidiff import PatchSet
2024
>>> diff = urllib2.urlopen('https://github.com/matiasb/python-unidiff/pull/3.diff')
@@ -41,11 +45,11 @@ Quick start
4145
>>> print patch[2]
4246
--- a/unidiff/utils.py
4347
+++ b/unidiff/utils.py
44-
@@ -37,4 +37,3 @@
48+
@@ -37,4 +37,3 @@
4549
# - deleted line
4650
# \ No newline case (ignore)
4751
RE_HUNK_BODY_LINE = re.compile(r'^([- \+\\])')
48-
-
52+
4953

5054
Load unified diff data by instantiating PatchSet with a file-like object as
5155
argument, or using PatchSet.from_filename class method to read diff from file.
@@ -63,6 +67,8 @@ As a quick example of what can be done, check bin/unidiff file.
6367
Also, once installed, unidiff provides a command-line program that displays
6468
information from diff data (a file, or stdin). For example:
6569

70+
::
71+
6672
$ git diff | unidiff
6773
Summary
6874
-------
@@ -77,13 +83,17 @@ Load a local diff file
7783

7884
To instantiate PatchSet from a local file, you can use:
7985

86+
::
87+
8088
>>> from unidiff import PatchSet
8189
>>> patch = PatchSet.from_filename('tests/samples/bzr.diff', encoding='utf-8')
8290
>>> patch
8391
<PatchSet: [<PatchedFile: added_file>, <PatchedFile: modified_file>, <PatchedFile: removed_file>]>
8492

8593
Notice the (optional) encoding parameter. If not specified, unicode input will be expected. Or alternatively:
8694

95+
::
96+
8797
>>> import codecs
8898
>>> from unidiff import PatchSet
8999
>>> with codecs.open('tests/samples/bzr.diff', 'r', encoding='utf-8') as diff:
@@ -94,6 +104,8 @@ Notice the (optional) encoding parameter. If not specified, unicode input will b
94104

95105
Finally, you can also instantiate PatchSet passing any iterable (and encoding, if needed):
96106

107+
::
108+
97109
>>> from unidiff import PatchSet
98110
>>> with open('tests/samples/bzr.diff', 'r') as diff:
99111
... data = diff.readlines()
@@ -106,5 +118,5 @@ Finally, you can also instantiate PatchSet passing any iterable (and encoding, i
106118
References
107119
----------
108120

109-
* http://en.wikipedia.org/wiki/Diff_utility
110-
* http://www.artima.com/weblogs/viewpost.jsp?thread=164293
121+
* http://en.wikipedia.org/wiki/Diff_utility
122+
* http://www.artima.com/weblogs/viewpost.jsp?thread=164293

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[bdist_wheel]
22
universal=1
3+
4+
[metadata]
5+
license_file = LICENSE

setup.py

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
11
# -*- coding: utf-8 -*-
22
# Author: Matías Bordese
33

4-
from __future__ import unicode_literals
4+
import codecs
5+
import os
56

6-
from setuptools import setup, find_packages
7+
from setuptools import find_packages, setup
8+
9+
10+
# metadata
11+
NAME = 'unidiff'
12+
DESCRIPTION = 'Unified diff parsing/metadata extraction library.'
13+
KEYWORDS = ['unified', 'diff', 'parse', 'metadata']
14+
URL = 'http://github.com/matiasb/python-unidiff'
15+
EMAIL = 'mbordese@gmail.com'
16+
AUTHOR = 'Matias Bordese'
17+
LICENSE = 'MIT'
18+
19+
HERE = os.path.abspath(os.path.dirname(__file__))
20+
21+
# use README as the long-description
22+
with codecs.open(os.path.join(HERE, 'README.rst'), "rb", "utf-8") as f:
23+
long_description = f.read()
24+
25+
26+
# load __version__.py module as a dictionary
27+
about = {}
28+
with open(os.path.join(HERE, 'unidiff/__version__.py')) as f:
29+
exec(f.read(), about)
730

8-
from unidiff import VERSION
931

1032
setup(
11-
name='unidiff',
12-
version=VERSION,
13-
description="Unified diff parsing/metadata extraction library.",
14-
keywords='unified diff parse metadata',
15-
author='Matias Bordese',
16-
author_email='mbordese@gmail.com',
17-
url='http://github.com/matiasb/python-unidiff',
18-
license='MIT',
19-
packages=find_packages(exclude=['tests']),
33+
name=NAME,
34+
version=about['__version__'],
35+
description=DESCRIPTION,
36+
long_description=long_description,
37+
keywords=KEYWORDS,
38+
author=AUTHOR,
39+
author_email=EMAIL,
40+
url=URL,
41+
packages=find_packages(exclude=('tests',)),
2042
scripts=['bin/unidiff'],
43+
include_package_data=True,
44+
license=LICENSE,
2145
classifiers=[
2246
'Intended Audience :: Developers',
2347
'Development Status :: 4 - Beta',
@@ -26,6 +50,7 @@
2650
'Programming Language :: Python :: 3',
2751
'Programming Language :: Python :: 3.3',
2852
'Programming Language :: Python :: 3.4',
53+
'Programming Language :: Python :: 3.5',
54+
'Programming Language :: Python :: 3.6',
2955
],
30-
test_suite='tests',
3156
)

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# The MIT License (MIT)
2-
# Copyright (c) 2014 Matias Bordese
2+
# Copyright (c) 2014-2017 Matias Bordese
33
#
44
# Permission is hereby granted, free of charge, to any person obtaining a copy
55
# of this software and associated documentation files (the "Software"), to deal

tests/test_hunks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
# The MIT License (MIT)
4-
# Copyright (c) 2014 Matias Bordese
4+
# Copyright (c) 2014-2017 Matias Bordese
55
#
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
77
# of this software and associated documentation files (the "Software"), to deal

tests/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
# The MIT License (MIT)
4-
# Copyright (c) 2014 Matias Bordese
4+
# Copyright (c) 2014-2017 Matias Bordese
55
#
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
77
# of this software and associated documentation files (the "Software"), to deal

tests/test_patchedfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
# The MIT License (MIT)
4-
# Copyright (c) 2014 Matias Bordese
4+
# Copyright (c) 2014-2017 Matias Bordese
55
#
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
77
# of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)