diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..23bc7b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/matrix-common-1.0.0.tar.gz diff --git a/0001-Add-test-extra.patch b/0001-Add-test-extra.patch new file mode 100644 index 0000000..da16b53 --- /dev/null +++ b/0001-Add-test-extra.patch @@ -0,0 +1,45 @@ +From a24740f61299cfc628715212def51318bde00c7b Mon Sep 17 00:00:00 2001 +From: "Kai A. Hiller" +Date: Wed, 26 Jan 2022 21:55:09 +0100 +Subject: [PATCH 1/2] Add test extra + +--- + setup.cfg | 5 +++-- + tox.ini | 2 +- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/setup.cfg b/setup.cfg +index d54b7a4..75f55d6 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -23,11 +23,12 @@ matrix_common = py.typed + + + [options.extras_require] +-dev = +- # for tests ++test = + tox + twisted + aiounittest ++dev = ++ %(test)s + # for type checking + mypy == 0.910 + # for linting +diff --git a/tox.ini b/tox.ini +index 291e9b2..952b7ea 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -15,7 +15,7 @@ isolated_build = true + # creates a symlink to the project directory instead of unpacking the sdist. + usedevelop=true + +-extras = dev ++extras = test + + commands = + python -m twisted.trial tests +-- +2.34.1 + diff --git a/python-matrix-common.spec b/python-matrix-common.spec new file mode 100644 index 0000000..28b5013 --- /dev/null +++ b/python-matrix-common.spec @@ -0,0 +1,61 @@ +%global srcname matrix-common +%global releasename matrix-python-common +%global pymodulename matrix_common + +Name: python-%{srcname} +Version: 1.0.0 +Release: 1%{?dist} +Summary: Common utilities for Synapse, Sydent and Sygnal + +License: ASL 2.0 +URL: https://github.com/matrix-org/%{releasename} +Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz +# https://github.com/matrix-org/matrix-python-common/pull/19 +Patch0: 0001-Add-test-extra.patch +BuildArch: noarch +BuildRequires: python3-devel + +%global _description %{expand: +Common utilities for Synapse, Sydent and Sygnal.} + +%description %_description + +%package -n python3-%{srcname} +Summary: %{summary} + +%description -n python3-%{srcname} %_description + + +%prep +%autosetup -p1 -n %{releasename}-%{version} + + +%generate_buildrequires +%pyproject_buildrequires -e py + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files %{pymodulename} + + +%check +# Make sure only installed modules are tested by removing all local ones. +# https://github.com/matrix-org/matrix-python-common/issues/16 +find . -maxdepth 2 -name '__init__.py' -exec dirname {} \; | grep -v ^\./tests | xargs rm -rf +%tox + + +%files -n python3-%{srcname} -f %{pyproject_files} +%doc README.md +%license LICENSE + + +%changelog +* Sat Jan 08 2022 Kai A. Hiller - 1.0.0-1 +- Initial package +- Fixes rhbz#2038993 diff --git a/sources b/sources new file mode 100644 index 0000000..459b9d5 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (matrix-common-1.0.0.tar.gz) = 0050243ce3930962934f94fe1c990dc97ce803e79998ee7e6c7dafdf5ca4736c8c06fd4f52223b81f2ceb91a8bcf70f6488559f7935a9bd087c33a11430af8cd