From d4e103ae59f9a95ffdd1748e6905fd73111f4446 Mon Sep 17 00:00:00 2001 From: rpartzsch Date: Thu, 23 Oct 2025 15:04:20 +0200 Subject: [PATCH 1/2] build: moved to pyproject toml --- VERSION | 1 - basil/__init__.py | 12 +---------- pyproject.toml | 45 ++++++++++++++++++++++++++++++++++++++++ requirements.txt | 6 ------ setup.cfg | 10 --------- setup.py | 53 ----------------------------------------------- 6 files changed, 46 insertions(+), 81 deletions(-) delete mode 100644 VERSION create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/VERSION b/VERSION deleted file mode 100644 index 15a27998..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0 diff --git a/basil/__init__.py b/basil/__init__.py index 50d0f4cf..c4a58e65 100644 --- a/basil/__init__.py +++ b/basil/__init__.py @@ -1,24 +1,14 @@ -from importlib.metadata import version, PackageNotFoundError import collections import yaml - -__version__ = None # required for initial installation - -try: - __version__ = version("basil_daq") -except PackageNotFoundError: - __version__ = "(local)" - +__version__ = "3.3.0" # Have OrderedDict def dict_representer(dumper, data): return dumper.represent_dict(data.items()) - def dict_constructor(loader, node): return collections.OrderedDict(loader.construct_pairs(node)) - yaml.add_representer(collections.OrderedDict, dict_representer) yaml.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, dict_constructor) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..b40070d2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,45 @@ +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "basil_daq" +dynamic = ["version"] +license = { "text" = "BSD 3-Clause ('BSD New' or 'BSD Simplified') License" } +description = "Basil is a modular data acquisition system and system testing framework in Python.\nIt also provides generic FPGA firmware modules for different hardware platforms and drivers for wide range of lab appliances." +readme = {file = "README.rst", content-type = "text/markdown"} +requires-python = ">=3.10" +authors = [ + {name = "Tomasz Hemperek", email="hemperek@uni-bonn.de"}, + {name = "Jens Janssen", email="janssen@physik.uni-bonn.de"}, + {name = "David-Leon Pohl", email="pohl@physik.uni-bonn.de"} +] + +maintainers = [ + {name = "Yannick Dieter", email = "dieter@physik.uni-bonn.de"}, + {name = "Christian Bespin", email = "bespin@physik.uni-bonn.de"}, +] + +dependencies = [ + "numpy", + "pyyaml", + "bitarray>=3.4.0", + "GitPython", + "six", + "ruamel.yaml", +] + +[project.urls] +"Documentation" = "https://basil.readthedocs.io/en/latest/" +"Repository" = "https://github.com/SiLab-Bonn/basil/" + + +[tool.setuptools.dynamic] +version = {attr = "basil.__version__"} + +[tool.flake8] +ignore = ["E501", "E902", "W503", "W605", "W504"] +# max-line-length = 160 + +[tool.pytest.ini_options] +markers = ["verilator: Verilog tests."] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index b2345434..00000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -numpy -pyyaml -bitarray>=3.4.0 -GitPython -six -ruamel.yaml \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index eaf48847..00000000 --- a/setup.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[metadata] -description-file = README.rst - -[flake8] -ignore = E501,E902,W503,W605,W504 -# max-line-length = 160 - -[tool:pytest] -markers = - verilator diff --git a/setup.py b/setup.py deleted file mode 100644 index 103a4113..00000000 --- a/setup.py +++ /dev/null @@ -1,53 +0,0 @@ -from setuptools import setup, find_packages -from os import path, walk - -author = 'Tomasz Hemperek, Jens Janssen, David-Leon Pohl' -author_email = 'hemperek@uni-bonn.de, janssen@physik.uni-bonn.de, pohl@physik.uni-bonn.de' -maintainer = 'Yannick Dieter, Christian Bespin' -maintainer_email = 'dieter@physik.uni-bonn.de, bespin@physik.uni-bonn.de' - -# https://packaging.python.org/guides/single-sourcing-package-version/ -# Use -# import get_distribution -# get_distribution('package_name').version -# to programmatically access a version number. -# Also add -# include VERSION -# MANIFEST.in -with open('VERSION') as version_file: - version = version_file.read().strip() - -# Requirements for core functionality from requirements.txt -# Also add -# include requirements.txt -# MANIFEST.in -with open('requirements.txt') as f: - install_requires = f.read().splitlines() - - -def package_files(directory): - paths = [] - for (fpath, directories, filenames) in walk(directory): - for filename in filenames: - paths.append(path.join('..', fpath, filename)) - return paths - - -setup( - name='basil_daq', - version=version, - python_requires='>=3.8', - description='Basil - a data acquisition and system testing framework', - url='https://github.com/SiLab-Bonn/basil', - license='BSD 3-Clause ("BSD New" or "BSD Simplified") License', - long_description='Basil is a modular data acquisition system and system testing framework in Python.\nIt also provides generic FPGA firmware modules for different hardware platforms and drivers for wide range of lab appliances.', - install_requires=install_requires, - author=author, - author_email=author_email, - maintainer=maintainer, - maintainer_email=maintainer_email, - packages=find_packages(), - include_package_data=True, # accept all data files and directories matched by MANIFEST.in or found in source control - package_data={'': ['*.yaml'], 'basil': package_files('basil/firmware')}, - platforms='any' -) From eb6564b16fa8dda5e4e02f116cf0993ebe9ea221 Mon Sep 17 00:00:00 2001 From: rpartzsch Date: Tue, 28 Oct 2025 10:51:27 +0100 Subject: [PATCH 2/2] sty: whitelines in init functions --- basil/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/basil/__init__.py b/basil/__init__.py index c4a58e65..bd551f2a 100644 --- a/basil/__init__.py +++ b/basil/__init__.py @@ -3,12 +3,15 @@ __version__ = "3.3.0" + # Have OrderedDict def dict_representer(dumper, data): return dumper.represent_dict(data.items()) + def dict_constructor(loader, node): return collections.OrderedDict(loader.construct_pairs(node)) + yaml.add_representer(collections.OrderedDict, dict_representer) yaml.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, dict_constructor)