Compare commits

...

5 Commits

Author SHA1 Message Date
Roman Zeyde
b944ae2989 Bump version: 1.15.7 → 1.16.0 2024-12-20 21:13:09 +02:00
Roman Zeyde
4322c39e46 Fix .bumpversion.cfg to use pyproject.toml 2024-12-20 21:04:56 +02:00
Roman Zeyde
73fb5bff62 Switch to pyproject.toml 2024-12-14 20:24:28 +02:00
Roman Zeyde
1f3ca560e8 Allow setting calibration tx gain 2024-12-12 20:27:42 +02:00
Roman Zeyde
297c66c284 Use contextlib.nullcontext (Python 3.7+) 2024-12-12 18:52:10 +02:00
4 changed files with 45 additions and 61 deletions

View File

@@ -1,6 +1,6 @@
[bumpversion]
commit = True
tag = True
current_version = 1.15.6
current_version = 1.16.0
[bumpversion:file:setup.py]
[bumpversion:file:pyproject.toml]

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
import argparse
import contextlib
import logging
import os
import sys
@@ -129,7 +130,8 @@ def create_parser(description, interface_factory):
),
calib=lambda config, args: calib.send(
config=config, dst=args.dst,
volume_cmd=get_volume_cmd(args)
volume_cmd=get_volume_cmd(args),
gain=args.gain,
),
input_type=FileType('rb'),
output_type=FileType('wb', interface_factory),
@@ -183,14 +185,6 @@ def create_parser(description, interface_factory):
return p
class _Dummy:
def __enter__(self):
return self
def __exit__(self, *args):
pass
def _version():
return pkg_resources.require('amodem')[0].version
@@ -240,11 +234,11 @@ def _main():
from . import alsa # pylint: disable=import-outside-toplevel
interface = alsa.Interface(config)
elif args.audio_library == '-':
interface = _Dummy() # manually disable PortAudio
interface = contextlib.nullcontext() # manually disable PortAudio
elif args.command == 'send' and args.output is not None:
interface = _Dummy() # redirected output
interface = contextlib.nullcontext() # redirected output
elif args.command == 'recv' and args.input is not None:
interface = _Dummy() # redirected input
interface = contextlib.nullcontext() # redirected input
else:
interface = audio.Interface(config)
interface.load(args.audio_library)

37
pyproject.toml Normal file
View File

@@ -0,0 +1,37 @@
[project]
name = "amodem"
version = "1.16.0"
authors = [
{ name="Roman Zeyde", email="dev@romanzey.de" },
]
description = "Audio Modem Communication Library"
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.7"
dependencies = [
"numpy",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Networking",
"Topic :: Communications",
]
[project.scripts]
amodem = "amodem.__main__:_main"
[project.urls]
Homepage = "https://github.com/romanz/amodem"
Issues = "https://github.com/romanz/amodem/issues"

View File

@@ -1,47 +0,0 @@
#!/usr/bin/env python
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
self.test_args = []
self.test_suite = True
def run_tests(self):
import sys
import pytest
sys.exit(pytest.main(['.']))
setup(
name='amodem',
version='1.15.6',
description='Audio Modem Communication Library',
author='Roman Zeyde',
author_email='dev@romanzey.de',
license='MIT',
url='http://github.com/romanz/amodem',
packages=find_packages(),
tests_require=['pytest'],
cmdclass={'test': PyTest},
install_requires=['numpy'],
platforms=['POSIX'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking',
'Topic :: Communications',
],
entry_points={'console_scripts': ['amodem = amodem.__main__:_main']},
)