Commit 7d531934 authored by Maciej Delmanowski's avatar Maciej Delmanowski

Redesign Python packaging for 'debops-tools'

This is a redesign of the Python 'lib/debops-tools/' package to be the
main 'debops' Python package again. This is done to synchronize the
"debops-tools" version and DebOps monorepo version. It should also make
installing 'debops' a bit more intuitive and accessible.

Source package creation using Python setuptools resulted in the Python
source files being put in the 'lib/debops-tools/debops/' subdirectory
instead of the 'debops/' subdirectory of the generated tarball,
therefore I moved the scripts to the root fo the monorepo. Otherwise the
current scripts were not changed; this shouldn't impact usage of the
Ansible roles/playbooks.

The source package generated by Python setuptools will now included
a LICENSE file, which was missing from the previous ones. The 'debops'
package description and classification was also updated. Package
versioning is done dynamically based on the 'git describe' result.
parent 0c87a8f0
......@@ -26,6 +26,9 @@ tramp
__pycache__/
**/*.py[cod]
*$py.class
debops.egg-info/
dist/
build/
# C extensions
*.so
......
......@@ -23,6 +23,9 @@ tramp
__pycache__/
*.py[cod]
*$py.class
debops.egg-info/
dist/
build/
# C extensions
*.so
......
include README.md
include LICENSE
......@@ -77,7 +77,7 @@ test-yaml:
.PHONY: test-debops-tools
test-debops-tools:
@printf "%s\n" "Testing debops-tools using nose2..."
@nose2 --start-dir=lib/debops-tools --with-coverage
@nose2 --with-coverage
.PHONY: fail-if-git-dirty
fail-if-git-dirty:
......
......@@ -37,11 +37,11 @@ pkgver() {
}
build() {
cd "$_pkgname/lib/$_pkgname-tools"
cd "$_pkgname"
python2 setup.py build
}
package() {
cd "$_pkgname/lib/$_pkgname-tools"
cd "$_pkgname"
python2 setup.py install --root="$pkgdir" --optimize=1
}
......@@ -3,24 +3,26 @@
from setuptools import setup, find_packages
import os
try:
import pypandoc
README = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
README = open('README.md').read()
SCRIPTS = [os.path.join('bin', n) for n in [
'debops', 'debops-init', 'debops-task',
'debops-defaults', 'debops-padlock', 'debops-update']]
README = open('README.rst').read()
README = open('README.md').read()
RELEASE = os.popen('git describe').read().strip().lstrip('v')
setup(
name="debops",
version="0.6.1",
version=RELEASE,
install_requires=['netaddr', 'argparse', 'passlib', 'ansible'],
scripts=['bin/debops',
'bin/debops-defaults',
'bin/debops-init',
'bin/debops-padlock',
'bin/debops-task',
'bin/debops-update'],
scripts=SCRIPTS,
packages=find_packages(exclude=['tests']),
package_data={
'debops': ['padlock-script'],
......@@ -29,23 +31,33 @@ setup(
# metadata for upload to PyPI
author="DebOps Developers",
author_email="debops-users@lists.debops.org",
description="Your Debian-based data center in a box.",
description="Your Debian-based data center in a box",
long_description=README,
license="GPL-3.0",
keywords="ansible",
url="https://debops.org/",
download_url="https://github.com/debops/debops-tools"
"/archive/v0.6.1.tar.gz",
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4',
download_url="https://github.com/debops/debops"
"/archive/v" + RELEASE + ".tar.gz",
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v3 '
'or later (GPLv3+)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Operating System :: POSIX',
'Programming Language :: Other Scripting Engines',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: System :: Installation/Setup',
'Topic :: System :: Systems Administration',
'Topic :: Utilities'
],
# these are for easy_install (used by bdist_*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment