Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
158 lines (145 loc) · 6.28 KB
/
Copy pathpyproject.toml
File metadata and controls
158 lines (145 loc) · 6.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
[build-system]
# The >=77 floor is required for the PEP 639 SPDX `license` string form below.
# There is no upper cap: an earlier <81 cap dated from setuptools 81 removing
# pkg_resources, but a build requirement never reaches the environment
# Substation runs in, and a wheel built with setuptools 84 has the same files,
# byte for byte, as one built with 80. pyrtlsdr, the only runtime dependency
# that imports pkg_resources, is handled in substation/devices/rtlsdr.py.
requires = ["setuptools>=77", "setuptools-scm>=8.0"]
build-backend = "setuptools.build_meta"
[project]
name = "substation"
dynamic = ["version"]
description = "An SDR band scanner for RTL-SDR, HackRF, AirSpy, and SoapySDR devices"
authors = [
{ name = "Simon Holliday", email = "simon.holliday@protonmail.com" }
]
# SPDX expression (PEP 639). The old table form and the License:: classifier
# are deprecated by setuptools; the SPDX string is now the single source of
# truth for the license.
license = "AGPL-3.0-or-later"
readme = "README.md"
requires-python = ">=3.10"
keywords = ["sdr", "radio", "scanner", "rtl-sdr", "hackrf", "airspy", "soapysdr"]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: POSIX :: Linux",
"Topic :: Communications :: Ham Radio",
]
dependencies = [
"numpy>=1.24.0",
# 2.7 added use_attribute_docstrings, which turns each config field's
# docstring into its description in the JSON schema.
"pydantic>=2.7",
# pyrtlsdr 0.4.0+ requires the rtlsdr_set_dithering symbol from the
# rtl-sdr-blog fork. Pinning below 0.4.0 keeps the package working
# against distro-packaged librtlsdr too — the guide's install chapter,
# https://subsystem.co/substation/guide/installing-substation, builds the
# fork. 0.3.0 imports pkg_resources at load time, which
# substation/devices/rtlsdr.py provides a stand-in for when setuptools
# is absent (the default in Python 3.12+ venvs).
"pyrtlsdr>=0.3.0,<0.4.0",
"PyYAML>=6.0",
# Sends the scanner's events as OSC when the configuration's osc settings
# ask (#4781). An ordinary dependency, so a plain install can reach a
# sequencer or a sampler with settings alone.
"python-osc>=1.8",
"scipy>=1.10.0",
"soundfile>=0.12.1",
"mutagen>=1.45",
# SoapySDR (for Airspy and other devices) is a system package — install
# via apt (python3-soapysdr) and use --system-site-packages on the venv,
# as the guide's install chapter shows.
]
[project.optional-dependencies]
# Development tools — install with `pip install -e ".[dev]"`.
# pytest is used for the test suite; mypy for the type-check pass.
# mypy is pinned below 1.18 because
# newer releases ship a C-accelerated backend (librt) that segfaults
# on aarch64 (Raspberry Pi) at time of writing.
dev = [
"pytest>=7.0",
"mypy>=1.0,<1.18",
# Type stubs for PyYAML — without these `mypy substation` fails on
# the yaml import in a fresh dev install.
"types-PyYAML",
]
# Empty since python-osc became an ordinary dependency (#4781). Kept so that
# install commands written for earlier releases, `pip install "substation[osc]"`,
# still work without pip warning that the extra does not exist.
osc = []
# The noisereduce library, used only by
# substation.dsp.noise_reduction.apply_noisereduce, which the scanner does not
# call — install with `pip install "substation[noisereduce]"`. It pulls in
# matplotlib and more, so it stays off every other install, Raspberry Pi
# included.
noisereduce = [
"noisereduce>=3.0.3",
]
# HackRF One support — install with `pip install "substation[hackrf]"`.
# python_hackrf publishes source only, so installing it compiles the binding
# against libhackrf's headers (libhackrf-dev, see the guide's install chapter). Keeping it
# optional spares everyone without a HackRF that build, and its failure
# where the headers are missing.
hackrf = [
"python_hackrf",
]
[project.urls]
Documentation = "https://subsystem.co/substation"
Repository = "https://github.com/simonholliday/substation"
Issues = "https://github.com/simonholliday/substation/issues"
[project.scripts]
substation = "substation.cli:main"
substation-antenna = "substation.antenna:main"
[tool.setuptools.packages.find]
include = ["substation*"]
[tool.setuptools.package-data]
# Ship the default configuration inside the package so it resolves for
# editable installs and wheels alike (see config._locate_default_config).
# band_library.yaml is what substation.generate_default_config builds the
# default configuration's band library from.
substation = ["config.yaml.default", "band_library.yaml"]
[tool.setuptools_scm]
# Version is derived from git release tags (vX.Y.Z), same as the other
# Sub* projects. Between tags, setuptools-scm generates a dev version
# from the latest tag plus commit distance. Re-run `pip install -e .`
# after tagging to refresh the installed metadata.
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["tests"]
# A deprecated call in Substation's own code fails the suite, so it is fixed
# before the Python release that removes it. Warnings raised inside other
# packages keep pytest's default handling.
filterwarnings = [
"error::DeprecationWarning:substation",
"error::PendingDeprecationWarning:substation",
]
[tool.mypy]
# mypy checks for the Python it runs under. A fixed python_version = "3.10"
# stopped it before it checked any code wherever numpy 2.5 or later is
# installed, because numpy's stubs use Python 3.12 syntax, and numpy 2.5
# does not install on 3.10 anyway. To check against 3.10, the oldest Python
# Substation supports, run mypy under 3.10.
#
# We only add per-module overrides below to silence "library stubs not
# installed" errors for third-party packages that don't ship PEP 561
# stubs — scipy, SoapySDR, rtlsdr, noisereduce, and soundfile. Using
# per-module overrides instead of a global `ignore_missing_imports = true`
# keeps accidental typos in local imports visible as errors.
[[tool.mypy.overrides]]
module = [
"scipy",
"scipy.fft",
"scipy.ndimage",
"scipy.signal",
"SoapySDR",
"rtlsdr",
"mutagen",
"noisereduce",
"soundfile",
# Some python-osc releases the dependency allows ship no py.typed marker
# (1.8.0 and 1.9.0 among them; 1.8.3 and 1.10 have one).
"pythonosc",
"pythonosc.udp_client",
]
ignore_missing_imports = true