## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 4; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec %global forgeurl https://github.com/pytest-dev/pytest-bdd %global tag %{version} # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # # We can generate PDF documentation as a substitute. %bcond_without doc_pdf Name: python-pytest-bdd Version: 5.0.0 %forgemeta Release: %autorelease Summary: BDD library for the py.test runner License: MIT URL: https://pytest-bdd.readthedocs.io/en/latest/ Source0: %{forgesource} # Downstream man page, written for Fedora in groff_man(7) format based on the # command’s --help output. Source1: pytest-bdd.1 BuildArch: noarch BuildRequires: python3-devel # Required for: tests/feature/test_report.py::test_complex_types BuildRequires: python3dist(pytest-xdist) # Documentation %if %{with doc_pdf} BuildRequires: make BuildRequires: python3dist(sphinx) BuildRequires: python3-sphinx-latex BuildRequires: latexmk BuildRequires: tex-xetex-bin %endif %global common_description %{expand: pytest-bdd implements a subset of the Gherkin language to enable automating project requirements testing and to facilitate behavioral driven development. Unlike many other BDD tools, it does not require a separate runner and benefits from the power and flexibility of pytest. It enables unifying unit and functional tests, reduces the burden of continuous integration server configuration and allows the reuse of test setups. Pytest fixtures written for unit tests can be reused for setup and actions mentioned in feature steps with dependency injection. This allows a true BDD just-enough specification of the requirements without maintaining any context object containing the side effects of Gherkin imperative declarations.} %description %{common_description} %package -n python3-pytest-bdd Summary: %{summary} %description -n python3-pytest-bdd %{common_description} %package doc Summary: Documentation for pytest-bdd %description doc %{common_description} %prep %forgeautosetup cp -p '%{SOURCE1}' . # Since pdflatex cannot handle Unicode inputs in general: echo "latex_engine = 'xelatex'" >> docs/conf.py %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %if %{with doc_pdf} PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}' %make_build -C docs/_build/latex LATEXMKOPTS='-quiet' %endif %install %pyproject_install %pyproject_save_files pytest_bdd install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 -D pytest-bdd.1 %check # Work around unexpected PytestAssertRewriteWarning with pip 21.3 # https://github.com/pytest-dev/pytest-bdd/issues/453 mkdir -p _empty && cp -rp tests *.ini _empty && cd _empty # https://github.com/pytest-dev/pytest-bdd/issues/466 k="${k-}${k+ and }not test_when_fails_inline" k="${k-}${k+ and }not test_feature_path_not_found" k="${k-}${k+ and }not test_feature_path_ok" k="${k-}${k+ and }not test_feature_path_by_param_not_found" k="${k-}${k+ and }not test_feature_path_by_param_ok" k="${k-}${k+ and }not test_step_trace" %pytest -k "${k-}" %files -n python3-pytest-bdd -f %{pyproject_files} %{_bindir}/pytest-bdd %{_mandir}/man1/pytest-bdd.1* %files doc %license LICENSE.txt %doc AUTHORS.rst %doc CHANGES.rst %doc README.rst %if %{with doc_pdf} %doc docs/_build/latex/Pytest-BDD.pdf %endif %changelog * ven. déc. 17 2021 Benjamin A. Beasley 5.0.0-4 - Work around test failures with pytest 7 * ven. déc. 17 2021 Benjamin A. Beasley 5.0.0-3 - Add pytest-xdist build dependency so no tests are skipped * sam. nov. 27 2021 Benjamin A. Beasley 5.0.0-2 - Reduce LaTeX PDF build verbosity * lun. oct. 25 2021 Benjamin A. Beasley 5.0.0-1 - Update to 5.0.0 (close RHBZ#2017125) * ven. oct. 15 2021 Benjamin A. Beasley 4.1.0-9 - Corrected improved PytestAssertRewriteWarning / pip 21.3 workaround * ven. oct. 15 2021 Benjamin A. Beasley 4.1.0-8 - Improved PytestAssertRewriteWarning / pip 21.3 workaround * jeu. oct. 14 2021 Benjamin A. Beasley 4.1.0-7 - Work around unexpected warning after pip 21.3 update * mer. sept. 29 2021 Benjamin A. Beasley 4.1.0-6 - Generate PDF instead of HTML Sphinx documentation. * lun. sept. 13 2021 Benjamin A. Beasley 4.1.0-5 - Let pyproject-rpm-macros handle the license file * dim. sept. 12 2021 Benjamin A. Beasley 4.1.0-4 - Drop BR on pyproject-rpm-macros, now implied by python3-devel * dim. sept. 12 2021 Benjamin A. Beasley 4.1.0-3 - Reduce spec file macro indirection * jeu. août 12 2021 Benjamin A. Beasley 4.1.0-2 - Run tests (and get test BR’s) using tox * mar. août 03 2021 Benjamin A. Beasley 4.1.0-1 - Initial package