Verified Commit ac480f7c authored by Maciej Delmanowski's avatar Maciej Delmanowski

Merge branch 'drybjed-fix-setup-py3'

parents 7bdf1589 64a8248f
Pipeline #17015436 passed with stages
in 2 minutes and 56 seconds
......@@ -22,7 +22,7 @@ cache:
before_install:
- 'sudo apt-get -qq update'
- 'sudo apt-get install -yq graphviz'
- 'pip install --upgrade six setuptools wheel'
- 'pip install --upgrade pip six setuptools wheel'
- 'pip install pycodestyle unittest2 nose2 cov-core ansible sphinx sphinx-autobuild sphinx_rtd_theme yamllint'
install:
......@@ -32,3 +32,5 @@ install:
script:
- 'make test-all'
- 'make check'
- 'make sdist-quiet wheel-quiet'
- 'pip install .'
......@@ -45,6 +45,10 @@ sdist: ## Create Python sdist package
sdist: clean-sdist
@python setup.py sdist
.PHONY: sdist-quiet
sdist-quiet: clean-sdist
@python setup.py --quiet sdist
.PHONY: sdist-sign
sdist-sign: ## Create signed Python sdist package
sdist-sign: sdist
......@@ -59,6 +63,10 @@ wheel: ## Create Python wheel package
wheel: clean-wheel
@python setup.py bdist_wheel
.PHONY: wheel-quiet
wheel-quiet: clean-wheel
@python setup.py --quiet bdist_wheel
.PHONY: wheel-sign
wheel-sign: ## Create signed Python wheel package
wheel-sign: wheel
......
......@@ -10,6 +10,16 @@ try:
except(IOError, ImportError):
README = open('README.md').read()
try:
unicode
except NameError:
# Required for Python 3.x
class unicode(object):
def __new__(cls, s):
if isinstance(s, str):
return s
return s and s.decode('utf-8') or None
SCRIPTS = [os.path.join('bin', n) for n in [
'debops', 'debops-init', 'debops-task',
'debops-defaults', 'debops-padlock', 'debops-update']]
......@@ -20,7 +30,7 @@ try:
with open(os.devnull, 'w') as devnull:
RELEASE = subprocess.check_output(
['git describe'], shell=True, stderr=devnull
).strip('\n').lstrip('v')
).strip(b'\n').lstrip(b'v')
with open('VERSION', 'w') as version_file:
version_file.write('{}\n'.format(RELEASE))
except subprocess.CalledProcessError:
......@@ -38,7 +48,7 @@ try:
os.symlink('../ansible', 'debops/ansible')
setup(
name="debops",
version=RELEASE,
version=unicode(RELEASE),
install_requires=['netaddr', 'argparse', 'passlib', 'ansible'],
scripts=SCRIPTS,
......@@ -56,7 +66,7 @@ try:
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",
"/archive/v" + unicode(RELEASE) + ".tar.gz",
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
......
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