diff --git a/-1.18.2.tar.gz b/-1.18.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python-mypy.spec b/python-mypy.spec index 99e13581d1a50d1250b75cdfb7b7c1420ae47f5f..7bb2eaa1956865e857371ffba55daef70c3ef17a 100644 --- a/python-mypy.spec +++ b/python-mypy.spec @@ -1,11 +1,12 @@ %global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-mypy Version: 1.18.2 Release: 1 Summary: Optional static typing for Python License: MIT and Python-2.0 URL: https://github.com/python/mypy -Source0: https://github.com/python/mypy/archive/refs/tags/v%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/-//-%{version}.tar.gz Requires: python3-typed-ast Requires: python3-typing-extensions @@ -13,6 +14,17 @@ Requires: python3-mypy-extensions Requires: python3-tomli Requires: python3-psutil +BuildRequires: python3-wheel +BuildRequires: python3-build +BuildRequires: python3-hatchling +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: python3-pip +BuildRequires: python3-pbr +BuildRequires: help2man + %description Add type annotations to your Python programs, and use mypy to type check them. Mypy is essentially a Python linter on steroids, and it @@ -24,13 +36,6 @@ types. %package -n python3-mypy Summary: Optional static typing for Python Provides: python-mypy -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-cffi -BuildRequires: gcc -BuildRequires: python3-pip -BuildRequires: python3-pbr -BuildRequires: help2man %description -n python3-mypy Add type annotations to your Python programs, and use mypy to type check them. Mypy is essentially a Python linter on steroids, and it @@ -53,11 +58,29 @@ types. %prep %autosetup -n mypy-%{version} +# 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 + %build -%py3_build +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" +%pyproject_build %install -%py3_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 rm -vrf %{buildroot}%{python3_sitelib}/mypy/{test,typeshed/tests} ln -s /usr/share/typeshed %{buildroot}%{python3_sitelib}/mypy/typeshed @@ -106,6 +129,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Thu Nov 27 2025 zhangzeyang0718 - 1.18.2-1 +- Update package to version 1.18.2 + * Mon Nov 10 2025 lixiaoyong - 1.18.2-1 - Update to 1.18.2 - Improve self check performance by 1.8% diff --git a/v1.18.2.tar.gz b/v1.18.2.tar.gz deleted file mode 100644 index 52847eeae541227a13d7effb2ba8f9b7e750f7b2..0000000000000000000000000000000000000000 Binary files a/v1.18.2.tar.gz and /dev/null differ