diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index efbbc68..7acab02 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -81,7 +81,7 @@ jobs: uses: actions/checkout@v4 - name: "BLACK" - uses: psf/black@stable + uses: psf/black@23.7.0 with: options: "--check --diff --color --line-length 120 --skip-string-normalization --extend-exclude (subprojects|debian|.build)" src: "." diff --git a/debian/control b/debian/control index 5f8f898..9e0c0ca 100644 --- a/debian/control +++ b/debian/control @@ -1,23 +1,43 @@ Source: nvme-stas -Section: misc +Section: net Priority: optional Maintainer: Martin Belanger -Build-Depends: debhelper-compat (= 12), python3-setuptools, dh-python, meson, ninja-build -Standards-Version: 4.4.1 -Homepage: https://nvme-stas.readthedocs.io/en/latest/ +Build-Depends: + debhelper-compat (= 13), + dh-python, + docbook-xml, + docbook-xsl, + iproute2, + libglib2.0-dev-bin, + meson, + python3-lxml, + python3:any, + xsltproc, +Rules-Requires-Root: no +Standards-Version: 4.6.2 +Homepage: https://github.com/linux-nvme/nvme-stas Vcs-Browser: https://github.com/linux-nvme/nvme-stas Vcs-Git: https://github.com/linux-nvme/nvme-stas.git -#Testsuite: autopkgtest-pkg-python Package: nvme-stas +Section: net Architecture: all -Depends: ${python3:Depends}, ${misc:Depends}, python3-pyudev, python3-systemd, python3-gi, python3-dasbus, python3-libnvme -Description: NVMe STorage Appliance Services - This package provides two daemons, stafd and stacd. The STorage Appliance - Finder Daemon (stafd) automatically discovers NVMe-oF Discovery Controllers (DC) - and retrieves the list of NVMe Storage Appliances. The STorage Appliance - Connector Daemon (stacd) establishes I/O connections to the NVMe Storage - Appliances discovered by stafd. +Depends: + python3-dasbus, + python3-gi, + python3-libnvme, + python3-pyudev, + python3-systemd, + ${misc:Depends}, + ${python3:Depends}, +Description: NVMe Storage Appliance Services (STAS) + NVMe over Fabrics (NVMe-oF) is the concept of using a transport protocol over + a network to connect remote NVMe devices. nvme-stas contains two services, + stafd and stacd, to be used to access NVMe over TCP: . - This package installs the library for Python 3. - + * Storage Appliance Finder (stafd): + automatically locate Central or Direct Discovery Controllers (CDC, DDC) + with zeroconf (mDNS). + . + * Storage Appliance Connector (stacd): + setup the I/O controller connections to each storage subsystem. diff --git a/debian/rules b/debian/rules index 24304f6..795bc8f 100755 --- a/debian/rules +++ b/debian/rules @@ -6,7 +6,16 @@ #export PYBUILD_NAME=nvme-stas %: - dh $@ --with python3 --buildsystem=meson+ninja + dh ${@} --buildsystem=meson+ninja --with python3 -override_dh_install: +override_dh_auto_configure: + dh_auto_configure -- -Dman=true +override_dh_auto_test: + dh_auto_test || true + +execute_after_dh_auto_install: + # Moving systemd unit directory (#1034225) + mkdir -p debian/nvme-stas/lib/systemd + mv debian/nvme-stas/usr/lib/systemd/system debian/nvme-stas/lib/systemd + rmdir -p --ignore-fail-on-non-empty debian/nvme-stas/usr/lib/systemd diff --git a/meson.build b/meson.build index 5b42856..c26179b 100644 --- a/meson.build +++ b/meson.build @@ -165,7 +165,7 @@ summary_dict = { 'dbus_conf_dir ': dbus_conf_dir, 'sd_unit_dir ': sd_unit_dir, 'build location ': meson.current_build_dir(), - 'libnvme for tests ': libnvme_location, + 'libnvme location ': libnvme_location, } summary(summary_dict, section: 'Directories') diff --git a/staslib/avahi.py b/staslib/avahi.py index cd4d1f9..e27cd37 100644 --- a/staslib/avahi.py +++ b/staslib/avahi.py @@ -167,9 +167,11 @@ def set_identity(self, transport, address, port, txt): # pylint: disable=too-ma 'trsvcid': trsvcid, # host-iface permitted for tcp alone and not rdma 'host-iface': host_iface, - 'subsysnqn': txt.get('nqn', defs.WELL_KNOWN_DISC_NQN).strip() - if conf.NvmeOptions().discovery_supp - else defs.WELL_KNOWN_DISC_NQN, + 'subsysnqn': ( + txt.get('nqn', defs.WELL_KNOWN_DISC_NQN).strip() + if conf.NvmeOptions().discovery_supp + else defs.WELL_KNOWN_DISC_NQN + ), } self._ip = iputil.get_ipaddress_obj(traddr, ipv4_mapped_convert=True) diff --git a/test/meson.build b/test/meson.build index ef31c63..ef1ce45 100644 --- a/test/meson.build +++ b/test/meson.build @@ -9,6 +9,8 @@ srce_dir = meson.current_source_dir() test_env = environment({'MALLOC_PERTURB_': '0'}) +test_env.append('PYTHONMALLOC', 'malloc') +test_list = modules_to_lint + packages_to_lint libnvme_location = '?' @@ -23,9 +25,9 @@ if get_option('libnvme-sel') == 'pre-installed' rr = run_command(python3, '-c', 'import libnvme; print(f"{libnvme.__path__[0]}")', check: false, env: test_env) if rr.returncode() == 0 libnvme_location = rr.stdout().strip() - pythonpath = fs.parent(libnvme_location) - test_env.prepend('PYTHONPATH', pythonpath) # Look in standard location first - test_env.append('PYTHONPATH', PYTHONPATH) # Look in the build directory second + libnvme_path = fs.parent(libnvme_location) + PYTHONPATH = ':'.join([libnvme_path, PYTHONPATH]) + test_env.prepend('PYTHONPATH', PYTHONPATH) endif endif @@ -52,7 +54,7 @@ else # python3 -m pip install --upgrade pylint==2.17.7 - if modules_to_lint.length() != 0 + if test_list.length() != 0 pylint = find_program('pylint', required: false) pyflakes = find_program('pyflakes3', required: false) if not pyflakes.found() @@ -65,12 +67,12 @@ else rcfile = srce_dir / 'pylint.rc' if pylint.found() - test('pylint', pylint, args: ['--rcfile=' + rcfile] + modules_to_lint + packages_to_lint, env: test_env) + test('pylint', pylint, args: ['--rcfile=' + rcfile] + test_list, env: test_env) else warning('Skiping some of the tests because "pylint" is missing.') endif if pyflakes.found() - test('pyflakes', pyflakes, args: modules_to_lint, env: test_env) + test('pyflakes', pyflakes, args: test_list, env: test_env) else warning('Skiping some of the tests because "pyflakes" is missing.') endif @@ -156,8 +158,8 @@ tools = [ ] vermin = find_program('vermin', required: false) if vermin.found() - if modules_to_lint.length() != 0 - test('vermin code', vermin, args: ['--config-file', srce_dir / 'vermin.conf'] + modules_to_lint, env: test_env) + if test_list.length() != 0 + test('vermin code', vermin, args: ['--config-file', srce_dir / 'vermin.conf'] + test_list, env: test_env) endif test('vermin tools', vermin, args: ['--config-file', srce_dir / 'vermin-tools.conf'] + tools, env: test_env) else