mirror of
https://github.com/mhagger/git-imerge.git
synced 2024-08-16 18:40:24 +03:00
Add setup.py script to build the package using setuptools
Setuptools is a fully-featured, actively-maintained, and stable library designed to facilitate packaging Python projects. It is the standard library used to create Python packages by the community. The setup.py script allows building an sdist package and a wheel package. Installing the package with setuptools installs a gitimerge.py module and a git-imerge command line script. A tox configuration was added to automate testing in a virtualenv. The README has been updated with new installation and testing instructions.
This commit is contained in:
parent
002b8bd9df
commit
1c14b8a22f
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,7 @@
|
|||||||
|
*.egg-info/
|
||||||
*.pyc
|
*.pyc
|
||||||
*.pyo
|
*.pyo
|
||||||
|
.tox/
|
||||||
/*.html
|
/*.html
|
||||||
|
build/
|
||||||
|
dist/
|
||||||
|
7
MANIFEST.in
Normal file
7
MANIFEST.in
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
include completions/git-imerge
|
||||||
|
include COPYING
|
||||||
|
include t/create-test-repo
|
||||||
|
include t/test-conflicted
|
||||||
|
include t/test-drop
|
||||||
|
include t/test-unconflicted
|
||||||
|
include tox.ini
|
14
Makefile
14
Makefile
@ -1,7 +1,3 @@
|
|||||||
|
|
||||||
BIN=git-imerge
|
|
||||||
PREFIX=/usr/local
|
|
||||||
|
|
||||||
RST := \
|
RST := \
|
||||||
README.rst \
|
README.rst \
|
||||||
TODO.rst
|
TODO.rst
|
||||||
@ -20,13 +16,3 @@ html: $(module)/talk.html
|
|||||||
|
|
||||||
$(module)/talk.html: $(module)/talk.rst
|
$(module)/talk.html: $(module)/talk.rst
|
||||||
rst2s5 --theme=small-white --current-slide $< $@
|
rst2s5 --theme=small-white --current-slide $< $@
|
||||||
|
|
||||||
install: $(BIN)
|
|
||||||
@mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
||||||
install $(BIN) $(DESTDIR)$(PREFIX)/bin
|
|
||||||
@mkdir -p $(DESTDIR)/etc/bash_completion.d
|
|
||||||
cp -f git-imerge.bashcomplete $(DESTDIR)/etc/bash_completion.d/git-imerge
|
|
||||||
|
|
||||||
uninstall:
|
|
||||||
rm $(DESTDIR)$(PREFIX)/bin/$(BIN)
|
|
||||||
rm -f $(DESTDIR)/etc/bash_completion.d/git-imerge
|
|
||||||
|
41
README.rst
41
README.rst
@ -48,9 +48,8 @@ command.
|
|||||||
An incremental merge can be interrupted and resumed arbitrarily, or
|
An incremental merge can be interrupted and resumed arbitrarily, or
|
||||||
even pushed to a server to allow somebody else to work on it.
|
even pushed to a server to allow somebody else to work on it.
|
||||||
|
|
||||||
``git-imerge`` comes with a Bash completion script. It can be installed
|
``git-imerge`` comes with a Bash completion script, ``completions/git-imerge``,
|
||||||
by copying ``git-imerge.bashcomplete`` to the place where usually completion
|
that is installed automatically when installing ``git-imerge``.
|
||||||
scripts are installed on your system, e.g. /etc/bash_completion.d/.
|
|
||||||
|
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
@ -66,16 +65,24 @@ Requirements
|
|||||||
|
|
||||||
* Python 3.x, version 3.3 or later.
|
* Python 3.x, version 3.3 or later.
|
||||||
|
|
||||||
The script tries to use a Python interpreter called ``python`` in
|
|
||||||
your ``PATH``. If your Python interpreter has a different name or
|
|
||||||
is not in your ``PATH``, please adjust the first line of the script
|
|
||||||
accordingly.
|
|
||||||
|
|
||||||
* A recent version of Git.
|
* A recent version of Git.
|
||||||
|
|
||||||
Bash completion requires Git's completion being available.
|
Bash completion requires Git's completion being available.
|
||||||
|
|
||||||
|
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
``git-imerge`` is available on PyPI_, so you can install it with ``pip``::
|
||||||
|
|
||||||
|
$ pip install git-imerge
|
||||||
|
|
||||||
|
|
||||||
|
or using ``setup.py`` if you have downloaded the source package locally::
|
||||||
|
|
||||||
|
$ python setup.py install
|
||||||
|
|
||||||
|
|
||||||
Instructions
|
Instructions
|
||||||
============
|
============
|
||||||
|
|
||||||
@ -399,6 +406,22 @@ line or change the default in your configuration::
|
|||||||
git config --global imerge.editmergemessages true
|
git config --global imerge.editmergemessages true
|
||||||
|
|
||||||
|
|
||||||
|
Testing
|
||||||
|
=======
|
||||||
|
|
||||||
|
``git-imerge`` uses tox_ to run tests. To run the test suite with the system's
|
||||||
|
default Python::
|
||||||
|
|
||||||
|
$ tox
|
||||||
|
|
||||||
|
To run with a specific Python version, such as 3.7, pass the ``-e`` argument to
|
||||||
|
tox::
|
||||||
|
|
||||||
|
$ tox -e py37
|
||||||
|
|
||||||
|
.. _tox: https://tox.readthedocs.io/
|
||||||
|
|
||||||
|
|
||||||
License
|
License
|
||||||
=======
|
=======
|
||||||
|
|
||||||
@ -423,5 +446,3 @@ References
|
|||||||
* http://softwareswirl.blogspot.com/2009/04/truce-in-merge-vs-rebase-war.html
|
* http://softwareswirl.blogspot.com/2009/04/truce-in-merge-vs-rebase-war.html
|
||||||
* http://softwareswirl.blogspot.com/2009/08/upstream-rebase-just-works-if-history.html
|
* http://softwareswirl.blogspot.com/2009/08/upstream-rebase-just-works-if-history.html
|
||||||
* http://softwareswirl.blogspot.com/2009/08/rebase-with-history-implementation.html
|
* http://softwareswirl.blogspot.com/2009/08/rebase-with-history-implementation.html
|
||||||
|
|
||||||
|
|
||||||
|
7
git-imerge → gitimerge.py
Executable file → Normal file
7
git-imerge → gitimerge.py
Executable file → Normal file
@ -1,4 +1,3 @@
|
|||||||
#! /usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright 2012-2013 Michael Haggerty <mhagger@alum.mit.edu>
|
# Copyright 2012-2013 Michael Haggerty <mhagger@alum.mit.edu>
|
||||||
@ -4137,11 +4136,15 @@ def main(args):
|
|||||||
parser.error('Unrecognized subcommand')
|
parser.error('Unrecognized subcommand')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def climain():
|
||||||
try:
|
try:
|
||||||
main(sys.argv[1:])
|
main(sys.argv[1:])
|
||||||
except Failure as e:
|
except Failure as e:
|
||||||
sys.exit(str(e))
|
sys.exit(str(e))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
climain()
|
||||||
|
|
||||||
|
|
||||||
# vim: set expandtab ft=python:
|
# vim: set expandtab ft=python:
|
44
setup.py
Normal file
44
setup.py
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import errno
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
data_files = []
|
||||||
|
try:
|
||||||
|
completionsdir = subprocess.check_output(
|
||||||
|
["pkg-config", "--variable=completionsdir", "bash-completion"]
|
||||||
|
)
|
||||||
|
except OSError as e:
|
||||||
|
if e.errno != errno.ENOENT:
|
||||||
|
raise
|
||||||
|
else:
|
||||||
|
completionsdir = completionsdir.strip().decode('utf-8')
|
||||||
|
if completionsdir:
|
||||||
|
data_files.append((completionsdir, ["completions/git-imerge"]))
|
||||||
|
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="gitimerge",
|
||||||
|
description="Incremental merge for git",
|
||||||
|
url="https://github.com/mhagger/git-imerge",
|
||||||
|
author="Michael Haggerty",
|
||||||
|
author_email="mhagger@alum.mit.edu",
|
||||||
|
license="GPLv2+",
|
||||||
|
version="1.1.0",
|
||||||
|
py_modules=["gitimerge"],
|
||||||
|
data_files=data_files,
|
||||||
|
entry_points={"console_scripts": ["git-imerge = gitimerge:climain"]},
|
||||||
|
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
|
||||||
|
classifiers=[
|
||||||
|
"Development Status :: 5 - Production/Stable",
|
||||||
|
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
|
||||||
|
"Programming Language :: Python",
|
||||||
|
"Programming Language :: Python :: 2",
|
||||||
|
"Programming Language :: Python :: 2.7",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.4",
|
||||||
|
"Programming Language :: Python :: 3.5",
|
||||||
|
"Programming Language :: Python :: 3.6",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
|
],
|
||||||
|
)
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
BASE="$(dirname "$(cd $(dirname "$0") && pwd)")"
|
BASE="$(dirname "$(cd $(dirname "$0") && pwd)")"
|
||||||
TMP="$BASE/t/tmp/main"
|
TMP="$BASE/t/tmp/main"
|
||||||
GIT_IMERGE="$BASE/git-imerge"
|
GIT_IMERGE="git-imerge"
|
||||||
|
|
||||||
cd "$TMP"
|
cd "$TMP"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ set -x
|
|||||||
|
|
||||||
BASE="$(dirname "$(cd $(dirname "$0") && pwd)")"
|
BASE="$(dirname "$(cd $(dirname "$0") && pwd)")"
|
||||||
TMP="$BASE/t/tmp/main"
|
TMP="$BASE/t/tmp/main"
|
||||||
GIT_IMERGE="$BASE/git-imerge"
|
GIT_IMERGE="git-imerge"
|
||||||
|
|
||||||
cd "$TMP"
|
cd "$TMP"
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ modify() {
|
|||||||
|
|
||||||
BASE="$(dirname "$(cd $(dirname "$0") && pwd)")"
|
BASE="$(dirname "$(cd $(dirname "$0") && pwd)")"
|
||||||
TMP="$BASE/t/tmp/drop"
|
TMP="$BASE/t/tmp/drop"
|
||||||
GIT_IMERGE="$BASE/git-imerge"
|
GIT_IMERGE="git-imerge"
|
||||||
|
|
||||||
rm -rf "$TMP"
|
rm -rf "$TMP"
|
||||||
mkdir -p "$TMP"
|
mkdir -p "$TMP"
|
||||||
|
@ -7,7 +7,7 @@ set -x
|
|||||||
|
|
||||||
BASE="$(dirname "$(cd $(dirname "$0") && pwd)")"
|
BASE="$(dirname "$(cd $(dirname "$0") && pwd)")"
|
||||||
TMP="$BASE/t/tmp/main"
|
TMP="$BASE/t/tmp/main"
|
||||||
GIT_IMERGE="$BASE/git-imerge"
|
GIT_IMERGE="git-imerge"
|
||||||
|
|
||||||
cd "$TMP"
|
cd "$TMP"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user