Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: introducing the installer #664

Merged
merged 19 commits into from
May 27, 2024
Merged

Conversation

baszalmstra
Copy link
Collaborator

This PR introduces the Installer which handles executing transactions and more. The installer can be observed with the Reporter trait. A default implementation is provided which uses indicatif.

@baszalmstra baszalmstra requested a review from wolfv May 16, 2024 15:34
@baszalmstra baszalmstra marked this pull request as ready for review May 20, 2024 09:46
@baszalmstra
Copy link
Collaborator Author

Feel free to review, but please don't merge yet. I wanna test this out in pixi first.

@baszalmstra
Copy link
Collaborator Author

baszalmstra commented May 21, 2024

With the Python API it is now easier than ever to create a conda environment from scratch:

# Solve an environment with Python 3.9 for the current platform
records = await solve(channels=["conda-forge"], specs=["python=3.9"])

# Link the environment in the directory `my-env`.
await install(records, target_prefix="my-env")

# That's it! You now have a functioning environment with Python 3.9 in the "my-env" directory.

@baszalmstra
Copy link
Collaborator Author

Renamed link to install

}
}

async fn link_package(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make this (and the next function) pub? Could have some use cases.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also add this behavior to the link_package function that is called inside this function. Maybe that makes more sense since its already public. WDYT?

@baszalmstra
Copy link
Collaborator Author

I tested it in pixi as well: prefix-dev/pixi#1438

@wolfv feel free to merge if you have no new objections!

@wolfv wolfv merged commit 514b26c into conda:main May 27, 2024
14 checks passed
@baszalmstra baszalmstra mentioned this pull request May 27, 2024
@baszalmstra baszalmstra mentioned this pull request May 27, 2024
baszalmstra added a commit that referenced this pull request May 27, 2024
## 🤖 New release
* `rattler`: 0.25.0 -> 0.26.0
* `rattler_conda_types`: 0.23.1 -> 0.24.0
* `rattler_package_streaming`: 0.20.10 -> 0.21.0
* `rattler_networking`: 0.20.7 -> 0.20.8
* `rattler_lock`: 0.22.7 -> 0.22.8
* `rattler_repodata_gateway`: 0.20.1 -> 0.20.2
* `rattler_solve`: 0.22.0 -> 0.23.0
* `rattler_index`: 0.19.12 -> 0.19.13
* `rattler_shell`: 0.20.4 -> 0.20.5
* `rattler_virtual_packages`: 0.19.11 -> 0.19.12

<details><summary><i><b>Changelog</b></i></summary><p>

## `rattler`
<blockquote>

##
[0.26.0](rattler-v0.25.0...rattler-v0.26.0)
- 2024-05-27

### Fixed
- improve progress bar duration display
([#680](#680))

### Other
- introducing the installer
([#664](#664))
- create directories up front
([#533](#533))
</blockquote>

## `rattler_conda_types`
<blockquote>

##
[0.24.0](rattler_conda_types-v0.23.1...rattler_conda_types-v0.24.0)
- 2024-05-27

### Added
- removed Ord and more
([#673](#673))
- always store purls as a key in lock file
([#669](#669))
- add solve strategies
([#660](#660))

### Fixed
- make topological sorting support fully cyclic dependencies
([#678](#678))
</blockquote>

## `rattler_package_streaming`
<blockquote>

##
[0.21.0](rattler_package_streaming-v0.20.10...rattler_package_streaming-v0.21.0)
- 2024-05-27

### Other
- introducing the installer
([#664](#664))
</blockquote>

## `rattler_networking`
<blockquote>

##
[0.20.8](rattler_networking-v0.20.7...rattler_networking-v0.20.8)
- 2024-05-27

### Other
- introducing the installer
([#664](#664))
</blockquote>

## `rattler_lock`
<blockquote>

##
[0.22.8](rattler_lock-v0.22.7...rattler_lock-v0.22.8)
- 2024-05-27

### Added
- removed Ord and more
([#673](#673))
- always store purls as a key in lock file
([#669](#669))
</blockquote>

## `rattler_repodata_gateway`
<blockquote>

##
[0.20.2](rattler_repodata_gateway-v0.20.1...rattler_repodata_gateway-v0.20.2)
- 2024-05-27

### Fixed
- result grouped by subdir instead of channel
([#666](#666))

### Other
- introducing the installer
([#664](#664))
</blockquote>

## `rattler_solve`
<blockquote>

##
[0.23.0](rattler_solve-v0.22.0...rattler_solve-v0.23.0)
- 2024-05-27

### Added
- removed Ord and more
([#673](#673))
- always store purls as a key in lock file
([#669](#669))
- add solve strategies
([#660](#660))

### Fixed
- result grouped by subdir instead of channel
([#666](#666))

### Other
- introducing the installer
([#664](#664))
</blockquote>

## `rattler_index`
<blockquote>

##
[0.19.13](rattler_index-v0.19.12...rattler_index-v0.19.13)
- 2024-05-27

### Added
- always store purls as a key in lock file
([#669](#669))
</blockquote>

## `rattler_shell`
<blockquote>

##
[0.20.5](rattler_shell-v0.20.4...rattler_shell-v0.20.5)
- 2024-05-27

### Other
- updated the following local packages: rattler_conda_types
</blockquote>

## `rattler_virtual_packages`
<blockquote>

##
[0.19.12](rattler_virtual_packages-v0.19.11...rattler_virtual_packages-v0.19.12)
- 2024-05-27

### Other
- updated the following local packages: rattler_conda_types
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants