PyMiniRacer 编译过程
https://bpcreech.com/PyMiniRacer/contributing/
- 打开 Windows 设置
- 进入"更新和安全" -> "开发者选项"
- 启用"开发人员模式"
# Windows CMD
set HTTP_PROXY=http://127.0.0.1:你的代理端口
set HTTPS_PROXY=http://127.0.0.1:你的代理端口
# Windows PowerShell
$env:HTTP_PROXY="http://127.0.0.1:你的代理端口"
$env:HTTPS_PROXY="http://127.0.0.1:你的代理端口"
---
git config --global http.proxy http://127.0.0.1:你的代理端口
git config --global https.proxy http://127.0.0.1:你的代理端口
$ git config --global core.autocrlf false
$ git config --global core.filemode false
$ git config --global core.fscache true
$ git config --global core.preloadindex true
-----
pip install httplib2
pip install packaging
python helpers/v8_build.py
第二次 加参数 --skip-fetch
-----
# 设置 PYTHONPATH 以便能够导入刚刚构建的模块
set PYTHONPATH=src # Windows CMD
# 或者在 PowerShell 中:
$env:PYTHONPATH="src"
---
# 进入 Python 交互环境测试
python
>>> from py_mini_racer import MiniRacer
>>> mr = MiniRacer()
>>> mr.eval('6*7') # 应该返回 42
>>> exit()
---
# 在 PowerShell 中运行
$env:HTTP_PROXY=""
$env:HTTPS_PROXY=""
# 或在 CMD 中运行
set HTTP_PROXY=
set HTTPS_PROXY=
----
hatch build