Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
version handling
  • Loading branch information
mooshu1x2 committed Jul 26, 2016
1 parent e64451b commit 1cce85db7b07cb1e99a587bdaf3e3d98106bd6a1
Showing 4 changed files with 16 additions and 26 deletions.
@@ -1,6 +1,7 @@
include MANIFEST.in
include userale/version.py
include setup.py
include README
include AUTHORS
include CHANGELOG
include README.rst
include AUTHORS.rst
include CHANGELOG.rst
include LICENSE
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
#
# Copyright 2016 The Charles Stark Draper Laboratory, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#from __future__ import absolute_import
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import io, os, sys
@@ -27,16 +24,6 @@
print ("To install, run 'python3 setup.py install'")
print ()

def read (*filenames, **kwargs):
encoding = kwargs.get ('encoding', 'utf-8')
sep = kwargs.get ('sep', '\n')
buf = []
for filename in filenames:
with io.open (filename, encoding=encoding) as f:
buf.append (f.read ())
return sep.join (buf)


# This is a plug-in for setuptools that will invoke py.test
# when you run python setup.py test
class PyTest (TestCommand):
@@ -49,15 +36,18 @@ def run_tests (self):
import pytest # import here, because outside the required eggs aren't loaded yet
sys.exit (pytest.main (self.test_args))

# Get the version string
g = {}
with open (os.path.join ('userale', 'version.py'), 'rt') as f:
exec (f.read (), g)
version = g['__version__']
# Get the version string
def get_version ():
basedir = os.path.dirname (__file__)
with open (os.path.join (basedir, 'userale/version.py')) as f:
version = {}
exec (f.read (), version)
return version['__version__']
raise RuntimeError ('No version info found.')

setup (
name = 'UserAle',
version = version,
version = get_version (),
url = 'https://github.com/draperlaboratory/userale.pyqt5',
license = 'Apache Software License',
author = 'Michelle Beard',
@@ -88,7 +78,8 @@ def run_tests (self):
'console_scripts': [
'mouse = userale.tests.testapp:test_app',
'drag = userale.tests.testdragndrop:test_drag',
'drag2 = userale.tests.testdragndrop2:test_drag2'
'drag2 = userale.tests.testdragndrop2:test_drag2',
'window = userale.tests.testclose:test_close'
]
}
)
@@ -18,4 +18,4 @@

from .version import __version__

__all__ = ('__version__', )
__all__ = ('__version__', )
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
#
# Copyright 2016 The Charles Stark Draper Laboratory, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");

0 comments on commit 1cce85d

Please sign in to comment.