Skip to content

Commit

Permalink
Merge branch 'main' into feature/pixi-global
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Sep 5, 2024
2 parents a31b9b6 + a3e1b3f commit 9f1a027
Show file tree
Hide file tree
Showing 31 changed files with 1,785 additions and 231 deletions.
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@ repos:
- id: fmt
name: fmt
language: system
stages: [push, manual]
types: [file, rust]
entry: cargo fmt
pass_filenames: false
- id: clippy
name: clippy
language: system
stages: [push, manual]
types: [file, rust]
entry: cargo clippy --all-targets --workspace -- -D warnings -Dclippy::dbg_macro # Use -D warnings option to ensure the job fails when encountering warnings
pass_filenames: false
- id: test
name: test
language: system
stages: [push]
stages: [push, manual]
types: [file, rust]
entry: cargo test
pass_filenames: false
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,77 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [0.29.0] - 2024-09-04
#### ✨ Highlights

- Add build-isolation options, for more details check out our [docs](https://pixi.sh/v0.29.0/reference/project_configuration/#no-build-isolation)
- Allow to use virtual package overrides from environment variables ([PR](https://github.com/conda/rattler/pull/818))
- Many bug fixes


#### Added

- Add build-isolation options by @tdejager in [#1909](https://github.com/prefix-dev/pixi/pull/1909)


- Add release script by @Hofer-Julian in [#1971](https://github.com/prefix-dev/pixi/pull/1971)


#### Changed

- Use rustls-tls instead of native-tls per default by @Hofer-Julian in [#1929](https://github.com/prefix-dev/pixi/pull/1929)


- Upgrade to uv 0.3.4 by @tdejager in [#1936](https://github.com/prefix-dev/pixi/pull/1936)


- Upgrade to uv 0.4.0 by @tdejager in [#1944](https://github.com/prefix-dev/pixi/pull/1944)


- Better error for when the target or platform are missing by @tdejager in [#1959](https://github.com/prefix-dev/pixi/pull/1959)


- Improve integration tests by @Hofer-Julian in [#1958](https://github.com/prefix-dev/pixi/pull/1958)


- Improve release script by @Hofer-Julian in [#1974](https://github.com/prefix-dev/pixi/pull/1974)


#### Fixed

- Update env variables in installation docs by @lev112 in [#1937](https://github.com/prefix-dev/pixi/pull/1937)


- Always overwrite when pixi adding the dependency by @ruben-arts in [#1935](https://github.com/prefix-dev/pixi/pull/1935)


- Typo in schema.json by @SobhanMP in [#1948](https://github.com/prefix-dev/pixi/pull/1948)


- Using file url as mapping by @nichmor in [#1930](https://github.com/prefix-dev/pixi/pull/1930)


- Offline mapping should not request by @nichmor in [#1968](https://github.com/prefix-dev/pixi/pull/1968)


- `pixi init` for `pyproject.toml` by @Hofer-Julian in [#1947](https://github.com/prefix-dev/pixi/pull/1947)


- Use two in memory indexes, for resolve and builds by @tdejager in [#1969](https://github.com/prefix-dev/pixi/pull/1969)


- Minor issues and todos by @KGrewal1 in [#1963](https://github.com/prefix-dev/pixi/pull/1963)


#### Refactor

- Improve integration tests by @Hofer-Julian in [#1942](https://github.com/prefix-dev/pixi/pull/1942)


#### New Contributors
* @SobhanMP made their first contribution in [#1948](https://github.com/prefix-dev/pixi/pull/1948)
* @lev112 made their first contribution in [#1937](https://github.com/prefix-dev/pixi/pull/1937)

### [0.28.2] - 2024-08-28
#### Changed

Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ authors:
name-particle: de
family-names: Jager
email: [email protected]
repository-code: 'https://github.com/prefix-dev/pixi/releases/tag/v0.28.2'
url: 'https://pixi.sh/v0.28.2'
repository-code: 'https://github.com/prefix-dev/pixi/releases/tag/v0.29.0'
url: 'https://pixi.sh/v0.29.0'
abstract: >-
A cross-platform, language agnostic, package/project
management tool for development in virtual environments.
Expand Down
24 changes: 11 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ typed-path = "0.9.1"

# Rattler crates
file_url = "0.1.4"
rattler = { version = "0.27.8", default-features = false }
rattler_cache = { version = "0.2.0", default-features = false }
rattler = { version = "0.27.9", default-features = false }
rattler_cache = { version = "0.2.1", default-features = false }
rattler_conda_types = { version = "0.27.4", default-features = false }
rattler_digest = { version = "1.0.1", default-features = false }
rattler_lock = { version = "0.22.22", default-features = false }
rattler_networking = { version = "0.21.3", default-features = false }
rattler_repodata_gateway = { version = "0.21.10", default-features = false }
rattler_repodata_gateway = { version = "0.21.11", default-features = false }
rattler_shell = { version = "0.21.8", default-features = false }
rattler_solve = { version = "1.0.5", default-features = false }
rattler_virtual_packages = { version = "1.1.1", default-features = false }
Expand All @@ -117,7 +117,7 @@ uv-resolver = { git = "https://github.com/astral-sh/uv", tag = "0.4.0" }
uv-types = { git = "https://github.com/astral-sh/uv", tag = "0.4.0" }
winapi = { version = "0.3.9", default-features = false }
xxhash-rust = "0.8.10"
zip = { version = "0.6.6", default-features = false }
zip = { version = "2.2.0", default-features = false }

fancy_display = { path = "crates/fancy_display" }
pixi_config = { path = "crates/pixi_config" }
Expand All @@ -141,7 +141,7 @@ license.workspace = true
name = "pixi"
readme.workspace = true
repository.workspace = true
version = "0.28.2"
version = "0.29.0"

[features]
default = ["rustls-tls"]
Expand Down
1 change: 0 additions & 1 deletion crates/pixi_config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use reqwest_middleware::ClientWithMiddleware;
use serde::{de::IntoDeserializer, Deserialize, Serialize};
use url::Url;

/// TODO: maybe remove this duplicate from `src/util.rs` at some point
pub fn default_channel_config() -> ChannelConfig {
ChannelConfig::default_with_root_dir(
std::env::current_dir().expect("Could not retrieve the current directory"),
Expand Down
2 changes: 1 addition & 1 deletion crates/pixi_consts/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub const PYPROJECT_MANIFEST: &str = "pyproject.toml";
pub const PROJECT_LOCK_FILE: &str = "pixi.lock";
pub const CONFIG_FILE: &str = "config.toml";
pub const PIXI_DIR: &str = ".pixi";
pub const PIXI_VERSION: &str = "0.28.2";
pub const PIXI_VERSION: &str = "0.29.0";
pub const PREFIX_FILE_NAME: &str = "pixi_env_prefix";
pub const ENVIRONMENTS_DIR: &str = "envs";
pub const SOLVE_GROUP_ENVIRONMENTS_DIR: &str = "solve-group-envs";
Expand Down
3 changes: 1 addition & 2 deletions crates/pixi_manifest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ rattler_virtual_packages = { workspace = true }

# TODO: Remove these dependencies
console = { workspace = true }
glob = "0.3.1"
miette = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }
fancy_display = { workspace = true }
glob = "0.3.1"
insta = { workspace = true, features = ["yaml"] }
pixi_consts = { workspace = true }
rstest = { workspace = true }
serde_json = { workspace = true }
tempfile = { workspace = true }
1 change: 0 additions & 1 deletion crates/pixi_progress/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ version = "0.1.0"
[dependencies]
console = { workspace = true }
indicatif = { workspace = true }
once_cell = { workspace = true }
tokio = { workspace = true, features = ["sync", "rt"] }
4 changes: 2 additions & 2 deletions crates/pixi_progress/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use indicatif::{HumanBytes, MultiProgress, ProgressBar, ProgressDrawTarget, ProgressState};
use once_cell::sync::Lazy;
use std::borrow::Cow;
use std::collections::VecDeque;
use std::fmt::Write;
use std::future::Future;
use std::sync::LazyLock;
use std::time::Duration;
use tokio::sync::mpsc::{channel, Sender};

Expand All @@ -13,7 +13,7 @@ use tokio::sync::mpsc::{channel, Sender};
/// progressbars. To fix this issue, logging has been configured in such a way to it will not
/// interfere if you use the [`indicatif::MultiProgress`] returning by this function.
pub fn global_multi_progress() -> MultiProgress {
static GLOBAL_MP: Lazy<MultiProgress> = Lazy::new(|| {
static GLOBAL_MP: LazyLock<MultiProgress> = LazyLock::new(|| {
let mp = MultiProgress::new();
mp.set_draw_target(ProgressDrawTarget::stderr_with_hz(20));
mp
Expand Down
2 changes: 1 addition & 1 deletion crates/pixi_utils/src/conda_environment_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn parse_dependencies(deps: Vec<CondaEnvDep>) -> miette::Result<ParsedDependenci
let match_spec = MatchSpec::from_str(&d, Lenient)
.into_diagnostic()
.wrap_err(format!("Can't parse '{}' as conda dependency", d))?;
if let Some(channel) = match_spec.clone().channel {
if let Some(channel) = &match_spec.channel {
// TODO: This is a bit hacky, we should probably have a better way to handle this.
picked_up_channels.push(
NamedChannelOrUrl::from_str(channel.name())
Expand Down
7 changes: 0 additions & 7 deletions crates/pixi_utils/src/defaults.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/pixi_utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
pub mod conda_environment_file;
mod defaults;
pub mod indicatif;
mod prefix_guard;
pub mod reqwest;

pub use defaults::default_channel_config;
pub use prefix_guard::{PrefixGuard, WriteGuard};
2 changes: 1 addition & 1 deletion docs/advanced/github_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ We created [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi) to
```yaml
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.28.2
pixi-version: v0.29.0
cache: true
auth-host: prefix.dev
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
Expand Down
6 changes: 5 additions & 1 deletion examples/docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.pixi/
.pixi

__pycache__/
dist/
*.pyc
1 change: 1 addition & 0 deletions examples/docker/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.pixi

__pycache__/
dist/
*.pyc
31 changes: 24 additions & 7 deletions examples/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
FROM ghcr.io/prefix-dev/pixi:0.18.0 AS build
FROM ghcr.io/prefix-dev/pixi:0.28.2 AS install

COPY . /app
# Create a dummy blank project
WORKDIR /app/docker_project
RUN touch __init__.py

# Install dependencies
WORKDIR /app
COPY pyproject.toml .
COPY pixi.lock .
RUN --mount=type=cache,target=/root/.cache/rattler/cache,sharing=private pixi install

# Build for production
FROM install AS build

# Create an "entrypoint.sh" script which activates the pixi environment
RUN printf '#!/bin/sh\n%s\nexec "$@"' "$(pixi shell-hook -e prod)" > /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Build then install the Python wheel
COPY . .
RUN pixi run build-wheel
RUN pixi run postinstall-production
RUN pixi shell-hook -e prod > /shell-hook
RUN echo "gunicorn -w 4 docker_project:app --bind :8000" >> /shell-hook
RUN pixi run install-wheel

# Final minimal production image
FROM ubuntu:22.04 AS production

# only copy the production environment into prod container
COPY --from=build /app/.pixi/envs/prod /app/.pixi/envs/prod
COPY --from=build /shell-hook /shell-hook
COPY --from=build /entrypoint.sh /entrypoint.sh
WORKDIR /app
EXPOSE 8000
CMD ["/bin/bash", "/shell-hook"]
ENTRYPOINT ["/entrypoint.sh"] # uses the pixi environment
CMD ["gunicorn", "docker_project:app", "-b", "0.0.0.0:8000"]
Loading

0 comments on commit 9f1a027

Please sign in to comment.