diff --git a/python-safety.spec b/python-safety.spec index f2d10fec4d0d608780c474da5863cb5ebc4ba409..4a6d43b146d592a5917d02130aaf19b5e037d78c 100644 --- a/python-safety.spec +++ b/python-safety.spec @@ -1,13 +1,15 @@ %global pypi_name safety +%global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-%{pypi_name} -Version: 3.6.1 +Version: 3.7.0 Release: 1 Summary: Safety checks Python dependencies for known security vulnerabilities and suggests the proper remediations for vulnerabilities detected. License: MIT URL: https://github.com/pyupio/safety -Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/s/safety/safety-%{version}.tar.gz BuildArch: noarch @@ -38,6 +40,8 @@ BuildRequires: python3-tenacity BuildRequires: python3-nltk +BuildRequires: python3-build + %description Safety checks Python dependencies for known security vulnerabilities and suggests the proper remediations for vulnerabilities detected. Safety can be run on developer machines, in CI/CD pipelines and on production systems. @@ -51,13 +55,31 @@ Safety checks Python dependencies for known security vulnerabilities and suggest %prep %autosetup -n %{pypi_name}-%{version} -p1 + +# Fix setuptools_scm version issue +if [ -f pyproject.toml ]; then + sed -i '/^version *=/d' pyproject.toml + sed -i '/^\[project\]/a version = "%{version}"' pyproject.toml + sed -i '/dynamic *= *\[.*version.*\]/d' pyproject.toml + if grep -q '^\[tool\.setuptools_scm\]' pyproject.toml; then + sed -i '/^\[tool\.setuptools_scm\]/,/^\[/ {/^write_to *=/d}' pyproject.toml + sed -i '/^\[tool\.setuptools_scm\]/a fallback_version = "%{version}"' pyproject.toml + fi +fi sed -i 's/~=/>=/g' pyproject.toml sed -i 's#<2.10.0#<2.12#g' pyproject.toml %build +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" %pyproject_build %install +export PYTHONDONTWRITEBYTECODE=1 + +# Clean __pycache__ directories and .pyc/.pyo files +find %{buildroot} -name '*.py[co]' -delete +find %{buildroot} -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" %pyproject_install %check @@ -75,11 +97,14 @@ k="${k-}${k+ and }not test_get_packages_licenses_without_api_key" %doc README.md %license LICENSES %{python3_sitelib}/%{pypi_name} -%{python3_sitelib}/%{pypi_name}-*.dist-info +%{python3_sitelib}/%{pypi_name}-*.dist-info/ %{_bindir}/safety %changelog +* Mon Dec 01 2025 zhangzeyang0718 - 3.7.0-1 +- Update package to version 3.7.0 + * Wed Sep 10 2025 liutao1 - 3.6.1-1 - Import rich_utils as a module and don't access as an attribute diff --git a/safety-3.6.1.tar.gz b/safety-3.6.1.tar.gz deleted file mode 100644 index 562e666f01413c01c67307be65e243bda2cc7531..0000000000000000000000000000000000000000 Binary files a/safety-3.6.1.tar.gz and /dev/null differ diff --git a/safety-3.7.0.tar.gz b/safety-3.7.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..cd02dc839e60668af798b139edc5e0594f6f5809 Binary files /dev/null and b/safety-3.7.0.tar.gz differ