commit ac9464211702ce4efcdc9cb3e162209c6331b8d0378abc31eb4cd496145d696c Author: Matej Cepl Date: Sun May 14 19:59:41 2023 +0000 Accepting request 1087119 from home:ojkastl_buildservice:Branch_devel_languages_python new package python-pylink-square, required by pynitrokey OBS-URL: https://build.opensuse.org/request/show/1087119 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylink-square?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/pylink-square-1.1.0.tar.gz b/pylink-square-1.1.0.tar.gz new file mode 100644 index 0000000..1d14b14 --- /dev/null +++ b/pylink-square-1.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12d6b03f39a2a70beb1d4df08cc7b464bc7518a9131e498f1e4055236044d4ac +size 165808 diff --git a/python-pylink-square.changes b/python-pylink-square.changes new file mode 100644 index 0000000..a780f57 --- /dev/null +++ b/python-pylink-square.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Fri May 12 12:09:27 UTC 2023 - Johannes Kastl + +- new package python-pylink-square, required by pynitrokey diff --git a/python-pylink-square.spec b/python-pylink-square.spec new file mode 100644 index 0000000..9a16cd4 --- /dev/null +++ b/python-pylink-square.spec @@ -0,0 +1,87 @@ +# +# spec file for package python-pylink-square +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-pylink-square +Version: 1.1.0 +Release: 0 +Summary: Python interface for SEGGER J-Link +License: Apache-2.0 +URL: http://www.github.com/Square/pylink +Source: https://files.pythonhosted.org/packages/source/p/pylink-square/pylink-square-%{version}.tar.gz +BuildRequires: python-rpm-macros +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +# SECTION test requirements +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module psutil >= 5.2.2} +BuildRequires: %{python_module six} +# Requires for mock == 2.0.0 replaced by using unittest.mock +# /SECTION +BuildRequires: fdupes +Requires: python-psutil >= 5.2.2 +Requires: python-six +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildArch: noarch +%python_subpackages + +%description +Python interface for SEGGER J-Link. + +%prep +%setup -q -n pylink-square-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/pylink-rtt +%python_clone -a %{buildroot}%{_bindir}/pylink-swv +%python_clone -a %{buildroot}%{_bindir}/pylink +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# replace mock with unittest.mock +find tests -type f -exec sed -i 's/from mock/from unittest.mock/g' {} + +find tests -type f -exec sed -i 's/import mock/import unittest.mock as mock/g' {} + +# ignore checks that fail on some architectures +# see https://github.com/square/pylink/issues/175 +IGNORED_CHECKS="test_initialize_windows" +IGNORED_CHECKS="${IGNORED_CHECKS} or test_unlock_kinetis_read_fail" +IGNORED_CHECKS="${IGNORED_CHECKS} or test_unlock_kinetis_success" +%pytest -k "not (${IGNORED_CHECKS})" + +%post +%python_install_alternative pylink-rtt pylink-swv pylink + +%postun +%python_uninstall_alternative pylink-rtt + +%files %{python_files} +%doc CHANGELOG.md README.md +%license LICENSE.md +%python_alternative %{_bindir}/pylink-rtt +%python_alternative %{_bindir}/pylink-swv +%python_alternative %{_bindir}/pylink +%{python_sitelib}/pylink/ +%{python_sitelib}/pylink_square-%{version}.dist-info + +%changelog