diff --git a/0001-Fix-test-error-for-new-versions.patch b/0001-Fix-test-error-for-new-versions.patch new file mode 100644 index 0000000000000000000000000000000000000000..4cd0303224f7d9ea4934e362e1352592ca1d1c41 --- /dev/null +++ b/0001-Fix-test-error-for-new-versions.patch @@ -0,0 +1,28 @@ +From a94054c8b94dc3780843b72c7f6733efe5562860 Mon Sep 17 00:00:00 2001 +From: desert-sailor +Date: Mon, 10 Mar 2025 11:21:45 +0800 +Subject: [PATCH] Fix test error for new versions + +--- + tests/models/test_models.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tests/models/test_models.py b/tests/models/test_models.py +index b2a953a..e5b1343 100644 +--- a/tests/models/test_models.py ++++ b/tests/models/test_models.py +@@ -31,7 +31,10 @@ class TestModels: + "root['$defs']['DeniedVulnerabilityConfig']", + "root['$defs']['PackageDefinition']", + "root['$defs']['VulnerabilityDefinition']", +- "root['$defs']['PackageEcosystem']"} ++ "root['$defs']['PackageEcosystem']", ++ "root['$defs']['FileType']", ++ "root['$defs']['ScanConfigModel']['properties']['include_files']['propertyNames']", ++ "root['$defs']['ReportSchemaVersion']['const']"} + + @pytest.mark.parametrize("model, model_name", [(model, name) for name, model in inspect.getmembers(importlib.import_module(MODULE_NAME), inspect.isclass) if hasattr(model, "__annotations__") and not issubclass(model, Enum)]) + def test_model(self, model, model_name): +-- +2.43.0 + diff --git a/python-safety-schemas.spec b/python-safety-schemas.spec new file mode 100644 index 0000000000000000000000000000000000000000..6434e493216e5953401232035aab26f36165e4a6 --- /dev/null +++ b/python-safety-schemas.spec @@ -0,0 +1,63 @@ +%global pypi_name safety-schemas + +Name: python-%{pypi_name} +Version: 0.0.11 +Release: 1 +Summary: Schemas for Safety tools + +License: MIT +URL: https://github.com/pyupio/safety_schemas +Source: https://files.pythonhosted.org/packages/91/a2/e75f7de6a0872ed80b4b09221a9640d5856a8c3730ba59534d3007c9ae3a/safety_schemas-0.0.11.tar.gz +Patch1: 0001-Fix-test-error-for-new-versions.patch + +BuildArch: noarch + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-hatchling +BuildRequires: python3-packaging +BuildRequires: python3-typing-extensions +# for test +BuildRequires: python3-pytest +BuildRequires: python3-pydantic +BuildRequires: python3-dparse +BuildRequires: python3-deepdiff +BuildRequires: python3-ruamel-yaml + +%description +Schemas for Safety tools + + +%package -n python3-%{pypi_name} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{pypi_name}} + +%description -n python3-%{pypi_name} +Schemas for Safety tools + +%prep +%autosetup -n safety_schemas-%{version} -p1 +sed -i 's#2.10.0#2.11#g' pyproject.toml + +%build +%pyproject_build + +%install +%pyproject_install + +%check +%pytest + + +%files -n python3-%{pypi_name} +%license LICENSE +%doc README.md +%{python3_sitelib}/safety_schemas +%{python3_sitelib}/safety_schemas-*.dist-info + + +%changelog +* Thu Mar 13 2025 Dongxing Wang - 0.0.11-1 +- Initial package. diff --git a/safety_schemas-0.0.11.tar.gz b/safety_schemas-0.0.11.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..25f6e1db86d9abb615f8b70f528c02a4f643ab6d Binary files /dev/null and b/safety_schemas-0.0.11.tar.gz differ