Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,25 @@ jobs:
if: ${{ startsWith(matrix.platform.runner, 'windows') }}
shell: cmd # Use `cmd` to run test for Windows, as PowerShell doesn't detect exit code by `os._exit(0)` correctly.
run: |
${{ matrix.platform.python_exec }} -m pytest --capture=no python/cocoindex/tests
${{ matrix.platform.python_exec }} -m pytest --capture=no python/cocoindex/tests

validate-3p-notices:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-about
run: cargo install --locked cargo-about
- name: Validate third-party notices (dry-run)
shell: bash
run: |
set +e
cargo about generate about.hbs > /dev/null
status=$?
if [ $status -ne 0 ]; then
echo "::error::Third-party notices validation failed. Please update /about.toml and rerun."
exit $status
fi
27 changes: 26 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,32 @@ jobs:
name: wheels-sdist
path: dist

generate-3p-notices:
runs-on: ubuntu-latest
needs: [create-versioned-toml]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: Cargo.toml
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-about
run: cargo install --locked cargo-about
- name: Generate THIRD_PARTY_NOTICES.html
run: cargo about generate -o THIRD_PARTY_NOTICES.html about.hbs
- name: Upload THIRD_PARTY_NOTICES.html artifact
uses: actions/upload-artifact@v4
with:
name: THIRD_PARTY_NOTICES.html
path: THIRD_PARTY_NOTICES.html

release:
name: Release
runs-on: ubuntu-latest
needs: [create-versioned-toml, build, test-abi3, sdist]
needs: [create-versioned-toml, build, test-abi3, sdist, generate-3p-notices]
permissions:
# Use to sign the release artifacts
id-token: write
Expand All @@ -111,6 +133,9 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: Cargo.toml
- uses: actions/download-artifact@v4
with:
name: THIRD_PARTY_NOTICES.html
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name = "cocoindex"
version = "999.0.0"
edition = "2024"
rust-version = "1.88"
license = "Apache-2.0"

[profile.release]
codegen-units = 1
Expand Down
70 changes: 70 additions & 0 deletions about.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<html>

<head>
<style>
@media (prefers-color-scheme: dark) {
body {
background: #333;
color: white;
}
a {
color: skyblue;
}
}
.container {
font-family: sans-serif;
max-width: 800px;
margin: 0 auto;
}
.intro {
text-align: center;
}
.licenses-list {
list-style-type: none;
margin: 0;
padding: 0;
}
.license-used-by {
margin-top: -10px;
}
.license-text {
max-height: 200px;
overflow-y: scroll;
white-space: pre-wrap;
}
</style>
</head>

<body>
<main class="container">
<div class="intro">
<h1>Third Party Licenses</h1>
<p>This page lists the licenses of the projects used in cargo-about.</p>
</div>

<h2>Overview of licenses:</h2>
<ul class="licenses-overview">
{{#each overview}}
<li><a href="#{{id}}">{{name}}</a> ({{count}})</li>
{{/each}}
</ul>

<h2>All license text:</h2>
<ul class="licenses-list">
{{#each licenses}}
<li class="license">
<h3 id="{{id}}">{{name}}</h3>
<h4>Used by:</h4>
<ul class="license-used-by">
{{#each used_by}}
<li><a href="{{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}}">{{crate.name}} {{crate.version}}</a></li>
{{/each}}
</ul>
<pre class="license-text">{{text}}</pre>
</li>
{{/each}}
</ul>
</main>
</body>

</html>
12 changes: 12 additions & 0 deletions about.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
accepted = [
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"BSD-2-Clause",
"BSD-3-Clause",
"CDLA-Permissive-2.0",
"ISC",
"MIT",
"OpenSSL",
"Unicode-3.0",
"Zlib",
]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies = [
"numpy>=1.23.2",
]
license = "Apache-2.0"
license-files = ["THIRD_PARTY_NOTICES.html"]
urls = { Homepage = "https://cocoindex.io/" }
classifiers = [
"Development Status :: 3 - Alpha",
Expand Down
Loading