diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..fcc7b97
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ test
+
diff --git a/python-python-socks.changes b/python-python-socks.changes
index 521c897..e7ead6e 100644
--- a/python-python-socks.changes
+++ b/python-python-socks.changes
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Mon Apr 22 06:46:07 UTC 2024 - Matej Cepl
+
+- Use tarball from GitHub (gh#romis2012/python-socks#30) to make
+ running the test suite possible.
+- Fix dependencies (bsc#1223181).
+
-------------------------------------------------------------------
Mon Jan 1 20:31:36 UTC 2024 - Dirk Müller
diff --git a/python-python-socks.spec b/python-python-socks.spec
index d8c1cfe..64f2f71 100644
--- a/python-python-socks.spec
+++ b/python-python-socks.spec
@@ -16,20 +16,46 @@
#
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
%{?sle15_python_module_pythons}
-Name: python-python-socks
+Name: python-python-socks%{psuffix}
Version: 2.4.4
Release: 0
Summary: Core proxy client functionality for Python
License: Apache-2.0
URL: https://github.com/romis2012/python-socks
-Source: https://files.pythonhosted.org/packages/source/p/python-socks/python-socks-%{version}.tar.gz
+# gh#romis2012/python-socks#30
+Source: https://github.com/romis2012/python-socks/archive/refs/tags/v%{version}.tar.gz#/python-socks-%{version}.tar.gz
+BuildRequires: %{python_module anyio}
+BuildRequires: %{python_module async-timeout}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
+# Source: https://files.pythonhosted.org/packages/source/p/python-socks/python-socks-%%{version}.tar.gz
BuildRequires: %{python_module wheel}
+# SECTION test requirements
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
+%if %{with test}
+BuildRequires: %{python_module Flask}
+BuildRequires: %{python_module async_timeout}
+BuildRequires: %{python_module attrs}
+BuildRequires: %{python_module flake8}
+BuildRequires: %{python_module pytest-asyncio}
+BuildRequires: %{python_module pytest-trio}
+BuildRequires: %{python_module pytest}
+BuildRequires: %{python_module tiny-proxy}
+BuildRequires: %{python_module trio}
+BuildRequires: %{python_module trustme}
+BuildRequires: %{python_module yarl}
+%endif
%python_subpackages
%description
@@ -42,20 +68,28 @@ directly. It is used internally by aiohttp-socks and httpx-socks packages.
%autosetup -p1 -n python-socks-%{version}
%build
+%if %{without test}
%pyproject_wheel
+%endif
%install
+%if %{without test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
+%if %{with test}
# try at least a simple import
-%python_exec -c 'from python_socks import ProxyType'
+%pytest
+%endif
+%if %{without test}
%files %{python_files}
%doc README.md
%license LICENSE.txt
%{python_sitelib}/python_socks
%{python_sitelib}/python_socks-%{version}.dist-info
+%endif
%changelog
diff --git a/python-socks-2.4.4.tar.gz b/python-socks-2.4.4.tar.gz
index 5f2bc8b..0ad07ce 100644
--- a/python-socks-2.4.4.tar.gz
+++ b/python-socks-2.4.4.tar.gz
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e5a8e4f78203612c813946feacd87b98943965a04389fe221fa1e9ab263ad22e
-size 25792
+oid sha256:2fd4a78f8ddeee7e01a93752115efa92dfb3f371bb2ac0566d0bb64c959f25b1
+size 31998