Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | From e31d5fdf2ea00ac6349e64580a20816783064dd4 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hideki Takeoka <hideki.takeoka@smartfrog.com> |
| 3 | Date: Sun, 25 Aug 2019 19:25:00 +0200 |
| 4 | Subject: [PATCH] Update setup.py for python3.7+ support |
| 5 | |
| 6 | --- |
| 7 | setup.py | 9 +++++---- |
| 8 | src/SerialLibrary/version.py | 3 +++ |
| 9 | 2 files changed, 8 insertions(+), 4 deletions(-) |
| 10 | |
| 11 | diff --git a/setup.py b/setup.py |
| 12 | index 4c34705..70bb1af 100644 |
| 13 | --- a/setup.py |
| 14 | +++ b/setup.py |
| 15 | @@ -1,6 +1,5 @@ |
| 16 | #!/usr/bin/env python |
| 17 | |
| 18 | -from imp import load_source |
| 19 | from os.path import abspath, dirname, join |
| 20 | from sys import platform |
| 21 | |
| 22 | @@ -18,9 +17,11 @@ |
| 23 | |
| 24 | |
| 25 | CURDIR = dirname(abspath(__file__)) |
| 26 | -VERSION = load_source( |
| 27 | - 'version', 'version', |
| 28 | - open(join(CURDIR, 'src', 'SerialLibrary', 'version.py'))).VERSION |
| 29 | + |
| 30 | +with open(join(CURDIR, 'src', 'SerialLibrary', 'version.py')) as f: |
| 31 | + exec(f.read()) |
| 32 | + VERSION = get_version() |
| 33 | + |
| 34 | README = open(join(CURDIR, 'README.rst')).read() |
| 35 | CLASSIFIERS = '\n'.join( |
| 36 | map(' :: '.join, [ |
| 37 | diff --git a/src/SerialLibrary/version.py b/src/SerialLibrary/version.py |
| 38 | index 6ce65c4..19831bc 100644 |
| 39 | --- a/src/SerialLibrary/version.py |
| 40 | +++ b/src/SerialLibrary/version.py |
| 41 | @@ -1 +1,4 @@ |
| 42 | VERSION = (0, 3, 1) |
| 43 | + |
| 44 | +def get_version(): |
| 45 | + return VERSION; |