Skip to content

Commit

Permalink
Merge branch 'feat/global-trampoline' into trampoline
Browse files Browse the repository at this point in the history
  • Loading branch information
nichmor authored Oct 23, 2024
2 parents b81bd2b + 393b0d9 commit c9a8376
Show file tree
Hide file tree
Showing 196 changed files with 83,168 additions and 31,361 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
cargo-test:
name: Cargo Test | ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -263,6 +263,7 @@ jobs:
cargo build
--locked
--profile $CARGO_PROFILE
--features self_update
${{ steps.build-options.outputs.CARGO_BUILD_OPTIONS}}
- name: Build on Windows
Expand All @@ -271,6 +272,7 @@ jobs:
cargo build
--locked
--profile $env:CARGO_PROFILE
--features self_update
${{ steps.build-options.outputs.CARGO_BUILD_OPTIONS}}
- name: Set binary name & path
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ jobs:
# pixi interface
test-integration:
name: ${{ matrix.arch.name }} - Integration Tests
timeout-minutes: 30
runs-on: ${{ matrix.arch.os }}
env:
TARGET_RELEASE: "${{ github.workspace }}/.pixi/target/release"
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/trampoline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Update Trampoline Binary

on:
push:
paths:
- 'crates/pixi_trampoline/**'
workflow_dispatch:
pull_request:
paths:
- 'crates/pixi_trampoline/**'

permissions:
contents: write # Allow write permissions for contents (like pushing to the repo)
pull-requests: write

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- { name: "Linux-x86_64", target: x86_64-unknown-linux-musl, os: ubuntu-latest }
- { name: "Linux-aarch64", target: aarch64-unknown-linux-musl, os: ubuntu-latest }
- { name: "macOS-x86", target: x86_64-apple-darwin, os: macos-13 }
- { name: "macOS-arm", target: aarch64-apple-darwin, os: macos-14 }
- { name: "Windows", target: x86_64-pc-windows-msvc, os: windows-latest }
- { name: "Windows-arm", target: aarch64-pc-windows-msvc, os: windows-latest }

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history so we have branch information

- name: Set up Rust
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}

- name: Build trampoline binary
run: cargo build --release --target ${{ matrix.target }} --package pixi_trampoline

- name: Move trampoline binary on windows
if: startsWith(matrix.name, 'Windows')
run: |
mkdir -p trampolines-binaries
mv target/${{ matrix.target }}/release/pixi_trampoline.exe trampolines-binaries/pixi-trampoline-${{ matrix.target }}.exe
- name: Move trampoline binary on unix
if: startsWith(matrix.name, 'Windows') == false
run: |
mkdir -p trampolines-binaries
mv target/${{ matrix.target }}/release/pixi_trampoline trampolines-binaries/pixi-trampoline-${{ matrix.target }}
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: trampoline-${{ matrix.target }}
path: trampolines-binaries/

aggregate:
runs-on: ubuntu-latest
needs: build # This ensures the aggregation job runs after the build jobs
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download all binaries
uses: actions/download-artifact@v3
with:
path: trampolines-binaries/

- name: List downloaded files
run: ls -R trampolines-binaries/

- name: Move trampolines
run: |
mkdir -p trampolines
# Iterate through all files in trampolines directory and its subdirectories
find trampolines-binaries -type f -name 'pixi-trampoline-*' -exec mv -f {} trampolines/ \;
ls -R trampolines
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: trampolines
path: trampolines/



- name: Commit and push updated binaries
# Don't run on forks
if: github.repository == 'prefix-dev/pixi' && startsWith(github.ref, 'reaf/heads')
run: |
# Set the repository to push to the repository the workflow is running on
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add trampolines/
git commit -m "[CI]: Update trampoline binaries for all targets"
# Push changes to the branch that triggered the workflow
BRANCH=$(echo "${GITHUB_REF#refs/heads/}")
git push origin HEAD:$BRANCH
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,74 @@ 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.33.0] - 2024-10-16
#### ✨ Highlights

This is the first release with the new `pixi global` implementation. It's a full reimplementation of `pixi global` where it now uses a manifest file just like `pixi` projects. This way you can declare your environments and save them to a VCS.

It also brings features like, adding dependencies to a global environment, and exposing multiple binaries from the same environment that are not part of the main installed packages.

Test it out with:
```shell
# Normal feature
pixi global install ipython

# New features
pixi global install \
--environment science \ # Defined the environment name
--expose scipython=ipython \ # Expose binaries under custom names
ipython scipy # Define multiple dependencies for one environment
```

This should result in a manifest in `$HOME/.pixi/manifests/pixi-global.toml`:
```toml
version = 1

[envs.ipython]
channels = ["conda-forge"]
dependencies = { ipython = "*" }
exposed = { ipython = "ipython", ipython3 = "ipython3" }

[envs.science]
channels = ["conda-forge"]
dependencies = { ipython = "*", scipy = "*" }
exposed = { scipython = "ipython" }
```

#### 📖 Documentation
Checkout the updated documentation on this new feature:
- Main documentation on this tag: https://pixi.sh/v0.33.0/
- Global CLI documentation: https://pixi.sh/v0.33.0/reference/cli/#global
- The implementation documentation: https://pixi.sh/v0.33.0/features/global_tools/
- The initial design proposal: https://pixi.sh/v0.33.0/design_proposals/pixi_global_manifest/

### [0.32.2] - 2024-10-16
#### ✨ Highlights

- `pixi self-update` will only work on the binaries from the GitHub releases, avoiding accidentally breaking the installation.
- We now support `gcs://` conda registries.
- No more broken PowerShell after using `pixi shell`.

#### Changed
- Add support for `gcs://` conda registries by @clement-chaneching in [#2263](https://github.com/prefix-dev/pixi/pull/2263)

#### Documentation
- Small fixes in tutorials/python.md by @carschandler in [#2252](https://github.com/prefix-dev/pixi/pull/2252)
- Update `pixi list` docs by @Hofer-Julian in [#2269](https://github.com/prefix-dev/pixi/pull/2269)

#### Fixed
- Bind ctrl c listener so that it doesn't interfere on powershell by @wolfv in [#2260](https://github.com/prefix-dev/pixi/pull/2260)
- Explicitly run default environment by @ruben-arts in [#2273](https://github.com/prefix-dev/pixi/pull/2273)
- Parse env name on adding by @ruben-arts in [#2279](https://github.com/prefix-dev/pixi/pull/2279)

#### Refactor
- Make self-update a compile time feature by @freundTech in [#2213](https://github.com/prefix-dev/pixi/pull/2213)


#### New Contributors
* @clement-chaneching made their first contribution in [#2263](https://github.com/prefix-dev/pixi/pull/2263)
* @freundTech made their first contribution in [#2213](https://github.com/prefix-dev/pixi/pull/2213)

### [0.32.1] - 2024-10-08
#### Fixes
- Bump Rust version to `1.81` by @wolfv in [#2227](https://github.com/prefix-dev/pixi/pull/2227)
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.32.1'
url: 'https://pixi.sh/v0.32.1'
repository-code: 'https://github.com/prefix-dev/pixi/releases/tag/v0.33.0'
url: 'https://pixi.sh/v0.33.0'
abstract: >-
A cross-platform, language agnostic, package/project
management tool for development in virtual environments.
Expand Down
35 changes: 26 additions & 9 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 @@ -65,7 +65,6 @@ reqwest-middleware = "0.3.0"
reqwest-retry = "0.5.0"
rlimit = "0.10.1"
rstest = "0.19.0"
same-file = "1.0.6"
self-replace = "1.3.7"
serde = "1.0.198"
serde-untagged = "0.1.5"
Expand Down Expand Up @@ -95,7 +94,9 @@ rattler_cache = { version = "0.2.6", default-features = false }
rattler_conda_types = { version = "0.28.2", default-features = false }
rattler_digest = { version = "1.0.1", default-features = false }
rattler_lock = { version = "0.22.27", default-features = false }
rattler_networking = { version = "0.21.4", default-features = false }
rattler_networking = { version = "0.21.4", default-features = false, features = [
"google-cloud-auth",
] }
rattler_repodata_gateway = { version = "0.21.17", default-features = false }
rattler_shell = { version = "0.22.4", default-features = false }
rattler_solve = { version = "1.1.0", default-features = false }
Expand Down Expand Up @@ -142,7 +143,7 @@ license.workspace = true
name = "pixi"
readme.workspace = true
repository.workspace = true
version = "0.32.1"
version = "0.33.0"

[features]
default = ["rustls-tls"]
Expand All @@ -160,6 +161,7 @@ rustls-tls = [
"rattler/rustls-tls",
"pixi_utils/rustls-tls",
]
self_update = []
slow_integration_tests = []

[dependencies]
Expand All @@ -185,7 +187,6 @@ crossbeam-channel = { workspace = true }
csv = { workspace = true }
deno_task_shell = { workspace = true }
dialoguer = { workspace = true }
dirs = { workspace = true }
distribution-filename = { workspace = true }
distribution-types = { workspace = true }
dunce = { workspace = true }
Expand Down Expand Up @@ -248,7 +249,6 @@ reqwest = { workspace = true, features = [
] }
reqwest-middleware = { workspace = true }
rlimit = { workspace = true }
same-file = { workspace = true }
self-replace = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
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.32.1";
pub const PIXI_VERSION: &str = "0.33.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
Loading

0 comments on commit c9a8376

Please sign in to comment.