repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_debug.rs
crates/uv/tests/it/pip_debug.rs
use crate::common::{TestContext, uv_snapshot}; #[test] fn debug_warn() { let context = TestContext::new("3.12"); uv_snapshot!(context.pip_debug(), @r" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- error: pip's `debug` is unsupported (consider using `uvx pip debug` inst...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/workspace.rs
crates/uv/tests/it/workspace.rs
use std::collections::BTreeMap; use std::env; use std::path::PathBuf; use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::{FileWriteStr, PathChild}; use assert_fs::prelude::FileTouch; use indoc::indoc; use insta::{assert_json_snapshot, assert_snapshot}; use serde::{Deserialize, Seriali...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/workspace_dir.rs
crates/uv/tests/it/workspace_dir.rs
use std::env; use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::PathChild; use crate::common::{TestContext, copy_dir_ignore, uv_snapshot}; /// Test basic output for a simple workspace with one member. #[test] fn workspace_dir_simple() { let context = TestContext::new("3.12"); ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/publish.rs
crates/uv/tests/it/publish.rs
use crate::common::{TestContext, uv_snapshot, venv_bin_path}; use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::{FileTouch, FileWriteStr, PathChild}; use fs_err::OpenOptions; use indoc::{formatdoc, indoc}; use serde_json::json; use sha2::{Digest, Sha256}; use std::env; use std::env::current_dir; use std:...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/cache_prune.rs
crates/uv/tests/it/cache_prune.rs
use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::prelude::*; use indoc::indoc; use uv_static::EnvVars; use crate::common::TestContext; use crate::common::uv_snapshot; /// `cache prune` should be a no-op if there's nothing out-of-date in the cache. #[test] fn prune_no_op() -> Result<()> { let contex...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/python_upgrade.rs
crates/uv/tests/it/python_upgrade.rs
use crate::common::{TestContext, uv_snapshot}; use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::FileTouch; use assert_fs::prelude::PathChild; use uv_static::EnvVars; #[test] fn python_upgrade() { let context: TestContext = TestContext::new_with_versions(&[]) .with_pytho...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_list.rs
crates/uv/tests/it/pip_list.rs
use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::fixture::ChildPath; use assert_fs::fixture::FileWriteStr; use assert_fs::fixture::PathChild; use assert_fs::prelude::*; use crate::common::{TestContext, uv_snapshot}; #[test] fn list_empty_columns() { let context = TestContext::new("3.12"); uv_sn...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_install.rs
crates/uv/tests/it/pip_install.rs
use std::io::Cursor; use std::process::Command; use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::prelude::*; use flate2::write::GzEncoder; use fs_err as fs; use fs_err::File; use indoc::{formatdoc, indoc}; use predicates::prelude::predicate; use url::Url; use wiremock::{ Mock, MockServer, ResponseTem...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/build_backend.rs
crates/uv/tests/it/build_backend.rs
use crate::common::{TestContext, uv_snapshot, venv_bin_path}; use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::{FileTouch, FileWriteBin, FileWriteStr, PathChild, PathCreateDir}; use flate2::bufread::GzDecoder; use fs_err::File; use indoc::{formatdoc, indoc}; use std::env; use std::io...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/show_settings.rs
crates/uv/tests/it/show_settings.rs
use std::path::Path; use std::process::Command; use assert_fs::prelude::*; use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot}; /// Add shared arguments to a command. /// /// In particular, remove any user-defined environment variables and set any machine-specific /// environment variables to stati...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/version.rs
crates/uv/tests/it/version.rs
use anyhow::{Ok, Result}; use assert_cmd::assert::OutputAssertExt; use assert_fs::prelude::*; use indoc::indoc; use insta::assert_snapshot; use crate::common::TestContext; use crate::common::uv_snapshot; // Print the version #[test] fn version_get() -> Result<()> { let context = TestContext::new("3.12"); let...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/cache_clean.rs
crates/uv/tests/it/cache_clean.rs
use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::prelude::*; use uv_cache::Cache; use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot}; /// `cache clean` should remove all packages. #[test] fn clean_all() -> Result<()> { let context = TestContext::new("3.12"); let requirements...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/sync.rs
crates/uv/tests/it/sync.rs
use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::{fixture::ChildPath, prelude::*}; use indoc::{formatdoc, indoc}; use insta::assert_snapshot; use predicates::prelude::predicate; use tempfile::tempdir_in; use uv_fs::Simplified; use uv_static::EnvVars; use crate::common::{TestContext, download_to_disk, pa...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/network.rs
crates/uv/tests/it/network.rs
use std::{env, io}; use assert_fs::fixture::{ChildPath, FileWriteStr, PathChild}; use http::StatusCode; use serde_json::json; use uv_static::EnvVars; use wiremock::matchers::method; use wiremock::{Mock, MockServer, ResponseTemplate}; use crate::common::{TestContext, uv_snapshot}; fn connection_reset(_request: &wirem...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/tool_dir.rs
crates/uv/tests/it/tool_dir.rs
use assert_fs::fixture::PathChild; use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot}; #[test] fn tool_dir() { let context = TestContext::new("3.12"); let tool_dir = context.temp_dir.child("tools"); let bin_dir = context.temp_dir.child("bin"); uv_snapshot!(context.filters(), conte...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/cache_size.rs
crates/uv/tests/it/cache_size.rs
use assert_cmd::assert::OutputAssertExt; use crate::common::{TestContext, uv_snapshot}; /// Test that `cache size` returns 0 for an empty cache directory (raw output). #[test] fn cache_size_empty_raw() { let context = TestContext::new("3.12"); // Clean cache first to ensure truly empty state context.clea...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/python_find.rs
crates/uv/tests/it/python_find.rs
use assert_cmd::assert::OutputAssertExt; use assert_fs::prelude::{FileTouch, PathChild}; use assert_fs::{fixture::FileWriteStr, prelude::PathCreateDir}; use indoc::indoc; use uv_platform::{Arch, Os}; use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot, venv_bin_path}; #[test] fn python_find() { ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/tool_list.rs
crates/uv/tests/it/tool_list.rs
use crate::common::{self, TestContext, uv_snapshot}; use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::PathChild; use fs_err as fs; use insta::assert_snapshot; use uv_static::EnvVars; #[test] fn tool_list() { let context = TestContext::new("3.12").with_filtered_exe_suffix(); ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/help.rs
crates/uv/tests/it/help.rs
use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot}; #[test] fn help() { let context = TestContext::new_with_versions(&[]); // The `uv help` command should show the long help message uv_snapshot!(context.filters(), context.help(), @r#" success: true exit_code: 0 ----- stdout...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/lock.rs
crates/uv/tests/it/lock.rs
use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::prelude::*; use indoc::{formatdoc, indoc}; use insta::assert_snapshot; use std::io::BufReader; use url::Url; #[cfg(feature = "git")] use crate::common::{READ_ONLY_GITHUB_TOKEN, decode_token}; use crate::common::{ TestContext, build_vendor_...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/workflow.rs
crates/uv/tests/it/workflow.rs
use crate::common::{TestContext, diff_snapshot, uv_snapshot}; use anyhow::Result; use assert_fs::fixture::{FileWriteStr, PathChild}; use insta::assert_snapshot; #[test] fn packse_add_remove_one_package() { let context = TestContext::new("3.12"); context.copy_ecosystem_project("packse"); uv_snapshot!(conte...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/lock_conflict.rs
crates/uv/tests/it/lock_conflict.rs
use anyhow::Result; use assert_fs::prelude::*; use insta::assert_snapshot; use crate::common::{TestContext, uv_snapshot}; // All of the tests in this file should use `tool.uv.conflicts` in some way. // // They are split from `lock.rs` somewhat arbitrarily. Mostly because there are // a lot of them, and `lock.rs` was ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/tree.rs
crates/uv/tests/it/tree.rs
use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::prelude::*; use indoc::{formatdoc, indoc}; use insta::assert_snapshot; use url::Url; use crate::common::{TestContext, uv_snapshot}; #[test] fn nested_dependencies() -> Result<()> { let context = TestContext::new("3.12"); let pyprojec...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/self_update.rs
crates/uv/tests/it/self_update.rs
use std::process::Command; use axoupdater::{ ReleaseSourceType, test::helpers::{RuntestArgs, perform_runtest}, }; use uv_static::EnvVars; use crate::common::{TestContext, get_bin, uv_snapshot}; #[test] fn check_self_update() { // To maximally emulate behaviour in practice, this test actually modifies CA...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/build.rs
crates/uv/tests/it/build.rs
use crate::common::{DEFAULT_PYTHON_VERSION, TestContext, uv_snapshot}; use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::prelude::*; use fs_err::File; use indoc::indoc; use insta::assert_snapshot; use predicates::prelude::predicate; use std::env::current_dir; use uv_static::EnvVars; use zip::Z...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/python_module.rs
crates/uv/tests/it/python_module.rs
use assert_cmd::assert::OutputAssertExt; use assert_fs::prelude::{FileTouch, FileWriteStr, PathChild, PathCreateDir}; use indoc::{formatdoc, indoc}; use uv_fs::Simplified; use uv_static::EnvVars; use crate::common::{TestContext, site_packages_path, uv_snapshot}; /// Filter the user scheme, which differs between Wind...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_freeze.rs
crates/uv/tests/it/pip_freeze.rs
use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::fixture::ChildPath; use assert_fs::prelude::*; use crate::common::{TestContext, uv_snapshot}; #[test] fn freeze_many() -> Result<()> { let context = TestContext::new("3.12"); let requirements_txt = context.temp_dir.child("requirements.txt"); ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_check.rs
crates/uv/tests/it/pip_check.rs
use anyhow::Result; use assert_fs::fixture::FileWriteStr; use assert_fs::fixture::PathChild; use crate::common::TestContext; use crate::common::uv_snapshot; #[test] fn check_compatible_packages() -> Result<()> { let context = TestContext::new("3.12"); let requirements_txt = context.temp_dir.child("requiremen...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_compile.rs
crates/uv/tests/it/pip_compile.rs
#![allow(clippy::disallowed_types)] use std::env::current_dir; use std::fs; use std::io::Cursor; use anyhow::Result; use assert_fs::prelude::*; use flate2::write::GzEncoder; use fs_err::File; use indoc::indoc; use url::Url; use wiremock::matchers::{method, path}; use wiremock::{Mock, MockServer, ResponseTemplate}; u...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/python_dir.rs
crates/uv/tests/it/python_dir.rs
use assert_fs::fixture::PathChild; use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot}; #[test] fn python_dir() { let context = TestContext::new("3.12"); let python_dir = context.temp_dir.child("python"); uv_snapshot!(context.filters(), context.python_dir() .env(EnvVars::UV_PYTHON_...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/auth.rs
crates/uv/tests/it/auth.rs
use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::{fixture::PathChild, prelude::FileWriteStr}; #[cfg(feature = "native-auth")] use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot}; #[test] #[cfg(feature = "native-auth")] fn add_package_native_auth_realm() -> Result<()> { ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/tool_run.rs
crates/uv/tests/it/tool_run.rs
use crate::common::{TestContext, uv_snapshot}; use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::prelude::*; use indoc::indoc; use uv_fs::copy_dir_all; use uv_static::EnvVars; #[test] fn tool_run_args() { let context = TestContext::new("3.12").with_filtered_counts(); let mut filters = context.filt...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/tool_install.rs
crates/uv/tests/it/tool_install.rs
#[cfg(any(feature = "git", feature = "git-lfs"))] use std::collections::BTreeSet; use std::process::Command; use anyhow::Result; use assert_fs::{ assert::PathAssert, fixture::{FileTouch, FileWriteStr, PathChild}, }; use indoc::indoc; use insta::assert_snapshot; use predicates::prelude::predicate; use uv_fs::co...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/format.rs
crates/uv/tests/it/format.rs
use anyhow::Result; use assert_fs::prelude::*; use indoc::indoc; use insta::assert_snapshot; use crate::common::{TestContext, uv_snapshot}; #[test] fn format_project() -> Result<()> { let context = TestContext::new_with_versions(&[]); let pyproject_toml = context.temp_dir.child("pyproject.toml"); pyproje...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/run.rs
crates/uv/tests/it/run.rs
#![allow(clippy::disallowed_types)] use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::{fixture::ChildPath, prelude::*}; use indoc::indoc; use insta::assert_snapshot; use predicates::{prelude::predicate, str::contains}; use std::path::Path; use uv_fs::copy_dir_all; use uv_python::PYTHON_VERSIO...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/python_pin.rs
crates/uv/tests/it/python_pin.rs
use std::path::PathBuf; use crate::common::{TestContext, uv_snapshot}; use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::{FileWriteStr, PathChild, PathCreateDir}; use insta::assert_snapshot; use uv_platform::{Arch, Os}; use uv_python::{PYTHON_VERSION_FILENAME, PYTHON_VERSIONS_FILENAM...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/init.rs
crates/uv/tests/it/init.rs
use std::process::Command; use anyhow::Result; use assert_cmd::prelude::OutputAssertExt; use assert_fs::prelude::*; use indoc::indoc; use insta::assert_snapshot; use predicates::prelude::predicate; use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot}; #[test] fn init() { let context = TestConte...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_install_scenarios.rs
crates/uv/tests/it/pip_install_scenarios.rs
//! DO NOT EDIT //! //! Generated with `./scripts/sync_scenarios.sh` //! Scenarios from <https://github.com/astral-sh/packse/tree/0.3.53/scenarios> //! #![cfg(all(feature = "python", feature = "pypi", unix))] use std::process::Command; use uv_static::EnvVars; use crate::common::{TestContext, build_vendor_links_url, ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/tool_upgrade.rs
crates/uv/tests/it/tool_upgrade.rs
use assert_fs::prelude::*; use insta::assert_snapshot; use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot}; #[test] fn tool_upgrade_empty() { let context = TestContext::new("3.12") .with_filtered_counts() .with_filtered_exe_suffix(); let tool_dir = context.temp_dir.child("to...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/lock_scenarios.rs
crates/uv/tests/it/lock_scenarios.rs
//! DO NOT EDIT //! //! Generated with `./scripts/sync_scenarios.sh` //! Scenarios from <https://github.com/astral-sh/packse/tree/0.3.53/scenarios> //! #![cfg(all(feature = "python", feature = "pypi"))] #![allow(clippy::needless_raw_string_hashes)] #![allow(clippy::doc_markdown)] #![allow(clippy::doc_lazy_continuation)...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_compile_scenarios.rs
crates/uv/tests/it/pip_compile_scenarios.rs
//! DO NOT EDIT //! //! Generated with `./scripts/sync_scenarios.sh` //! Scenarios from <https://github.com/astral-sh/packse/tree/0.3.53/scenarios> //! #![cfg(all(feature = "python", feature = "pypi", unix))] use std::env; use std::process::Command; use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use ass...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_show.rs
crates/uv/tests/it/pip_show.rs
use std::env::current_dir; use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::fixture::FileWriteStr; use assert_fs::fixture::PathChild; use indoc::indoc; use uv_static::EnvVars; use crate::common::{TestContext, uv_snapshot}; #[test] fn show_empty() { let context = TestContext::new("3.12"); uv_s...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/edit.rs
crates/uv/tests/it/edit.rs
#![allow(clippy::disallowed_types)] #[cfg(feature = "git")] mod conditional_imports { pub(crate) use crate::common::{READ_ONLY_GITHUB_TOKEN, decode_token}; } #[cfg(feature = "git")] use conditional_imports::*; use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::prelude::*; use indoc::{for...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/extract.rs
crates/uv/tests/it/extract.rs
#![cfg(feature = "r2")] use backon::{BackoffBuilder, Retryable}; use futures::TryStreamExt; use tokio_util::compat::FuturesAsyncReadCompatExt; async fn unzip(url: &str) -> anyhow::Result<(), uv_extract::Error> { let backoff = backon::ExponentialBuilder::default() .with_min_delay(std::time::Duration::from_...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/main.rs
crates/uv/tests/it/main.rs
//! this is the single integration test, as documented by matklad //! in <https://matklad.github.io/2021/02/27/delete-cargo-integration-tests.html> pub(crate) mod common; mod auth; mod branching_urls; #[cfg(all(feature = "python", feature = "pypi"))] mod build; #[cfg(feature = "python")] mod build_backend; #[cfg(...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_tree.rs
crates/uv/tests/it/pip_tree.rs
#![cfg(not(windows))] use assert_cmd::assert::OutputAssertExt; use std::process::Command; use assert_fs::fixture::FileTouch; use assert_fs::fixture::FileWriteStr; use assert_fs::fixture::PathChild; use assert_fs::fixture::PathCreateDir; use indoc::indoc; use uv_static::EnvVars; use crate::common::get_bin; use crate...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/export.rs
crates/uv/tests/it/export.rs
#![allow(clippy::disallowed_types)] #[cfg(feature = "git")] use crate::common::{READ_ONLY_GITHUB_SSH_DEPLOY_KEY, READ_ONLY_GITHUB_TOKEN, decode_token}; use crate::common::{TestContext, apply_filters, uv_snapshot}; use anyhow::{Ok, Result}; use assert_cmd::assert::OutputAssertExt; use assert_fs::prelude::*; use indoc::...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/workspace_list.rs
crates/uv/tests/it/workspace_list.rs
use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::PathChild; use crate::common::{TestContext, copy_dir_ignore, uv_snapshot}; /// Test basic list output for a simple workspace with one member. #[test] fn workspace_list_simple() { let context = TestContext::new("3.12"); // In...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/workspace_metadata.rs
crates/uv/tests/it/workspace_metadata.rs
use anyhow::Result; use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::PathChild; use crate::common::{TestContext, copy_dir_ignore, uv_snapshot}; /// Test basic metadata output for a simple workspace with one member. #[test] fn workspace_metadata_simple() { let context = TestContext::new("3.12"); ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/pip_uninstall.rs
crates/uv/tests/it/pip_uninstall.rs
use std::process::Command; use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::fixture::ChildPath; use assert_fs::prelude::*; use crate::common::{TestContext, get_bin, uv_snapshot}; #[test] fn no_arguments() { uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") ....
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/branching_urls.rs
crates/uv/tests/it/branching_urls.rs
use std::env; use anyhow::Result; use indoc::indoc; use insta::assert_snapshot; use crate::common::{TestContext, make_project, uv_snapshot}; /// The root package has diverging URLs for disjoint markers: /// ```toml /// dependencies = [ /// "iniconfig @ https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/python_install.rs
crates/uv/tests/it/python_install.rs
#[cfg(windows)] use std::path::PathBuf; use std::{env, path::Path, process::Command}; use crate::common::{TestContext, uv_snapshot}; use assert_cmd::assert::OutputAssertExt; use assert_fs::{ assert::PathAssert, prelude::{FileTouch, FileWriteStr, PathChild, PathCreateDir}, }; use indoc::indoc; use predicates::...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv/tests/it/common/mod.rs
crates/uv/tests/it/common/mod.rs
// The `unreachable_pub` is to silence false positives in RustRover. #![allow(dead_code, unreachable_pub)] use std::borrow::BorrowMut; use std::ffi::OsString; use std::io::Write as _; use std::iter::Iterator; use std::path::{Path, PathBuf}; use std::process::{Command, ExitStatus, Output, Stdio}; use std::str::FromStr;...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-filename/src/lib.rs
crates/uv-distribution-filename/src/lib.rs
use std::fmt::{Display, Formatter}; use std::str::FromStr; use uv_normalize::PackageName; use uv_pep440::Version; pub use build_tag::{BuildTag, BuildTagError}; pub use egg::{EggInfoFilename, EggInfoFilenameError}; pub use expanded_tags::{ExpandedTagError, ExpandedTags}; pub use extension::{DistExtension, ExtensionErr...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-filename/src/build_tag.rs
crates/uv-distribution-filename/src/build_tag.rs
use std::num::ParseIntError; use std::str::FromStr; use uv_small_str::SmallString; #[derive(thiserror::Error, Debug)] pub enum BuildTagError { #[error("must not be empty")] Empty, #[error("must start with a digit")] NoLeadingDigit, #[error(transparent)] ParseInt(#[from] ParseIntError), } /// ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-filename/src/expanded_tags.rs
crates/uv-distribution-filename/src/expanded_tags.rs
use std::str::FromStr; use memchr::memchr; use thiserror::Error; use uv_platform_tags::{ AbiTag, LanguageTag, ParseAbiTagError, ParseLanguageTagError, ParsePlatformTagError, PlatformTag, TagCompatibility, Tags, }; use crate::splitter::MemchrSplitter; use crate::wheel_tag::{WheelTag, WheelTagLarge, WheelTagSm...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-filename/src/source_dist.rs
crates/uv-distribution-filename/src/source_dist.rs
use std::fmt::{Display, Formatter}; use std::str::FromStr; use crate::SourceDistExtension; use serde::{Deserialize, Serialize}; use thiserror::Error; use uv_normalize::{InvalidNameError, PackageName}; use uv_pep440::{Version, VersionParseError}; /// Note that this is a normalized and not an exact representation, keep...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-filename/src/extension.rs
crates/uv-distribution-filename/src/extension.rs
use std::fmt::{Display, Formatter}; use std::path::Path; use serde::{Deserialize, Serialize}; use thiserror::Error; #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DistExtension { Wheel, Source(SourceDistExtension), } #[derive( Clone, Copy, Debug, PartialEq, E...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-filename/src/wheel.rs
crates/uv-distribution-filename/src/wheel.rs
use std::fmt::{Display, Formatter}; use std::hash::Hash; use std::str::FromStr; use memchr::memchr; use serde::{Deserialize, Deserializer, Serialize, Serializer, de}; use thiserror::Error; use uv_cache_key::cache_digest; use uv_normalize::{InvalidNameError, PackageName}; use uv_pep440::{Version, VersionParseError}; u...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-filename/src/egg.rs
crates/uv-distribution-filename/src/egg.rs
use std::str::FromStr; use thiserror::Error; use uv_normalize::{InvalidNameError, PackageName}; use uv_pep440::{Version, VersionParseError}; #[derive(Error, Debug)] pub enum EggInfoFilenameError { #[error("The filename \"{0}\" does not end in `.egg-info`")] InvalidExtension(String), #[error("The `.egg-in...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-filename/src/wheel_tag.rs
crates/uv-distribution-filename/src/wheel_tag.rs
use std::fmt::{Display, Formatter}; use crate::BuildTag; use uv_platform_tags::{AbiTag, LanguageTag, PlatformTag}; use uv_small_str::SmallString; /// A [`SmallVec`] type for storing tags. /// /// Wheels tend to include a single language, ABI, and platform tag, so we use a [`SmallVec`] with a /// capacity of 1 to opti...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-filename/src/splitter.rs
crates/uv-distribution-filename/src/splitter.rs
/// A simple splitter that uses `memchr` to find the next delimiter. pub(crate) struct MemchrSplitter<'a> { memchr: memchr::Memchr<'a>, haystack: &'a str, offset: usize, } impl<'a> MemchrSplitter<'a> { #[inline] pub(crate) fn split(haystack: &'a str, delimiter: u8) -> Self { Self { ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/parse_grammar.rs
crates/generate/src/parse_grammar.rs
use std::collections::HashSet; use log::warn; use regex::Regex; use serde::{Deserialize, Serialize}; use serde_json::{Map, Value}; use thiserror::Error; use crate::{ grammars::{InputGrammar, PrecedenceEntry, ReservedWordContext, Variable, VariableType}, rules::{Precedence, Rule}, }; #[derive(Deserialize)] #[...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/build_tables.rs
crates/generate/src/build_tables.rs
mod build_lex_table; mod build_parse_table; mod coincident_tokens; mod item; mod item_set_builder; mod minimize_parse_table; mod token_conflicts; use std::collections::{BTreeSet, HashMap}; pub use build_lex_table::LARGE_CHARACTER_RANGE_COUNT; use build_parse_table::BuildTableResult; pub use build_parse_table::ParseTa...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/dedup.rs
crates/generate/src/dedup.rs
pub fn split_state_id_groups<S>( states: &[S], state_ids_by_group_id: &mut Vec<Vec<usize>>, group_ids_by_state_id: &mut [usize], start_group_id: usize, mut should_split: impl FnMut(&S, &S, &[usize]) -> bool, ) -> bool { let mut result = false; let mut group_id = start_group_id; while gr...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/node_types.rs
crates/generate/src/node_types.rs
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use serde::Serialize; use thiserror::Error; use super::{ grammars::{LexicalGrammar, SyntaxGrammar, VariableType}, rules::{Alias, AliasMap, Symbol, SymbolType}, }; #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum ChildType { ...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
true
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/render.rs
crates/generate/src/render.rs
use std::{ cmp, collections::{BTreeMap, BTreeSet, HashMap, HashSet}, fmt::Write, mem::swap, }; use crate::LANGUAGE_VERSION; use indoc::indoc; use super::{ build_tables::Tables, grammars::{ExternalToken, LexicalGrammar, SyntaxGrammar, VariableType}, nfa::CharacterSet, node_types::ChildT...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
true
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/grammars.rs
crates/generate/src/grammars.rs
use std::{collections::HashMap, fmt}; use super::{ nfa::Nfa, rules::{Alias, Associativity, Precedence, Rule, Symbol, TokenSet}, }; #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] pub enum VariableType { Hidden, Auxiliary, Anonymous, Named, } // Input grammar #[derive(Clone, Deb...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/nfa.rs
crates/generate/src/nfa.rs
use std::{ char, cmp::{max, Ordering}, fmt, iter::ExactSizeIterator, mem::{self, swap}, ops::{Range, RangeInclusive}, }; /// A set of characters represented as a vector of ranges. #[derive(Clone, Default, PartialEq, Eq, Hash)] pub struct CharacterSet { ranges: Vec<Range<u32>>, } /// A stat...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
true
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/prepare_grammar.rs
crates/generate/src/prepare_grammar.rs
mod expand_repeats; mod expand_tokens; mod extract_default_aliases; mod extract_tokens; mod flatten_grammar; mod intern_symbols; mod process_inlines; use std::{ cmp::Ordering, collections::{hash_map, BTreeSet, HashMap, HashSet}, mem, }; pub use expand_tokens::ExpandTokensError; pub use extract_tokens::Ext...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/rules.rs
crates/generate/src/rules.rs
use std::{collections::BTreeMap, fmt}; use serde::Serialize; use smallbitvec::SmallBitVec; use super::grammars::VariableType; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize)] pub enum SymbolType { External, End, EndOfNonTerminalExtra, Terminal, NonTerminal, } #[deri...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/tables.rs
crates/generate/src/tables.rs
use std::collections::BTreeMap; use super::{ nfa::CharacterSet, rules::{Alias, Symbol, TokenSet}, }; pub type ProductionInfoId = usize; pub type ParseStateId = usize; pub type LexStateId = usize; use std::hash::BuildHasherDefault; use indexmap::IndexMap; use rustc_hash::FxHasher; #[derive(Clone, Copy, Debug...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/generate.rs
crates/generate/src/generate.rs
use std::{collections::BTreeMap, sync::LazyLock}; #[cfg(feature = "load")] use std::{ env, fs, io::Write, path::{Path, PathBuf}, process::{Command, Stdio}, }; use bitflags::bitflags; use log::warn; use node_types::VariableInfo; use regex::{Regex, RegexBuilder}; use rules::{Alias, Symbol}; #[cfg(feature...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/quickjs.rs
crates/generate/src/quickjs.rs
use std::{ collections::HashMap, path::{Path, PathBuf}, sync::{LazyLock, Mutex}, }; use log::{error, info, warn}; use rquickjs::{ loader::{FileResolver, ScriptLoader}, Context, Ctx, Function, Module, Object, Runtime, Type, Value, }; use super::{IoError, JSError, JSResult}; const DSL: &[u8] = incl...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/prepare_grammar/intern_symbols.rs
crates/generate/src/prepare_grammar/intern_symbols.rs
use log::warn; use serde::Serialize; use thiserror::Error; use super::InternedGrammar; use crate::{ grammars::{InputGrammar, ReservedWordContext, Variable, VariableType}, rules::{Rule, Symbol}, }; pub type InternSymbolsResult<T> = Result<T, InternSymbolsError>; #[derive(Debug, Error, Serialize)] pub enum Int...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/prepare_grammar/extract_default_aliases.rs
crates/generate/src/prepare_grammar/extract_default_aliases.rs
use crate::{ grammars::{LexicalGrammar, SyntaxGrammar}, rules::{Alias, AliasMap, Symbol, SymbolType}, }; #[derive(Clone, Default)] struct SymbolStatus { aliases: Vec<(Alias, usize)>, appears_unaliased: bool, } // Update the grammar by finding symbols that always are aliased, and for each such symbol, ...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/prepare_grammar/expand_repeats.rs
crates/generate/src/prepare_grammar/expand_repeats.rs
use std::{collections::HashMap, mem}; use super::ExtractedSyntaxGrammar; use crate::{ grammars::{Variable, VariableType}, rules::{Rule, Symbol}, }; struct Expander { variable_name: String, repeat_count_in_variable: usize, preceding_symbol_count: usize, auxiliary_variables: Vec<Variable>, e...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/prepare_grammar/flatten_grammar.rs
crates/generate/src/prepare_grammar/flatten_grammar.rs
use std::collections::HashMap; use serde::Serialize; use thiserror::Error; use super::ExtractedSyntaxGrammar; use crate::{ grammars::{ Production, ProductionStep, ReservedWordSetId, SyntaxGrammar, SyntaxVariable, Variable, }, rules::{Alias, Associativity, Precedence, Rule, Symbol, TokenSet}, }; p...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/prepare_grammar/process_inlines.rs
crates/generate/src/prepare_grammar/process_inlines.rs
use std::collections::HashMap; use serde::Serialize; use thiserror::Error; use crate::{ grammars::{InlinedProductionMap, LexicalGrammar, Production, ProductionStep, SyntaxGrammar}, rules::SymbolType, }; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] struct ProductionStepId { // A `None` value here me...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/prepare_grammar/expand_tokens.rs
crates/generate/src/prepare_grammar/expand_tokens.rs
use regex_syntax::{ hir::{Class, Hir, HirKind}, ParserBuilder, }; use serde::Serialize; use thiserror::Error; use super::ExtractedLexicalGrammar; use crate::{ grammars::{LexicalGrammar, LexicalVariable}, nfa::{CharacterSet, Nfa, NfaState}, rules::{Precedence, Rule}, }; struct NfaBuilder { nfa:...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/prepare_grammar/extract_tokens.rs
crates/generate/src/prepare_grammar/extract_tokens.rs
use std::collections::HashMap; use serde::Serialize; use thiserror::Error; use super::{ExtractedLexicalGrammar, ExtractedSyntaxGrammar, InternedGrammar}; use crate::{ grammars::{ExternalToken, ReservedWordContext, Variable, VariableType}, rules::{MetadataParams, Rule, Symbol, SymbolType}, }; pub type Extract...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/build_tables/token_conflicts.rs
crates/generate/src/build_tables/token_conflicts.rs
use std::{cmp::Ordering, collections::HashSet, fmt}; use crate::{ build_tables::item::TokenSetDisplay, grammars::{LexicalGrammar, SyntaxGrammar}, nfa::{CharacterSet, NfaCursor, NfaTransition}, rules::TokenSet, }; #[derive(Clone, Debug, Default, PartialEq, Eq)] struct TokenConflictStatus { matches_...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/build_tables/coincident_tokens.rs
crates/generate/src/build_tables/coincident_tokens.rs
use std::fmt; use crate::{ grammars::LexicalGrammar, rules::Symbol, tables::{ParseStateId, ParseTable}, }; pub struct CoincidentTokenIndex<'a> { entries: Vec<Vec<ParseStateId>>, grammar: &'a LexicalGrammar, n: usize, } impl<'a> CoincidentTokenIndex<'a> { pub fn new(table: &ParseTable, lex...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/build_tables/build_lex_table.rs
crates/generate/src/build_tables/build_lex_table.rs
use std::{ collections::{hash_map::Entry, HashMap, VecDeque}, mem, }; use log::debug; use super::{coincident_tokens::CoincidentTokenIndex, token_conflicts::TokenConflictMap}; use crate::{ dedup::split_state_id_groups, grammars::{LexicalGrammar, SyntaxGrammar}, nfa::{CharacterSet, NfaCursor}, r...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/build_tables/build_parse_table.rs
crates/generate/src/build_tables/build_parse_table.rs
use std::{ cmp::Ordering, collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque}, hash::BuildHasherDefault, }; use indexmap::{map::Entry, IndexMap}; use log::warn; use rustc_hash::FxHasher; use serde::Serialize; use thiserror::Error; use super::{ item::{ParseItem, ParseItemSet, ParseItemSetCore...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
true
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/build_tables/minimize_parse_table.rs
crates/generate/src/build_tables/minimize_parse_table.rs
use std::{ collections::{HashMap, HashSet}, mem, }; use log::debug; use super::token_conflicts::TokenConflictMap; use crate::{ dedup::split_state_id_groups, grammars::{LexicalGrammar, SyntaxGrammar, VariableType}, rules::{AliasMap, Symbol, TokenSet}, tables::{GotoAction, ParseAction, ParseStat...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/build_tables/item_set_builder.rs
crates/generate/src/build_tables/item_set_builder.rs
use std::{ collections::{HashMap, HashSet}, fmt, }; use super::item::{ParseItem, ParseItemDisplay, ParseItemSet, ParseItemSetEntry, TokenSetDisplay}; use crate::{ grammars::{InlinedProductionMap, LexicalGrammar, ReservedWordSetId, SyntaxGrammar}, rules::{Symbol, SymbolType, TokenSet}, }; #[derive(Clon...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/generate/src/build_tables/item.rs
crates/generate/src/build_tables/item.rs
use std::{ cmp::Ordering, fmt, hash::{Hash, Hasher}, sync::LazyLock, }; use crate::{ grammars::{ LexicalGrammar, Production, ProductionStep, ReservedWordSetId, SyntaxGrammar, NO_RESERVED_WORDS, }, rules::{Associativity, Precedence, Symbol, SymbolType, TokenSet}, }; static S...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/loader/build.rs
crates/loader/build.rs
fn main() { println!( "cargo:rustc-env=BUILD_TARGET={}", std::env::var("TARGET").unwrap() ); println!( "cargo:rustc-env=BUILD_HOST={}", std::env::var("HOST").unwrap() ); }
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/loader/src/loader.rs
crates/loader/src/loader.rs
#![cfg_attr(not(any(test, doctest)), doc = include_str!("../README.md"))] #![cfg_attr(docsrs, feature(doc_cfg))] #[cfg(any(feature = "tree-sitter-highlight", feature = "tree-sitter-tags"))] use std::ops::Range; #[cfg(feature = "tree-sitter-highlight")] use std::sync::Mutex; use std::{ collections::HashMap, env...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
true
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/tags/src/tags.rs
crates/tags/src/tags.rs
#![cfg_attr(not(any(test, doctest)), doc = include_str!("../README.md"))] pub mod c_lib; use std::{ char, collections::HashMap, ffi::{CStr, CString}, mem, ops::{ControlFlow, Range}, os::raw::c_char, str, sync::atomic::{AtomicUsize, Ordering}, }; use memchr::memchr; use regex::Regex; u...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/tags/src/c_lib.rs
crates/tags/src/c_lib.rs
use std::{ collections::HashMap, ffi::CStr, fmt, os::raw::c_char, process::abort, slice, str, sync::atomic::AtomicUsize, }; use tree_sitter::Language; use super::{Error, TagsConfiguration, TagsContext}; const BUFFER_TAGS_RESERVE_CAPACITY: usize = 100; const BUFFER_DOCS_RESERVE_CAPACITY: usize = 1024; #[repr...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/xtask/src/test.rs
crates/xtask/src/test.rs
use std::{ env, path::Path, process::{Command, Stdio}, }; use anyhow::{anyhow, Result}; use regex::Regex; use crate::{bail_on_err, Test}; pub fn run(args: &Test) -> Result<()> { let test_flags = if args.address_sanitizer { env::set_var("CFLAGS", "-fsanitize=undefined,address"); // Wh...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/xtask/src/benchmark.rs
crates/xtask/src/benchmark.rs
use anyhow::Result; use crate::{bail_on_err, Benchmark}; pub fn run(args: &Benchmark) -> Result<()> { if let Some(ref example) = args.example_file_name { std::env::set_var("TREE_SITTER_BENCHMARK_EXAMPLE_FILTER", example); } if let Some(ref language) = args.language { std::env::set_var("TR...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/xtask/src/build_wasm.rs
crates/xtask/src/build_wasm.rs
use std::{ collections::HashSet, ffi::{OsStr, OsString}, fmt::Write, fs, path::{Path, PathBuf}, process::Command, time::Duration, }; use anyhow::{anyhow, Result}; use etcetera::BaseStrategy as _; use indoc::indoc; use notify::{ event::{AccessKind, AccessMode}, EventKind, RecursiveMo...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/xtask/src/embed_sources.rs
crates/xtask/src/embed_sources.rs
use anyhow::Result; use std::fs; use std::path::Path; /// Restores sourcesContent if it was stripped by Binaryen. /// /// This is a workaround for Binaryen where `wasm-opt -O2` and higher /// optimization levels strip the `sourcesContent` field from source maps, /// even when the source map was generated with `--sourc...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/xtask/src/check_wasm_exports.rs
crates/xtask/src/check_wasm_exports.rs
use std::{ collections::HashSet, env, io::BufRead, path::PathBuf, process::{Command, Stdio}, time::Duration, }; use anyhow::{anyhow, Result}; use notify::{ event::{AccessKind, AccessMode}, EventKind, RecursiveMode, }; use notify_debouncer_full::new_debouncer; use crate::{bail_on_err, w...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/xtask/src/fetch.rs
crates/xtask/src/fetch.rs
use crate::{bail_on_err, root_dir, FetchFixtures, EMSCRIPTEN_VERSION}; use anyhow::Result; use std::{fs, process::Command}; pub fn run_fixtures(args: &FetchFixtures) -> Result<()> { let fixtures_dir = root_dir().join("test").join("fixtures"); let grammars_dir = fixtures_dir.join("grammars"); let fixtures_p...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/xtask/src/main.rs
crates/xtask/src/main.rs
mod benchmark; mod build_wasm; mod bump; mod check_wasm_exports; mod clippy; mod embed_sources; mod fetch; mod generate; mod test; mod test_schema; mod upgrade_wasmtime; use std::{path::Path, process::Command}; use anstyle::{AnsiColor, Color, Style}; use anyhow::Result; use clap::{crate_authors, Args, FromArgMatches ...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false
tree-sitter/tree-sitter
https://github.com/tree-sitter/tree-sitter/blob/dd60d5cff079dbae8db798ce7272879dbd2ac9e8/crates/xtask/src/test_schema.rs
crates/xtask/src/test_schema.rs
use std::path::PathBuf; use anyhow::Result; use serde_json::to_writer_pretty; use tree_sitter_cli::test::TestSummary; pub fn run_test_schema() -> Result<()> { let schema = schemars::schema_for!(TestSummary); let xtask_path: PathBuf = env!("CARGO_MANIFEST_DIR").into(); let schema_path = xtask_path ...
rust
MIT
dd60d5cff079dbae8db798ce7272879dbd2ac9e8
2026-01-04T15:38:34.599794Z
false