Ai
3 Star 7 Fork 0

Gitee 极速下载/Dulwich

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/jelmer/dulwich
克隆/下载
setup.py 2.31 KB
一键复制 编辑 原始数据 按行查看 历史
Jelmer Vernooij 提交于 2025-07-03 23:46 +08:00 . Minor fixes
#!/usr/bin/python3
# Setup file for dulwich
# Copyright (C) 2008-2022 Jelmer Vernooij <jelmer@jelmer.uk>
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
import os
import sys
from setuptools import setup
if sys.platform == "darwin" and os.path.exists("/usr/bin/xcodebuild"):
# XCode 4.0 dropped support for ppc architecture, which is hardcoded in
# distutils.sysconfig
import subprocess
p = subprocess.Popen(
["/usr/bin/xcodebuild", "-version"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env={},
)
out, err = p.communicate()
for line in out.splitlines():
line = line.decode("utf8")
# Also parse only first digit, because 3.2.1 can't be parsed nicely
if line.startswith("Xcode") and int(line.split()[1].split(".")[0]) >= 4:
os.environ["ARCHFLAGS"] = ""
tests_require = ["fastimport"]
if "__pypy__" not in sys.modules and sys.platform != "win32":
tests_require.extend(["gevent", "geventhttpclient", "setuptools>=17.1"])
optional = os.environ.get("CIBUILDWHEEL", "0") != "1"
# Ideally, setuptools would just provide a way to do this
if "PURE" in os.environ or "--pure" in sys.argv:
if "--pure" in sys.argv:
sys.argv.remove("--pure")
setup_requires = []
rust_extensions = [] # type: list["RustExtension"]
else:
setup_requires = ["setuptools_rust"]
# We check for egg_info since that indicates we are running prepare_metadata_for_build_*
if "egg_info" in sys.argv:
rust_extensions = []
else:
from setuptools_rust import Binding, RustExtension
rust_extensions = [
RustExtension(
"dulwich._objects",
"crates/objects/Cargo.toml",
binding=Binding.PyO3,
optional=optional,
),
RustExtension(
"dulwich._pack",
"crates/pack/Cargo.toml",
binding=Binding.PyO3,
optional=optional,
),
RustExtension(
"dulwich._diff_tree",
"crates/diff-tree/Cargo.toml",
binding=Binding.PyO3,
optional=optional,
),
]
setup(
package_data={"": ["py.typed"]},
rust_extensions=rust_extensions,
setup_requires=setup_requires,
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mirrors/dulwich.git
git@gitee.com:mirrors/dulwich.git
mirrors
dulwich
Dulwich
master

搜索帮助