diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1e6a20d64..4e94b4ea6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,9 +23,8 @@ env: CARGO_ARGS_NO_SSL: --no-default-features --features stdlib,importlib,stdio,encodings,sqlite,host_env # Crates excluded from workspace builds: # - rustpython_wasm: requires wasm target - # - rustpython-compiler-source: deprecated # - rustpython-venvlauncher: Windows-only - WORKSPACE_EXCLUDES: --exclude rustpython_wasm --exclude rustpython-compiler-source --exclude rustpython-venvlauncher + WORKSPACE_EXCLUDES: --exclude rustpython_wasm --exclude rustpython-venvlauncher 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 CARGO_INCREMENTAL: 0 diff --git a/.github/workflows/cron-ci.yaml b/.github/workflows/cron-ci.yaml index cadfb65a6..2cf63a50a 100644 --- a/.github/workflows/cron-ci.yaml +++ b/.github/workflows/cron-ci.yaml @@ -42,7 +42,7 @@ jobs: - run: sudo apt-get update && sudo apt-get -y install lcov - name: Run cargo-llvm-cov with Rust tests. - run: cargo llvm-cov --no-report --workspace --exclude rustpython_wasm --exclude rustpython-compiler-source --exclude rustpython-venvlauncher --exclude rustpython-capi --verbose --no-default-features --features stdlib,importlib,stdio,encodings,ssl-rustls-aws-lc,jit,host_env + run: cargo llvm-cov --no-report --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi --verbose --no-default-features --features stdlib,importlib,stdio,encodings,ssl-rustls-aws-lc,jit,host_env - name: Run cargo-llvm-cov with Python snippets. run: python scripts/cargo-llvm-cov.py diff --git a/.github/workflows/update-caches.yml b/.github/workflows/update-caches.yml index d3f5da9c1..59ff6006f 100644 --- a/.github/workflows/update-caches.yml +++ b/.github/workflows/update-caches.yml @@ -20,7 +20,7 @@ env: CARGO_PROFILE_DEV_DEBUG: 0 CARGO_PROFILE_RELEASE_DEBUG: 0 # Keep feature list in sync with CI's release build in .github/workflows/ci.yaml. - CARGO_ARGS: --workspace --no-default-features --features stdlib,importlib,stdio,encodings,sqlite,ssl-rustls-aws-lc,host_env,threading,jit --exclude rustpython_wasm --exclude rustpython-compiler-source --exclude rustpython-venvlauncher + CARGO_ARGS: --workspace --no-default-features --features stdlib,importlib,stdio,encodings,sqlite,ssl-rustls-aws-lc,host_env,threading,jit --exclude rustpython_wasm --exclude rustpython-venvlauncher jobs: build-caches: diff --git a/Cargo.lock b/Cargo.lock index a1d63a0fb..0cbc19fbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3296,14 +3296,6 @@ dependencies = [ "rustpython-wtf8", ] -[[package]] -name = "rustpython-compiler-source" -version = "0.4.1+deprecated" -dependencies = [ - "rustpython-ruff_source_file", - "rustpython-ruff_text_size", -] - [[package]] name = "rustpython-derive" version = "0.5.0" diff --git a/crates/compiler-source/Cargo.toml b/crates/compiler-source/Cargo.toml deleted file mode 100644 index cb94c1747..000000000 --- a/crates/compiler-source/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "rustpython-compiler-source" -description = "(DEPRECATED) RustPython Source and Index" -version = "0.4.1+deprecated" -authors.workspace = true -edition.workspace = true -rust-version.workspace = true -repository.workspace = true -license.workspace = true - -[dependencies] -ruff_source_file = { workspace = true } -ruff_text_size = { workspace = true } - -[lints] -workspace = true diff --git a/crates/compiler-source/src/lib.rs b/crates/compiler-source/src/lib.rs deleted file mode 100644 index e3fb55ef6..000000000 --- a/crates/compiler-source/src/lib.rs +++ /dev/null @@ -1,43 +0,0 @@ -pub use ruff_source_file::{LineIndex, OneIndexed as LineNumber, PositionEncoding, SourceLocation}; -use ruff_text_size::TextRange; -pub use ruff_text_size::TextSize; - -#[derive(Clone)] -pub struct SourceCode<'src> { - pub path: &'src str, - pub text: &'src str, - pub index: LineIndex, -} - -impl<'src> SourceCode<'src> { - pub fn new(path: &'src str, text: &'src str) -> Self { - let index = LineIndex::from_source_text(text); - Self { path, text, index } - } - - pub fn line_index(&self, offset: TextSize) -> LineNumber { - self.index.line_index(offset) - } - - pub fn source_location(&self, offset: TextSize) -> SourceLocation { - self.index - .source_location(offset, self.text, PositionEncoding::Utf8) - } - - pub fn get_range(&'src self, range: TextRange) -> &'src str { - &self.text[range.start().to_usize()..range.end().to_usize()] - } -} - -pub struct SourceCodeOwned { - pub path: String, - pub text: String, - pub index: LineIndex, -} - -impl SourceCodeOwned { - pub fn new(path: String, text: String) -> Self { - let index = LineIndex::from_source_text(&text); - Self { path, text, index } - } -} diff --git a/crates/venvlauncher/Cargo.toml b/crates/venvlauncher/Cargo.toml index c88dc5d35..2d5d3fb70 100644 --- a/crates/venvlauncher/Cargo.toml +++ b/crates/venvlauncher/Cargo.toml @@ -7,6 +7,7 @@ edition.workspace = true rust-version.workspace = true repository.workspace = true license.workspace = true +publish = false # Free-threaded variants (RustPython uses Py_GIL_DISABLED=true) [[bin]] diff --git a/host_env_proposal.md b/host_env_proposal.md index fd32df1ab..fdff49938 100644 --- a/host_env_proposal.md +++ b/host_env_proposal.md @@ -347,7 +347,7 @@ The strongest guarantee. If a crate doesn't list `rustpython-host_env` in its `[ **Pure crates (no host_env dependency allowed):** - `rustpython-common` -- `rustpython-compiler`, `rustpython-compiler-core`, `rustpython-compiler-source` +- `rustpython-compiler`, `rustpython-compiler-core` - `rustpython-codegen` - `rustpython-literal` - `rustpython-sre_engine` @@ -357,7 +357,7 @@ The strongest guarantee. If a crate doesn't list `rustpython-host_env` in its `[ CI check: ```bash # Verify pure crates don't depend on host_env -for crate in common compiler compiler-core compiler-source codegen literal sre_engine wtf8 derive derive-impl; do +for crate in common compiler compiler-core codegen literal sre_engine wtf8 derive derive-impl; do if rg 'rustpython-host_env' "crates/$crate/Cargo.toml"; then echo "ERROR: $crate should not depend on host_env" exit 1 @@ -471,7 +471,6 @@ After removing host modules from `common`, it could potentially become `#![no_st Candidate crates for unconditional `#![no_std]`: - `rustpython-literal` - `rustpython-wtf8` -- `rustpython-compiler-source` ### Summary of enforcement layers