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: ...@@ -22,7 +22,7 @@ cache:
before_install: before_install:
- 'sudo apt-get -qq update' - 'sudo apt-get -qq update'
- 'sudo apt-get install -yq graphviz' - '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' - 'pip install pycodestyle unittest2 nose2 cov-core ansible sphinx sphinx-autobuild sphinx_rtd_theme yamllint'
install: install:
...@@ -32,3 +32,5 @@ install: ...@@ -32,3 +32,5 @@ install:
script: script:
- 'make test-all' - 'make test-all'
- 'make check' - 'make check'
- 'make sdist-quiet wheel-quiet'
- 'pip install .'
...@@ -45,6 +45,10 @@ sdist: ## Create Python sdist package ...@@ -45,6 +45,10 @@ sdist: ## Create Python sdist package
sdist: clean-sdist sdist: clean-sdist
@python setup.py sdist @python setup.py sdist
.PHONY: sdist-quiet
sdist-quiet: clean-sdist
@python setup.py --quiet sdist
.PHONY: sdist-sign .PHONY: sdist-sign
sdist-sign: ## Create signed Python sdist package sdist-sign: ## Create signed Python sdist package
sdist-sign: sdist sdist-sign: sdist
...@@ -59,6 +63,10 @@ wheel: ## Create Python wheel package ...@@ -59,6 +63,10 @@ wheel: ## Create Python wheel package
wheel: clean-wheel wheel: clean-wheel
@python setup.py bdist_wheel @python setup.py bdist_wheel
.PHONY: wheel-quiet
wheel-quiet: clean-wheel
@python setup.py --quiet bdist_wheel
.PHONY: wheel-sign .PHONY: wheel-sign
wheel-sign: ## Create signed Python wheel package wheel-sign: ## Create signed Python wheel package
wheel-sign: wheel wheel-sign: wheel
......
...@@ -10,6 +10,16 @@ try: ...@@ -10,6 +10,16 @@ try:
except(IOError, ImportError): except(IOError, ImportError):
README = open('README.md').read() 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 [ SCRIPTS = [os.path.join('bin', n) for n in [
'debops', 'debops-init', 'debops-task', 'debops', 'debops-init', 'debops-task',
'debops-defaults', 'debops-padlock', 'debops-update']] 'debops-defaults', 'debops-padlock', 'debops-update']]
...@@ -20,7 +30,7 @@ try: ...@@ -20,7 +30,7 @@ try:
with open(os.devnull, 'w') as devnull: with open(os.devnull, 'w') as devnull:
RELEASE = subprocess.check_output( RELEASE = subprocess.check_output(
['git describe'], shell=True, stderr=devnull ['git describe'], shell=True, stderr=devnull
).strip('\n').lstrip('v') ).strip(b'\n').lstrip(b'v')
with open('VERSION', 'w') as version_file: with open('VERSION', 'w') as version_file:
version_file.write('{}\n'.format(RELEASE)) version_file.write('{}\n'.format(RELEASE))
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
...@@ -38,7 +48,7 @@ try: ...@@ -38,7 +48,7 @@ try:
os.symlink('../ansible', 'debops/ansible') os.symlink('../ansible', 'debops/ansible')
setup( setup(
name="debops", name="debops",
version=RELEASE, version=unicode(RELEASE),
install_requires=['netaddr', 'argparse', 'passlib', 'ansible'], install_requires=['netaddr', 'argparse', 'passlib', 'ansible'],
scripts=SCRIPTS, scripts=SCRIPTS,
...@@ -56,7 +66,7 @@ try: ...@@ -56,7 +66,7 @@ try:
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, ' python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, '
'!=3.3.*, !=3.4.*, <4', '!=3.3.*, !=3.4.*, <4',
download_url="https://github.com/debops/debops" download_url="https://github.com/debops/debops"
"/archive/v" + RELEASE + ".tar.gz", "/archive/v" + unicode(RELEASE) + ".tar.gz",
classifiers=[ classifiers=[
'Development Status :: 4 - Beta', 'Development Status :: 4 - Beta',
'Environment :: Console', '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