diff --git a/dirty_equals-0.8.0.tar.gz b/dirty_equals-0.8.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ae6699b817f614bd45318e60e898f82f7276bef1 Binary files /dev/null and b/dirty_equals-0.8.0.tar.gz differ diff --git a/files_in_srpm.txt b/files_in_srpm.txt new file mode 100644 index 0000000000000000000000000000000000000000..4c9a270592c44b4112394ec1d0e63b6e7e672da2 --- /dev/null +++ b/files_in_srpm.txt @@ -0,0 +1,2 @@ +dirty_equals-0.8.0.tar.gz +python-dirty-equals.spec diff --git a/python-dirty-equals.spec b/python-dirty-equals.spec new file mode 100644 index 0000000000000000000000000000000000000000..42958d349f47df1e05ce39ee7bcb6cadc5bb253e --- /dev/null +++ b/python-dirty-equals.spec @@ -0,0 +1,94 @@ +# Break a circular build dependency with python-pydantic +Name: python-dirty-equals +Version: 0.8.0 +Release: 1 +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 +BuildRequires: python3-setuptools +BuildRequires: python3-pbr +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-hatchling +# for test +BuildRequires: python3-pytest +BuildRequires: python3-pydantic +BuildRequires: python3-pytz + +%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 is not yet packaged. +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 + + +%build +%pyproject_build + + +%install +%pyproject_install + + +%check +# Tests in this module require pytest-examples; see %%prep for notes on this. +ignore="${ignore-} --ignore=tests/test_docs.py" +# Imports in this module require Pydantic. +ignore="${ignore-} --ignore=tests/test_other.py" + +# Some tests require TZ == UTC; see the “test” target in the Makefile +TZ=UTC %pytest -- -v ${ignore-} + + +%files -n python3-dirty-equals +%license LICENSE +%doc README.md +%{python3_sitelib}/dirty_equals-*.dist-info/ +%{python3_sitelib}/dirty_equals + + +%changelog +* Mon Dec 16 2024 Dongxing Wang - 0.8.0-1 +- Package init diff --git a/python-dirty-equals.src.rpm b/python-dirty-equals.src.rpm new file mode 100644 index 0000000000000000000000000000000000000000..9da6cfd0dc19b32c6fd967c879ba9fd4040de61d Binary files /dev/null and b/python-dirty-equals.src.rpm differ