Notification time stamped 2023-06-30 14:54:09 UTC
From 7c11890061c022fb001fd141c5da52fa058ba608 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley code@musicinmybrain.net Date: Jun 30 2023 14:14:03 +0000 Subject: Initial package (close RHBZ#2218306)
---
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..74c8875 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/dirty_equals-0.6.0.tar.gz diff --git a/python-dirty-equals.spec b/python-dirty-equals.spec new file mode 100644 index 0000000..e0c1723 --- /dev/null +++ b/python-dirty-equals.spec @@ -0,0 +1,87 @@ +Name: python-dirty-equals +Version: 0.6.0 +Release: %autorelease +Summary: Doing dirty (but extremely useful) things with equals + +# SPDX +License: MIT +URL: https://github.com/samuelcolvin/dirty-equals +Source: %{pypi_source dirty_equals} + +BuildArch: noarch + +BuildRequires: python3-devel + +%global common_description %{expand: +The dirty-equals Python library (mis)uses the __eq__ method to make python code +(generally unit tests) more declarative and therefore easier to read and write. + +You can use dirty-equals in whatever context you like, but it comes into its +own when writing unit tests for applications where you’re commonly checking the +response to API calls and the contents of a database.} + +%description %{common_description} + + +%package -n python3-dirty-equals +Summary: %{summary} + +%description -n python3-dirty-equals %{common_description} + + +%pyproject_extras_subpkg -n python3-dirty-equals pydantic + + +%prep +%autosetup -n dirty_equals-%{version} + +# Patch out coverage analysis dependencies +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters +# +# Patch out pytest-pretty, which is purely cosmetic +# +# Patch out pytest-examples, which would enable tests in tests/test_docs.py, +# but which has a hard dependency on ruff, a Python linter written in Rust that +# would be useful but nontrivial to package. +sed -r 's/^(coverage|pytest-(pretty|examples))/# \1/' requirements/tests.in | + tee requirements/tests-filtered.txt + +# Erroring on DeprecationWarnings makes sense upstream, but is probably too +# strict for distribution packaging. +# +# This specifically works around: +# +# DeprecationWarning for datetime.utcfromtimestamp() in Python 3.12 +# https://github.com/samuelcolvin/dirty-equals/issues/71 +sed -r -i 's/^filterwarnings = "error"$/# &/' pyproject.toml + + +%generate_buildrequires +%pyproject_buildrequires -x pydantic requirements/tests-filtered.txt + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files dirty_equals + + +%check +# Tests in this module require pytest-examples; see %%prep for notes on this. +ignore="${ignore-} --ignore=tests/test_docs.py" + +# unix datetime tests fail if TZ != UTC +# dirty_equals-0.6.0/tests/test_docs.py +TZ=utc %pytest -v ${ignore-} + + +%files -n python3-dirty-equals -f %{pyproject_files} +# pyproject_files handles LICENSE; verify with “rpm -qL -p …” +%doc README.md + + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..854f945 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (dirty_equals-0.6.0.tar.gz) = 75d47d5604bb2e3f3920b02f400e651b9189f95ed883a92c3624a1347ed2827baa4bdee560b0cd00cc723d5ec90c808110d11e488a294188fc7370b940ae3f36
https://src.fedoraproject.org/rpms/python-dirty-equals/c/7c11890061c022fb001...
scm-commits@lists.fedoraproject.org