mirror of
https://github.com/romanz/amodem.git
synced 2026-02-06 00:36:20 +08:00
version: use separate file for versioning
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
# PYTHON_ARGCOMPLETE_OK
|
||||
from amodem import main, calib, audio, async
|
||||
from amodem.config import bitrates
|
||||
from . import version
|
||||
|
||||
import os
|
||||
import sys
|
||||
@@ -185,9 +186,11 @@ def create_parser(description, interface):
|
||||
|
||||
|
||||
def _main():
|
||||
fmt = ('Audio OFDM MODEM: {0:.1f} kb/s ({1:d}-QAM x {2:d} carriers) '
|
||||
fmt = ('Audio OFDM MODEM v{0:s}: '
|
||||
'{1:.1f} kb/s ({2:d}-QAM x {3:d} carriers) '
|
||||
'Fs={3:.1f} kHz')
|
||||
description = fmt.format(config.modem_bps / 1e3, len(config.symbols),
|
||||
description = fmt.format(version.__doc__,
|
||||
config.modem_bps / 1e3, len(config.symbols),
|
||||
config.Nfreq, config.Fs / 1e3)
|
||||
interface = audio.Interface(config=config)
|
||||
p = create_parser(description, interface)
|
||||
|
||||
1
amodem/version.py
Normal file
1
amodem/version.py
Normal file
@@ -0,0 +1 @@
|
||||
'1.11'
|
||||
12
setup.py
12
setup.py
@@ -2,6 +2,16 @@
|
||||
from setuptools import setup
|
||||
from setuptools.command.test import test as TestCommand
|
||||
|
||||
import os
|
||||
import ast
|
||||
|
||||
def parse_vesrion():
|
||||
cwd = os.path.dirname(__name__)
|
||||
version_file = os.path.join(cwd, 'amodem', 'version.py')
|
||||
|
||||
tree = ast.parse(open(version_file).read())
|
||||
expr, = tree.body
|
||||
return expr.value.s
|
||||
|
||||
class PyTest(TestCommand):
|
||||
|
||||
@@ -16,7 +26,7 @@ class PyTest(TestCommand):
|
||||
|
||||
setup(
|
||||
name='amodem',
|
||||
version='1.11',
|
||||
version=parse_vesrion(),
|
||||
description='Audio Modem Communication Library',
|
||||
author='Roman Zeyde',
|
||||
author_email='roman.zeyde@gmail.com',
|
||||
|
||||
Reference in New Issue
Block a user