-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
87 lines (72 loc) · 2.6 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# A setuptools-based setup module for the project.
#
import ast
import re
from setuptools import setup
# Utility function to read the contents of the given file.
def read_file(file_path):
with open(file_path) as f:
return f.read()
# Utility function to return the project version from the git-edit-index file.
def get_project_version():
return ast.literal_eval(
re.search(
r'__version__\s+=\s+(.*)',
read_file('git-edit-index')
).group(1)
)
setup(
name='git-edit-index',
version=get_project_version(),
description=(
'A git command that opens an editor to stage or unstage files.'
),
long_description="""
This command represents a faster alternative to ``git add -i`` or ``git gui``.
It allows you to stage or unstage files from the index in an editor, just like
when you perform an interactive rebase.
For example, let's assume you have the following three modified files (``git
status --short``):
.. code-block:: text
M path/to/file1
M another/path/to/file2
M yet/another/path/to/file3
After running ``git edit-index``, an editor will show up with the above output.
To stage (add) the first two files, simply change the text to
.. code-block:: text
A path/to/file1
A another/path/to/file2
M yet/another/path/to/file3
The supported statuses are ``M``, ``A``, ``D``, and ``?``. They allow you to
not only stage files but also unstage them, delete them, or revert changes done
to them since the last commit.
See the `project's homepage <https://github.com/s3rvac/git-edit-index>`_ for
more information.
""".strip(),
author='Petr Zemek',
author_email='[email protected]',
url='https://github.com/s3rvac/git-edit-index',
license=read_file('LICENSE'),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Version Control',
],
keywords='git editor index staging unstaging',
py_modules=[],
scripts=[
'git-edit-index'
]
)