mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 10:23:32 +00:00
cppdocs: Switch from pipenv to uv
uv is generally faster than pip, and we save ourselves the step of installing/upgrading that in the CI.
This commit is contained in:
parent
0d8ecc6bc6
commit
b9c82876c8
4 changed files with 23 additions and 36 deletions
8
.github/workflows/build_docs.yaml
vendored
8
.github/workflows/build_docs.yaml
vendored
|
@ -55,9 +55,8 @@ jobs:
|
|||
with:
|
||||
crate: cargo-about
|
||||
version: "=0.6.6"
|
||||
- name: Upgrade pip and install pipenv
|
||||
run: |
|
||||
sudo apt-get install python3-pip pipenv
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
- name: Remove docs from cache # Avoid stale docs
|
||||
run: |
|
||||
rm -rf target/doc target/cppdocs api/node/docs
|
||||
|
@ -141,9 +140,6 @@ jobs:
|
|||
run: pnpm run docs
|
||||
working-directory: api/node
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
|
||||
- name: Setup headless display
|
||||
uses: pyvista/setup-headless-display-action@v4
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
[[source]]
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
|
||||
[dev-packages]
|
||||
|
||||
[packages]
|
||||
breathe = ">=4.33.1"
|
||||
sphinx = "==7.1.2"
|
||||
exhale = ">=0.2.4"
|
||||
myst_parser = ">=0.17.2"
|
||||
sphinx-markdown-tables = ">=0.0.15"
|
||||
furo = ">=2022.12.7"
|
||||
sphinxcontrib-jquery = ">=4.1"
|
||||
|
||||
[requires]
|
||||
python_version = "3"
|
17
api/cpp/docs/pyproject.toml
Normal file
17
api/cpp/docs/pyproject.toml
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
[project]
|
||||
name = "slint-cppdocs"
|
||||
version = "0.1"
|
||||
description = "Python env for running sphinx, breathe, etc."
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
"breathe>=4.33.1",
|
||||
"exhale>=0.2.4",
|
||||
"furo>=2022.12.7",
|
||||
"myst-parser>=0.17.2",
|
||||
"sphinx==7.1.2",
|
||||
"sphinx-markdown-tables>=0.0.15",
|
||||
"sphinxcontrib-jquery>=4.1",
|
||||
]
|
|
@ -106,7 +106,7 @@ pub fn generate(show_warnings: bool, experimental: bool) -> Result<(), Box<dyn s
|
|||
};
|
||||
cbindgen::gen_all(&root, &generated_headers_dir, enabled_features)?;
|
||||
|
||||
let pip_env = vec![(OsString::from("PIPENV_PIPFILE"), docs_source_dir.join("docs/Pipfile"))];
|
||||
let uv_project = vec![(OsString::from("UV_PROJECT"), docs_source_dir.join("docs"))];
|
||||
|
||||
println!("Generating third-party license list with cargo-about");
|
||||
|
||||
|
@ -121,7 +121,7 @@ pub fn generate(show_warnings: bool, experimental: bool) -> Result<(), Box<dyn s
|
|||
"-o",
|
||||
docs_build_dir.join("thirdparty.md").to_str().unwrap(),
|
||||
],
|
||||
pip_env.clone(),
|
||||
std::iter::empty::<(std::ffi::OsString, std::ffi::OsString)>(),
|
||||
)?;
|
||||
|
||||
println!(
|
||||
|
@ -130,22 +130,17 @@ pub fn generate(show_warnings: bool, experimental: bool) -> Result<(), Box<dyn s
|
|||
String::from_utf8_lossy(&cargo_about_output.stderr)
|
||||
);
|
||||
|
||||
println!("Running pipenv install");
|
||||
|
||||
super::run_command("pipenv", &["install"], pip_env.clone())
|
||||
.context("Error running pipenv install")?;
|
||||
|
||||
println!("Running sphinx-build");
|
||||
|
||||
let output = super::run_command(
|
||||
"pipenv",
|
||||
"uv",
|
||||
&[
|
||||
"run",
|
||||
"sphinx-build",
|
||||
docs_build_dir.to_str().unwrap(),
|
||||
docs_build_dir.join("html").to_str().unwrap(),
|
||||
],
|
||||
pip_env,
|
||||
uv_project,
|
||||
)
|
||||
.context("Error running pipenv install")?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue