Prepared for upstream integration

Migrate build to pbr. Add tox.ini file. Removed debian dir.
This commit is contained in:
Monty Taylor 2014-03-15 08:37:18 -07:00 committed by Darragh Bailey
parent 4a0ae02bec
commit 942de1ae2e
17 changed files with 98 additions and 167 deletions

8
.gitignore vendored
View File

@ -1,9 +1,3 @@
# Packaging
debian/files
debian/*.substvars
debian/*.debhelper.log
debian/*/*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
@ -57,4 +51,4 @@ docs/_build/
# IDE
.idea
.settings
.settings

View File

@ -1,4 +1,4 @@
[gerrit]
host=gerrit.hpcloud.net
host=review.openstack.org
port=29418
project=automation/git-upstream.git
project=openstack-infra/git-upstream.git

View File

@ -19,13 +19,13 @@
import datetime
import argparse
from distutils.command.build import build
from distutils.core import Command
class CreateManpage(Command):
user_options = []
command_name = 'create_manpage'
def initialize_options(self):
from git_upstream import main
@ -129,4 +129,3 @@ class ManPageFormatter(argparse.ArgumentDefaultsHelpFormatter):
def format_usage(self, usage):
return ManPageFormatter._markup(usage)

5
debian/changelog vendored
View File

@ -1,5 +0,0 @@
git-upstream (1.0.0) First public release; urgency=low
* First public hp-upstream release
-- Davide Guerri <davide.guerri@hp.com> Fri, 3 Mar 2014 13:21:30 +0000

1
debian/compat vendored
View File

@ -1 +0,0 @@
7

25
debian/control vendored
View File

@ -1,25 +0,0 @@
Source: git-upstream
Section: vcs
Priority: optional
Maintainer: Davide Guerri <davide.guerri@hp.com>
Build-Depends: debhelper (>= 7.0.50~),
python-all-dev (>= 2.6.6-3~)
Build-Depends-Indep: python-git,
python-setuptools
XS-Python-Version: >=2.6
Standards-Version: 3.9.3
Package: git-upstream
Architecture: all
Section: python
XB-Python-Version: ${python:Versions}
Depends: python-git
${shlibs:Depends},
${misc:Depends},
${python:Depends}
Provides: ${python:Provides}
Description: Git extensions which ease the rebasing of local-carried patches
on top of upstream repositories.
Git extensions to provide high-level abstraction for complex operations
that support the rebasing of local-carried patches on top of upstream
repositories.

43
debian/copyright vendored
View File

@ -1,43 +0,0 @@
Format: http://dep.debian.net/deps/dep5
Source: https://xxx
Files: *
Copyright (c) 2012, 2013, 2014 Hewlett-Packard Development Company, L.P.
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.
Files: git_upstream/subcommand.py git_upstream/version.py git_upstream/commands/__init__.py
Copyright: 2011, 2012 OpenStack LLC.
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
http://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.
Comment:
In the case of git_upstream/version.py and git_upstream/commands/__init__.py only part of
the files are copyright, and as such are marked inline as being taken
from another project.

1
debian/docs vendored
View File

@ -1 +0,0 @@
README

17
debian/rules vendored
View File

@ -1,17 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@ --with python2
override_dh_auto_clean:
dh_auto_clean
rm -rf build/

View File

@ -26,21 +26,19 @@ function test_simple_rebase() {
log DEBUG "Creating a local patch"
cat <<EOP | patch -tsp1 || return 1
diff --git a/setup.py b/setup.py
index 170ec46..251e1dd 100644
index c0a24ea..ebe20bb 100644
--- a/setup.py
+++ b/setup.py
@@ -28,6 +28,8 @@ setup(
version=version.version,
author="Darragh Bailey",
author_email="dbailey@hp.com",
+ maintainer="Davide Guerri",
+ maintainer_email="davide.guerri@hp.com",
description=("Tool supporting HPCloud git workflows."),
license="Proprietary",
keywords="git hpcloud workflow",
@@ -17,5 +17,6 @@
import setuptools
setuptools.setup(
+ terrible_local_idea=True,
setup_requires=['pbr'],
pbr=True)
EOP
git commit -a -m "Add maintainer info" --quiet || return 1
git commit -a -m "Add terrible local patch" --quiet || return 1
git push -u origin master --quiet >/dev/null || return 1
log DEBUG "Cherry picking upstream commits"

View File

@ -58,7 +58,8 @@ TEST_DIR Testing directory. Objects pertaining a test should be
TEST_NAME The name of current test. Extracted from the test filename.
prepare_for_git_upstream() Using the current git-upstream repo, create an
initial onfiguration useful for testing hp-git.
initial configuration useful for testing
git-upstream.
After invoking it a "$TEST_DIR/$REPO_NAME"
## Environment variable used by the test framework
@ -68,4 +69,4 @@ VERBOSITY Set tests verbosity. Valid verbosities are:
LEAVE_DIR If equals to "yes", testing framework won't remove testing
directory. Useful for debugging and to inspect tests
results.
results.

View File

@ -17,7 +17,7 @@
"""
Command-line tool for the HP Cloud workflow
Command-line tool for tracking upstream revisions
Main parser module, which after parsing the top level options will hand
off to the collected subcommands parsers.

4
requirements.txt Normal file
View File

@ -0,0 +1,4 @@
pbr>=0.5.21,<1.0
argcomplete
GitPython>=0.3.2.RC1

View File

@ -1,2 +1,33 @@
[easy_install]
[metadata]
name = git-upstream
author = Darragh Bailey
author-email = dbailey@hp.com
maintainer = Davide Guerri
maintainer-email = davide.guerri@hp.com
home-page = https://pypi.python.org/pypi/git-upstream
summary = git tool to help manage upstream repositories
description-file = README
license = Apache License (2.0)
keywords = git upstream workflow
classifiers =
Programming Language :: Python :: 2
Programming Language :: Python :: 3
Programming Language :: Python
Development Status :: 4 - Beta
Environment :: Console
Environment :: OpenStack
Intended Audience :: Developers
Intended Audience :: Information Technology
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
[global]
commands = create_manpage.CreateManpage
[files]
packages =
git_upstream
[entry_points]
console_scripts =
git-upstream = git_upstream.main:main

View File

@ -1,6 +1,5 @@
#!/usr/bin/env python
#
# Copyright (c) 2012, 2013, 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -14,53 +13,10 @@
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import os
from setuptools import setup, find_packages
from create_manpage import CreateManpage
from git_upstream import version
import setuptools
# following function is taken from setuptools example.
# https://pypi.python.org/pypi/an_example_pypi_project (BSD)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version.write_version_file()
setup(
name="git-upstream",
version=version.version,
author="Darragh Bailey",
author_email="dbailey@hp.com",
maintainer="Davide Guerri",
maintainer_email="davide.guerri@hp.com",
description="Tool supporting import from upstream.",
license="Apache Software License",
keywords="git upstream workflow",
url="",
scripts=['git-upstream', os.path.join(os.path.dirname(__file__),
'git_upstream', 'scripts',
'rebase-editor.py')],
packages=find_packages(exclude=['test']),
install_requires=['GitPython>=0.3.2.RC1'],
extras_require = {
'autocomplete': ['argcomplete']
},
long_description=read('README'),
cmdclass={'create_manpage': CreateManpage},
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Utilities",
"License :: OSI Approved :: Apache Software License"
]
)
try:
import argcomplete
print('Make sure to copy bash_completion/git-upstream in appropriate ' +
'location (e.g. ~/.bash_completion)')
except ImportError:
print('Warning: argcomplete package is not installed, autocomplete will' +
' not work.')
setuptools.setup(
setup_requires=['pbr'],
pbr=True)

9
test-requirements.txt Normal file
View File

@ -0,0 +1,9 @@
hacking>=0.5.6,<0.8
Sphinx>=1.1.2,<1.2
discover
fixtures>=0.3.14
python-subunit
testrepository>=0.0.17
testtools>=0.9.32
sphinxcontrib-programoutput

31
tox.ini Normal file
View File

@ -0,0 +1,31 @@
[tox]
minversion = 1.6
skipsdist = True
envlist = pep8, py27
[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
python setup.py testr --slowest --testr-args='{posargs}'
[testenv:pep8]
commands = flake8
[testenv:cover]
commands =
python setup.py testr --coverage
[testenv:doc]
commands = python setup.py create_manpage
[testenv:venv]
commands = {posargs}
[flake8]
# E125 and H are intentionally ignored
ignore = E125,H
show-source = True
exclude = .venv,.tox,dist,doc,build,*.egg