Skip to content

Commit

Permalink
Cleanup: move most pkg metadata info to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ymattw committed Nov 19, 2024
1 parent 58ee95c commit 33a94b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dogfood:
git diff | ./ydiff.py -s

lint:
pycodestyle --ignore=E203,W503,W504 *.py */*.py
pycodestyle --ignore=W503,W504 *.py */*.py

doc-check:
./setup.py --long-description | rst2html.py --strict > /dev/null
Expand Down
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

from setuptools import setup
from ydiff import PKG_INFO
from ydiff import __version__, __homepage__, __description__

with open('README.rst') as doc:
long_description = doc.read()
Expand All @@ -11,13 +11,13 @@

setup(
name='ydiff',
version=PKG_INFO['version'],
author=PKG_INFO['author'],
license=PKG_INFO['license'],
description=PKG_INFO['description'],
version=__version__,
author='Matt Wang',
license='BSD-3',
description=__description__,
long_description=long_description,
keywords=PKG_INFO['keywords'],
url=PKG_INFO['url'],
keywords='colored incremental side-by-side diff',
url=__homepage__,
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down
22 changes: 6 additions & 16 deletions ydiff.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Terminmal based tool to view colored, incremental diffs in a version-controlled
workspace or from stdin, in side-by-side or unified mode, and auto paged.
"""

import difflib
import os
import re
Expand All @@ -15,15 +10,10 @@
import sys
import unicodedata

PKG_INFO = {
'version' : '1.4.2',
'license' : 'BSD-3',
'author' : 'Matt Wang',
'url' : 'https://github.com/ymattw/ydiff',
'keywords' : 'colored incremental side-by-side diff',
'description' : ('View colored, incremental diff in a workspace or from '
'stdin, in side-by-side or unified moded, and auto paged')
}
__version__ = '1.4.2'
__homepage__ = 'https://github.com/ymattw/ydiff'
__description__ = ('View colored, incremental diff in a workspace or from '
'stdin, in side-by-side or unified moded, and auto paged')

if sys.hexversion < 0x03030000:
raise SystemExit('*** Requires python >= 3.3.0') # pragma: no cover
Expand Down Expand Up @@ -756,8 +746,8 @@ def _process_args(self, largs, rargs, values):

usage = """%prog [options] [file|dir ...]"""
parser = _PassThroughOptionParser(
usage=usage, description=PKG_INFO['description'],
version='%%prog %s' % PKG_INFO['version'])
usage=usage, description=__description__,
version='%%prog %s' % __version__)
parser.add_option(
'-s', '--side-by-side', action='store_true', default=True,
help='enable side-by-side mode (default True; DEPRECATED)')
Expand Down

0 comments on commit 33a94b6

Please sign in to comment.