Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,39 @@

import codecs
import os
from distutils.core import setup
from setuptools import setup
import pathlib

version = '?'
version = '1.7.4+1.0.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding a version here is not good since I don't want to manually update it here. This is currently injectsed like this:
https://github.com/OpenRoberta/robertalab-ev3dev/blob/develop/debian/rules#L12

maybe it would be better to use None as a default and fail if it not importable from the environment.

root = os.path.dirname(os.path.abspath(__file__))
# Path to __version__ module
version_file = os.path.join(root, 'roberta', '__version__.py')
# Check if this is a source distribution.
# If not create the __version__ module containing the version
if not os.path.exists(os.path.join(root, 'PKG-INFO')):
fd = codecs.open(version_file, 'w', 'utf-8')
fd.write('version = %r\n' % os.getenv('VERSION', '?'))
fd.write('version = %r\n' % os.getenv('VERSION', version))
fd.close()
# Load version

exec(open(version_file).read())

# TODO: convert README.md to long_desc
# https://gist.github.com/aubricus/9184003#file-setup_snippet-py

HERE = pathlib.Path(__file__).parent

# The text of the README file
path = HERE/"README.md"

with path.open(mode='r') as fid:
README = fid.read()

setup(name='openrobertalab',
version=version,
description='lab.open-roberta.org connector for ev3dev.org',
long_description=README,
long_description_content_type='text/markdown',
author='Stefan Sauer',
author_email='[email protected]',
url='https://www.open-roberta.org/',
Expand Down