pyproject-rpm-macros/tests/python-entrypoints.spec
Miro Hrončok 2660031756 CI tests: Use ! grep to assert something is missing
Previously, we have used `grep -v` to assert something is *not* there.
However, that doesn't work. See for example this file:

    $ cat TEST
    line1
    line2
    line3

    $ grep -v line4 TEST
    line1
    line2
    line3
    $ echo $?
    0

This gives a false sense of correctness, however it exits will 0 with anything:

    $ grep -v line3 TEST
    line1
    line2
    $ echo $?
    0

Instead, we use `! grep` now:

    $ ! grep line4 TEST
    $ echo $?
    0

    $ ! grep line3 TEST
    line3
    $ echo $?
    1

Additionally, remove a trailing slash from one of the checks to match both cases
(with or without the slash).
2020-10-26 17:18:51 +01:00

53 lines
1.0 KiB
RPMSpec

%global pypi_name entrypoints
Name: python-%{pypi_name}
Version: 0.3
Release: 0%{?dist}
Summary: Discover and load entry points from installed packages
License: MIT
URL: https://entrypoints.readthedocs.io/
Source0: %{pypi_source}
BuildArch: noarch
BuildRequires: pyproject-rpm-macros
BuildRequires: python3-devel
%description
This package contains one .py module
Building this tests the flit build backend.
%package -n python3-%{pypi_name}
Summary: %{summary}
%description -n python3-%{pypi_name}
%{summary}.
%prep
%autosetup -p1 -n %{pypi_name}-%{version}
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files entrypoints
%check
# Internal check: Top level __pycache__ is never owned
! grep -E '/__pycache__$' %{pyproject_files}
! grep -E '/__pycache__/$' %{pyproject_files}
grep -F '/__pycache__/' %{pyproject_files}
%files -n python3-%{pypi_name} -f %{pyproject_files}
%doc README.rst
%license LICENSE