mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
* Skip Python-defined classes when collecting builtin type docs generate.py recorded every object.__subclasses__() entry as builtins.<name> after importing the whole stdlib, so classes written in Python (tkinter, unittest, tarfile, ...) ended up in the doc database. Classes that are mutable heap types without C method descriptors and whose module is not a C extension are now skipped, and their entries are removed from data.inc.rs. Assisted-by: Claude:claude-opus-5-5 Assisted-by: Grok:grok-4.7 * Store database docstrings xz-compressed behind an optional doc feature - rustpython-doc's build script compresses all database docstrings into one xz blob with an offset index; identical texts share one offset. - Macros emit blob references for database docs; vm decompresses the blob on first access. - New `doc` cargo feature (default on) in rustpython, rustpython-vm and rustpython-stdlib. Without it the blob and xz are not linked and database-backed __doc__ is None; __text_signature__ is unaffected. - Native types without a docstring get __doc__ = None in their dict. - Workflows that build with --no-default-features enable `doc` where tests or releases need docstrings. Assisted-by: Claude:claude-opus-5-5 Assisted-by: Grok:grok-4.7
209 lines
7.2 KiB
YAML
209 lines
7.2 KiB
YAML
name: Release
|
|
|
|
on:
|
|
schedule:
|
|
# 9 AM UTC on every Monday
|
|
- cron: "0 9 * * Mon"
|
|
workflow_dispatch:
|
|
inputs:
|
|
pre-release:
|
|
type: boolean
|
|
description: Mark "Pre-Release"
|
|
required: false
|
|
default: true
|
|
|
|
env:
|
|
X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR: C:\Program Files\OpenSSL\lib\VC\x64\MD
|
|
X86_64_PC_WINDOWS_MSVC_OPENSSL_INCLUDE_DIR: C:\Program Files\OpenSSL\include
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
# Disable this scheduled job when running on a fork.
|
|
if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
- os: macos-latest
|
|
target: aarch64-apple-darwin
|
|
- os: windows-2025
|
|
target: x86_64-pc-windows-msvc
|
|
# - os: ubuntu-latest
|
|
# target: i686-unknown-linux-gnu
|
|
# - os: ubuntu-latest
|
|
# target: aarch64-unknown-linux-gnu
|
|
# - os: ubuntu-latest
|
|
# target: armv7-unknown-linux-gnueabi
|
|
# - os: ubuntu-latest
|
|
# target: s390x-unknown-linux-gnu
|
|
# - os: ubuntu-latest
|
|
# target: powerpc64le-unknown-linux-gnu
|
|
# - os: macos-latest
|
|
# target: x86_64-apple-darwin
|
|
# - os: windows-2025
|
|
# target: i686-pc-windows-msvc
|
|
# - os: windows-2025
|
|
# target: aarch64-pc-windows-msvc
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Use a short Cargo home on Windows
|
|
if: runner.os == 'Windows'
|
|
shell: pwsh
|
|
run: |
|
|
"CARGO_HOME=$env:RUNNER_TEMP\c" >> $env:GITHUB_ENV
|
|
git config --global core.longpaths true
|
|
|
|
- name: Install macOS dependencies
|
|
uses: ./.github/actions/install-macos-deps
|
|
with:
|
|
autoconf: true
|
|
automake: true
|
|
libtool: true
|
|
|
|
- name: Build RustPython
|
|
run: cargo build --release --target=${{ matrix.target }} --verbose --no-default-features --features stdlib,stdio,importlib,encodings,sqlite,host_env,ssl-rustls-aws-lc,threading,jit,doc
|
|
|
|
- name: Rename Binary
|
|
run: cp target/${{ matrix.target }}/release/rustpython target/rustpython-release-${{ runner.os }}-${{ matrix.target }}
|
|
if: runner.os != 'Windows'
|
|
|
|
- name: Rename Binary
|
|
run: cp target/${{ matrix.target }}/release/rustpython.exe target/rustpython-release-${{ runner.os }}-${{ matrix.target }}.exe
|
|
if: runner.os == 'Windows'
|
|
|
|
- name: Upload Binary Artifacts
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: rustpython-release-${{ runner.os }}-${{ matrix.target }}
|
|
path: target/rustpython-release-${{ runner.os }}-${{ matrix.target }}*
|
|
|
|
build-wasm:
|
|
runs-on: ubuntu-latest
|
|
# Disable this scheduled job when running on a fork.
|
|
if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: wasm32-wasip1
|
|
|
|
- name: Build RustPython
|
|
run: cargo build --target wasm32-wasip1 --no-default-features --features freeze-stdlib,stdlib,doc --release
|
|
|
|
- name: Rename Binary
|
|
run: cp target/wasm32-wasip1/release/rustpython.wasm target/rustpython-release-wasm32-wasip1.wasm
|
|
|
|
- name: Upload Binary Artifacts
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: rustpython-release-wasm32-wasip1
|
|
path: target/rustpython-release-wasm32-wasip1.wasm
|
|
|
|
- name: install wasm-pack
|
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
|
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
package-manager-cache: false
|
|
|
|
- uses: mwilliamson/setup-wabt-action@427f2fdd70bc4dbc2e53c2eb4f19f66162d71bd2 # v4.0.0
|
|
with:
|
|
wabt-version: "1.0.30"
|
|
|
|
- name: build demo
|
|
run: |
|
|
npm install
|
|
npm run dist
|
|
env:
|
|
NODE_OPTIONS: "--openssl-legacy-provider"
|
|
working-directory: ./wasm/demo
|
|
|
|
- name: build notebook demo
|
|
run: |
|
|
npm install
|
|
npm run dist
|
|
mv dist ../demo/dist/notebook
|
|
env:
|
|
NODE_OPTIONS: "--openssl-legacy-provider"
|
|
working-directory: ./wasm/notebook
|
|
|
|
- name: Deploy demo to Github Pages
|
|
if: ${{ github.repository == 'RustPython/RustPython' }}
|
|
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
|
|
with:
|
|
deploy_key: ${{ secrets.ACTIONS_DEMO_DEPLOY_KEY }}
|
|
publish_dir: ./wasm/demo/dist
|
|
external_repository: RustPython/demo
|
|
publish_branch: master
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
# Disable this scheduled job when running on a fork.
|
|
if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}
|
|
needs: [build, build-wasm]
|
|
permissions:
|
|
contents: write # for creating a release
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Download Binary Artifacts
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
path: bin
|
|
pattern: rustpython-*
|
|
merge-multiple: true
|
|
|
|
- name: Create Lib Archive
|
|
run: zip -r bin/rustpython-lib.zip Lib/
|
|
|
|
- name: List Binaries
|
|
run: |
|
|
ls -lah bin/
|
|
file bin/*
|
|
|
|
- name: Create Release
|
|
run: |
|
|
if [[ "${PRE_RELEASE_INPUT}" == "false" ]]; then
|
|
RELEASE_TYPE_NAME=Release
|
|
PRERELEASE_ARG=
|
|
else
|
|
RELEASE_TYPE_NAME=Pre-Release
|
|
PRERELEASE_ARG=--prerelease
|
|
fi
|
|
|
|
today=$(date '+%Y-%m-%d')
|
|
gh release create "$today-$tag-$run" \
|
|
--repo="$GITHUB_REPOSITORY" \
|
|
--title="RustPython $RELEASE_TYPE_NAME $today-$tag #$run" \
|
|
--target="$tag" \
|
|
--notes "⚠️ **Important**: To run RustPython, you must download both the binary for your platform AND the \`rustpython-lib.zip\` archive. Extract the Lib directory from the archive to the same location as the binary, or set the \`RUSTPYTHONPATH\` environment variable to point to the Lib directory." \
|
|
--generate-notes \
|
|
$PRERELEASE_ARG \
|
|
bin/rustpython-release-*
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
tag: ${{ github.ref_name }}
|
|
run: ${{ github.run_number }}
|
|
PRE_RELEASE_INPUT: ${{ github.event.inputs.pre-release }}
|