Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
abd0fa1
add experimental pypi support
e8035669 Mar 12, 2025
ba65eba
Merge branch 'main' into pypi_support
e8035669 Mar 12, 2025
4ff8d8e
[fix] downgrade indexmap from 2.8.0 to 2.7.1, priority-queue from 2.2…
e8035669 Mar 12, 2025
ef692fa
update to rust 1.83.0
e8035669 Mar 13, 2025
f2b8c83
output message minor fix
e8035669 Mar 13, 2025
9446bf7
apply suggestions from cargo-fmt and cargo-clippy
e8035669 Mar 13, 2025
01fd1e0
make `--experimental-pypi-support` conflict with `--ignore-pypi-errors`
e8035669 Mar 13, 2025
a31df5c
[WIP] add test to check pypi-support is work, add sdists test
e8035669 Mar 15, 2025
cc98d5a
[WIP] fix tests in windows
e8035669 Mar 15, 2025
d073dbd
[feat] add reproducible test
e8035669 Mar 15, 2025
545e1ea
try reduce test parallel
e8035669 Mar 15, 2025
fcadc4c
Merge branch 'main' into pypi_support
e8035669 Mar 18, 2025
c18f239
[feat] use flat index instead of simple index, replace dependency to…
e8035669 Mar 18, 2025
b755a51
[feat] revert to use tokio-tar
e8035669 Mar 18, 2025
29120e4
[fix] improve error message when project contains a package without w…
e8035669 Mar 18, 2025
7974bc2
Merge branch 'main' into pypi_support
e8035669 Mar 22, 2025
c868e2e
[fix] disable test parallel when ci testing
e8035669 Mar 27, 2025
b3897b6
Merge branch 'main' into pypi_support
e8035669 Apr 2, 2025
2d27fe8
[WIP] apply some minor suggestions
e8035669 Apr 2, 2025
4733c20
feat: remove experimental flag, merge pypi tests with exist tests, ad…
e8035669 Apr 4, 2025
005fa99
review
pavelzw Apr 4, 2025
903f33b
bump package version, add to readme
pavelzw Apr 4, 2025
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
2,237 changes: 2,142 additions & 95 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ fxhash = "0.2.1"
tempfile = "3.17.1"
walkdir = "2.5.0"
base64 = "0.22.1"
uv-installer = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-python = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-install-wheel = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-cache = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-distribution-filename = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-distribution-types = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-distribution = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-pep508 = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-cache-info = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-pypi-types = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-configuration = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-client = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-build-frontend = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-git = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
uv-dispatch = { git = "https://github.com/astral-sh/uv", tag = "0.5.29" }
Comment thread
pavelzw marked this conversation as resolved.
Outdated

[dev-dependencies]
async-std = "1.13.0"
Expand Down
107 changes: 107 additions & 0 deletions src/build_context.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
use uv_cache;
use uv_dispatch::BuildDispatchError;
use uv_git::GitResolver;
use uv_pypi_types::Requirement;
use uv_types::BuildContext;

/// Create a dummy build context, because we don't need to build any package.
pub struct DummyBuildContext {
pub cache: uv_cache::Cache,
}

impl DummyBuildContext {
pub fn new(cache: uv_cache::Cache) -> Self {
Self { cache }
}
}

#[allow(refining_impl_trait, unused_variables)]
impl BuildContext for DummyBuildContext {
type SourceDistBuilder = uv_build_frontend::SourceBuild;

fn interpreter(&self) -> &uv_python::Interpreter {
unimplemented!()
}

fn cache(&self) -> &uv_cache::Cache {
&self.cache
}

fn git(&self) -> &GitResolver {
unimplemented!()
}

fn capabilities(&self) -> &uv_distribution_types::IndexCapabilities {
unimplemented!()
}

fn dependency_metadata(&self) -> &uv_distribution_types::DependencyMetadata {
unimplemented!()
}

fn build_options(&self) -> &uv_configuration::BuildOptions {
unimplemented!()
}

fn config_settings(&self) -> &uv_configuration::ConfigSettings {
unimplemented!()
}

fn sources(&self) -> uv_configuration::SourceStrategy {
unimplemented!()
}

fn locations(&self) -> &uv_distribution_types::IndexLocations {
unimplemented!()
}

fn resolve<'a>(
&'a self,
requirements: &'a [Requirement],
build_stack: &'a uv_types::BuildStack,
) -> impl std::future::Future<
Output = anyhow::Result<uv_distribution_types::Resolution, BuildDispatchError>,
> + 'a {
async { unimplemented!() }
}

fn install<'a>(
&'a self,
resolution: &'a uv_distribution_types::Resolution,
venv: &'a uv_python::PythonEnvironment,
build_stack: &'a uv_types::BuildStack,
) -> impl std::future::Future<
Output = anyhow::Result<Vec<uv_distribution_types::CachedDist>, BuildDispatchError>,
> + 'a {
async { unimplemented!() }
}

fn setup_build<'a>(
&'a self,
source: &'a std::path::Path,
subdirectory: Option<&'a std::path::Path>,
install_path: &'a std::path::Path,
version_id: Option<&'a str>,
dist: Option<&'a uv_distribution_types::SourceDist>,
sources: uv_configuration::SourceStrategy,
build_kind: uv_configuration::BuildKind,
build_output: uv_configuration::BuildOutput,
build_stack: uv_types::BuildStack,
) -> impl std::future::Future<Output = anyhow::Result<Self::SourceDistBuilder, BuildDispatchError>>
+ 'a {
async { unimplemented!() }
}

fn direct_build<'a>(
&'a self,
source: &'a std::path::Path,
subdirectory: Option<&'a std::path::Path>,
output_dir: &'a std::path::Path,
build_kind: uv_configuration::BuildKind,
version_id: Option<&'a str>,
) -> impl std::future::Future<
Output = anyhow::Result<Option<uv_distribution_filename::DistFilename>, BuildDispatchError>,
> + 'a {
async { unimplemented!() }
}
}
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod pack;
mod unpack;
mod util;
mod build_context;

pub use pack::{pack, PackOptions};
use rattler_conda_types::Platform;
Expand All @@ -9,6 +10,7 @@ pub use unpack::{unarchive, unpack, UnpackOptions};
pub use util::{get_size, ProgressReporter};

pub const CHANNEL_DIRECTORY_NAME: &str = "channel";
pub const PYPI_DIRECTORY_NAME: &str = "simple";
pub const PIXI_PACK_METADATA_PATH: &str = "pixi-pack.json";
pub const DEFAULT_PIXI_PACK_VERSION: &str = "1";
pub const PIXI_PACK_VERSION: &str = env!("CARGO_PKG_VERSION");
Expand Down
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ enum Commands {
/// Create self-extracting executable
#[arg(long, default_value = "false")]
create_executable: bool,

/// Experimental support for binary PyPI dependencies.
#[arg(long, default_value = "false")]
experimental_pypi_support: bool,
Comment thread
pavelzw marked this conversation as resolved.
Outdated
},
/// Unpack a pixi environment
Unpack {
Expand Down Expand Up @@ -129,6 +133,7 @@ async fn main() -> Result<()> {
ignore_pypi_errors,
create_executable,
use_cache,
experimental_pypi_support,
} => {
let output_file =
output_file.unwrap_or_else(|| default_output_file(platform, create_executable));
Expand All @@ -148,6 +153,7 @@ async fn main() -> Result<()> {
ignore_pypi_errors,
create_executable,
cache_dir: use_cache,
experimental_pypi_support,
};
tracing::debug!("Running pack command with options: {:?}", options);
pack(options).await?
Expand Down
Loading