diff --git a/pyproject.toml b/pyproject.toml index d7a4ccb29..b20637863 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,10 @@ +[build-system] +requires = ["setuptools~=84.0.0"] +build-backend = "setuptools.build_meta" + [project] name = "moviepilot" -# MoviePilot 不作为 Python 包发布,产品版本继续由 version.py 管理。 -version = "0" +dynamic = ["version"] requires-python = ">=3.14" dependencies = [ "aiofiles~=25.1.0", @@ -128,3 +131,9 @@ required-environments = [ "sys_platform == 'darwin' and platform_machine == 'arm64'", "sys_platform == 'win32' and platform_machine == 'AMD64'", ] + +[tool.setuptools] +py-modules = ["version"] + +[tool.setuptools.dynamic] +version = { attr = "version.APP_VERSION" } diff --git a/setup.py b/setup.py deleted file mode 100644 index 2b2b4df50..000000000 --- a/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -from setuptools import setup, Extension -from Cython.Build import cythonize -import glob - -# 递归获取所有.py文件 -sources = glob.glob("app/**/*.py", recursive=True) - -# 移除不需要编译的文件 -sources.remove("app/main.py") - -# 配置编译参数(可选优化选项) -extensions = [ - Extension( - name=path.replace("/", ".").replace(".py", ""), - sources=[path], - extra_compile_args=["-O3", "-ffast-math"], - ) - for path in sources -] - -setup( - name="MoviePilot", - author="jxxghp", - ext_modules=cythonize( - extensions, - build_dir="build", - compiler_directives={ - "language_level": "3", - "auto_pickle": False, - "embedsignature": True, - "annotation_typing": True, - "infer_types": True, - "binding": True, - } - ), - script_args=["build_ext", "-j8", "--inplace"], -) diff --git a/uv.lock b/uv.lock index 0fbbba493..ba6ed2875 100644 --- a/uv.lock +++ b/uv.lock @@ -1472,7 +1472,6 @@ wheels = [ [[package]] name = "moviepilot" -version = "0" source = { virtual = "." } dependencies = [ { name = "aiofiles" },