Use GitHub source to get tests; omit tox
The PyPi tarball doesn't have any tests in it, so this package isn't really testing anything. Switch the source to the GitHub release to download tests as part of the source. Also use pytest for tests in place of tox since the tests work the same way and we avoid tox dependencies going back into EPEL. Add an import check in %check as well. Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
parent
ed2b4702a6
commit
08e9535358
@ -6,15 +6,19 @@
|
||||
|
||||
Name: python-%{pypi_name}
|
||||
Version: 11.0.3
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: Implementation of the WebSocket Protocol for Python
|
||||
|
||||
License: BSD
|
||||
URL: https://github.com/aaugustin/websockets
|
||||
Source0: %pypi_source
|
||||
Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: gcc
|
||||
|
||||
%if %{with tests}
|
||||
BuildRequires: python3dist(pytest)
|
||||
%endif
|
||||
|
||||
%global _description %{expand:
|
||||
websockets is a library for developing WebSocket servers and clients in
|
||||
Python. It implements RFC 6455 with a focus on correctness and simplicity. It
|
||||
@ -36,7 +40,7 @@ BuildRequires: python3-devel
|
||||
%autosetup -n %{pypi_name}-%{version} -p1
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires %{?with_tests:-t}
|
||||
%pyproject_buildrequires
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
@ -46,8 +50,11 @@ BuildRequires: python3-devel
|
||||
%pyproject_save_files websockets
|
||||
|
||||
%check
|
||||
%pyproject_check_import
|
||||
|
||||
%if %{with tests}
|
||||
%tox
|
||||
# Skip some tests that require network connectivity and/or a running daemon.
|
||||
%pytest --ignore compliance --ignore tests/sync -k "not test_explicit_host_port"
|
||||
%endif
|
||||
|
||||
|
||||
@ -55,6 +62,11 @@ BuildRequires: python3-devel
|
||||
%doc README.rst
|
||||
|
||||
%changelog
|
||||
* Wed Jun 28 2023 Major Hayden <major@redhat.com> - 11.0.3-2
|
||||
- Switch to GitHub source to get tests
|
||||
- Replace tox with pytest
|
||||
- Add pyproject_check_import
|
||||
|
||||
* Wed Jun 28 2023 Major Hayden <major@redhat.com> - 11.0.3-1
|
||||
- Update to 11.0.3
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user