py-rattler 0.22.0__cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py_rattler-0.22.0.dist-info/METADATA +208 -0
- py_rattler-0.22.0.dist-info/RECORD +68 -0
- py_rattler-0.22.0.dist-info/WHEEL +4 -0
- rattler/__init__.py +114 -0
- rattler/channel/__init__.py +5 -0
- rattler/channel/channel.py +94 -0
- rattler/channel/channel_config.py +43 -0
- rattler/channel/channel_priority.py +14 -0
- rattler/exceptions.py +120 -0
- rattler/explicit_environment/__init__.py +3 -0
- rattler/explicit_environment/environment.py +69 -0
- rattler/index/__init__.py +3 -0
- rattler/index/index.py +112 -0
- rattler/install/__init__.py +3 -0
- rattler/install/installer.py +96 -0
- rattler/lock/__init__.py +23 -0
- rattler/lock/channel.py +52 -0
- rattler/lock/environment.py +213 -0
- rattler/lock/hash.py +33 -0
- rattler/lock/lock_file.py +118 -0
- rattler/lock/package.py +302 -0
- rattler/match_spec/__init__.py +4 -0
- rattler/match_spec/match_spec.py +294 -0
- rattler/match_spec/nameless_match_spec.py +185 -0
- rattler/networking/__init__.py +21 -0
- rattler/networking/client.py +74 -0
- rattler/networking/fetch_repo_data.py +103 -0
- rattler/networking/middleware.py +234 -0
- rattler/package/__init__.py +26 -0
- rattler/package/about_json.py +329 -0
- rattler/package/index_json.py +437 -0
- rattler/package/no_arch_type.py +142 -0
- rattler/package/package_name.py +204 -0
- rattler/package/package_name_matcher.py +81 -0
- rattler/package/paths_json.py +696 -0
- rattler/package/run_exports_json.py +268 -0
- rattler/package_streaming/__init__.py +26 -0
- rattler/platform/__init__.py +4 -0
- rattler/platform/arch.py +59 -0
- rattler/platform/platform.py +217 -0
- rattler/prefix/__init__.py +4 -0
- rattler/prefix/prefix_paths.py +442 -0
- rattler/prefix/prefix_record.py +234 -0
- rattler/pty/__init__.py +25 -0
- rattler/pty/pty_process.py +391 -0
- rattler/pty/pty_session.py +241 -0
- rattler/py.typed +0 -0
- rattler/rattler.abi3.so +0 -0
- rattler/repo_data/__init__.py +19 -0
- rattler/repo_data/gateway.py +337 -0
- rattler/repo_data/package_record.py +938 -0
- rattler/repo_data/patch_instructions.py +22 -0
- rattler/repo_data/record.py +164 -0
- rattler/repo_data/repo_data.py +74 -0
- rattler/repo_data/source.py +85 -0
- rattler/repo_data/sparse.py +356 -0
- rattler/shell/__init__.py +3 -0
- rattler/shell/shell.py +134 -0
- rattler/solver/__init__.py +3 -0
- rattler/solver/solver.py +220 -0
- rattler/utils/rattler_version.py +19 -0
- rattler/version/__init__.py +5 -0
- rattler/version/version.py +591 -0
- rattler/version/version_spec.py +184 -0
- rattler/version/with_source.py +80 -0
- rattler/virtual_package/__init__.py +4 -0
- rattler/virtual_package/generic.py +136 -0
- rattler/virtual_package/virtual_package.py +201 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-rattler
|
|
3
|
+
Version: 0.22.0
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
7
|
+
Classifier: Programming Language :: Rust
|
|
8
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
9
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
10
|
+
Classifier: Typing :: Typed
|
|
11
|
+
Summary: A blazing fast library to work with the conda ecosystem
|
|
12
|
+
Author-email: Bas Zalmstra <zalmstra.bas@gmail.com>, Tarun Pratap Singh <pratapsinghtarun9@gmail.com>
|
|
13
|
+
License-Expression: BSD-3-Clause
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
16
|
+
Project-URL: Homepage, https://github.com/conda/rattler
|
|
17
|
+
Project-URL: Documentation, https://conda.github.io/rattler/py-rattler/
|
|
18
|
+
Project-URL: Repository, https://github.com/conda/rattler
|
|
19
|
+
Project-URL: Issues, https://github.com/conda/rattler/labels/python-bindings
|
|
20
|
+
|
|
21
|
+
<a href="https://prefix.dev/tools/rattler/">
|
|
22
|
+
<img src="https://github.com/user-attachments/assets/73dee0d8-b372-4462-bce1-f004c5f907b5" alt="banner">
|
|
23
|
+
</a>
|
|
24
|
+
|
|
25
|
+
# Rattler: Rust crates for fast handling of conda packages
|
|
26
|
+
|
|
27
|
+
![License][license-badge]
|
|
28
|
+
[![Build Status][build-badge]][build]
|
|
29
|
+
[![Project Chat][chat-badge]][chat-url]
|
|
30
|
+
[![Pixi Badge][pixi-badge]][pixi-url]
|
|
31
|
+
[![docs main][docs-main-badge]][docs-main]
|
|
32
|
+
[![python docs main][py-docs-main-badge]][py-docs-main]
|
|
33
|
+
|
|
34
|
+
[license-badge]: https://img.shields.io/badge/license-BSD--3--Clause-blue?style=flat-square
|
|
35
|
+
[build-badge]: https://img.shields.io/github/actions/workflow/status/conda/rattler/rust-compile.yml?style=flat-square&branch=main
|
|
36
|
+
[build]: https://github.com/conda/rattler/actions
|
|
37
|
+
[chat-badge]: https://img.shields.io/discord/1082332781146800168.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&style=flat-square
|
|
38
|
+
[chat-url]: https://discord.gg/kKV8ZxyzY4
|
|
39
|
+
[docs-main-badge]: https://img.shields.io/badge/rust_docs-main-yellow.svg?style=flat-square
|
|
40
|
+
[docs-main]: https://conda.github.io/rattler
|
|
41
|
+
[py-docs-main-badge]: https://img.shields.io/badge/python_docs-main-yellow.svg?style=flat-square
|
|
42
|
+
[py-docs-main]: https://conda.github.io/rattler/py-rattler
|
|
43
|
+
[pixi-badge]:https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json&style=flat-square
|
|
44
|
+
[pixi-url]: https://pixi.sh
|
|
45
|
+
|
|
46
|
+
Rattler is a library that provides common functionality used within the conda ecosystem ([what is conda & conda-forge?](#what-is-conda--conda-forge)).
|
|
47
|
+
The goal of the library is to enable programs and other libraries to easily interact with the conda ecosystem without being dependent on Python.
|
|
48
|
+
Its primary use case is as a library that you can use to provide conda related workflows in your own tools.
|
|
49
|
+
|
|
50
|
+
Rattler is written in Rust and tries to provide a clean API to its functionalities (see: [Components](#components)).
|
|
51
|
+
With the primary goal in mind we aim to provide bindings to different languages to make it easy to integrate Rattler in non-rust projects.
|
|
52
|
+
|
|
53
|
+
Rattler is actively used by [pixi](https://github.com/prefix-dev/pixi), [rattler-build](https://github.com/prefix-dev/rattler-build), and the https://prefix.dev backend.
|
|
54
|
+
|
|
55
|
+
## Showcase
|
|
56
|
+
|
|
57
|
+
This repository also contains a binary (use `cargo run` to try) that shows some of the capabilities of the library.
|
|
58
|
+
This is an example of installing an environment containing `cowpy` and all its dependencies _from scratch_ (including Python!):
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+
## Python and Javascript bindings
|
|
63
|
+
|
|
64
|
+
You can invoke `rattler` from Python or Javascript via our powerful bindings to solve, install and run commands in conda environments. Rattler offers you the fastest and cleanest Python bindings to the conda ecosystem.
|
|
65
|
+
|
|
66
|
+
### Python
|
|
67
|
+
|
|
68
|
+
To install the Python bindings, you can use pip or conda:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install py-rattler
|
|
72
|
+
# or
|
|
73
|
+
conda install -c conda-forge py-rattler
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
You can find the extensive documentation for the Python bindings [here](https://conda.github.io/rattler/py-rattler/).
|
|
77
|
+
|
|
78
|
+
<details>
|
|
79
|
+
<summary>Example usage of rattler from Python</summary>
|
|
80
|
+
The Python bindings to rattler are designed to be used with `asyncio`. You can access the raw power of the rattler library to solve environments, install packages, and run commands in the installed environments.
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
import asyncio
|
|
84
|
+
import tempfile
|
|
85
|
+
|
|
86
|
+
from rattler import solve, install, VirtualPackage
|
|
87
|
+
|
|
88
|
+
async def main() -> None:
|
|
89
|
+
# Start by solving the environment.
|
|
90
|
+
#
|
|
91
|
+
# Solving is the process of going from specifications of package and their
|
|
92
|
+
# version requirements to a list of concrete packages.
|
|
93
|
+
print("started solving the environment")
|
|
94
|
+
solved_records = await solve(
|
|
95
|
+
# Channels to use for solving
|
|
96
|
+
channels=["conda-forge"],
|
|
97
|
+
# The specs to solve for
|
|
98
|
+
specs=["python ~=3.12.0", "pip", "requests 2.31.0"],
|
|
99
|
+
# Virtual packages define the specifications of the environment
|
|
100
|
+
virtual_packages=VirtualPackage.detect(),
|
|
101
|
+
)
|
|
102
|
+
print("solved required dependencies")
|
|
103
|
+
|
|
104
|
+
# Install the packages into a new environment (or updates it if it already
|
|
105
|
+
# existed).
|
|
106
|
+
env_path = tempfile.mkdtemp()
|
|
107
|
+
await install(
|
|
108
|
+
records=solved_records,
|
|
109
|
+
target_prefix=env_path,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
print(f"created environment: {env_path}")
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
if __name__ == "__main__":
|
|
116
|
+
asyncio.run(main())
|
|
117
|
+
```
|
|
118
|
+
</details>
|
|
119
|
+
|
|
120
|
+
### Javascript
|
|
121
|
+
|
|
122
|
+
To use the Javascript bindings, you can install the `@conda-org/rattler` package via npm. rattler is compiled to WebAssembly and can be used in the browser or in Node.js.
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npm install @conda-org/rattler
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Using rattler from Javascript is useful to get access to the same version comparison functions as used throughout the conda ecosystem. It is also used as part of [`mambajs`](https://github.com/emscripten-forge/mambajs) which uses the rattler library to solve and install packages from the emscripten-forge channel _in the browser_.
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## Give it a try!
|
|
132
|
+
|
|
133
|
+
Before you begin, make sure you have the following prerequisites:
|
|
134
|
+
- A recent version of [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
|
135
|
+
- A recent version of [pixi](https://github.com/prefix-dev/pixi)
|
|
136
|
+
|
|
137
|
+
Follow these steps to clone, compile, and run the rattler project:
|
|
138
|
+
```shell
|
|
139
|
+
# Clone the rattler repository along with its submodules:
|
|
140
|
+
git clone --recursive https://github.com/conda/rattler.git
|
|
141
|
+
cd rattler
|
|
142
|
+
|
|
143
|
+
# Compile and execute rattler to create a JupyterLab instance:
|
|
144
|
+
pixi run rattler create jupyterlab
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The above command will execute the `rattler` executable in release mode.
|
|
148
|
+
It will download and install an environment into the `.prefix` folder that contains [`jupyterlab`](https://jupyterlab.readthedocs.io/en/stable/getting_started/overview.html) and all the dependencies required to run it (like `python`)
|
|
149
|
+
|
|
150
|
+
Run the following command to start jupyterlab:
|
|
151
|
+
|
|
152
|
+
```shell
|
|
153
|
+
# on windows
|
|
154
|
+
.\.prefix\Scripts\jupyter-lab.exe
|
|
155
|
+
|
|
156
|
+
# on linux or macOS
|
|
157
|
+
./.prefix/bin/jupyter-lab
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Voila!
|
|
161
|
+
You have a working installation of jupyterlab installed on your system!
|
|
162
|
+
You can of course install any package you want this way.
|
|
163
|
+
Try it!
|
|
164
|
+
|
|
165
|
+
## Contributing 😍
|
|
166
|
+
|
|
167
|
+
We would love to have you contribute!
|
|
168
|
+
See the CONTRIBUTION.md for more info. For questions, requests or a casual chat, we are very active on our discord server.
|
|
169
|
+
You can [join our discord server via this link][chat-url].
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
## Components
|
|
173
|
+
|
|
174
|
+
Rattler consists of several crates that provide different functionalities.
|
|
175
|
+
|
|
176
|
+
* **rattler_conda_types**: foundational types for all datastructures used within the conda eco-system.
|
|
177
|
+
* **rattler_package_streaming**: provides functionality to download, extract and create conda package archives.
|
|
178
|
+
* **rattler_repodata_gateway**: downloads, reads and processes information about existing conda packages from an index.
|
|
179
|
+
* **rattler_shell**: code to activate an existing environment and run programs in it.
|
|
180
|
+
* **rattler_solve**: a backend agnostic library to solve the package satisfiability problem.
|
|
181
|
+
* **rattler_virtual_packages**: a crate to detect system capabilities.
|
|
182
|
+
* **rattler_index**: create local conda channels from local packages.
|
|
183
|
+
* **rattler**: functionality to create complete environments from scratch using the crates above.
|
|
184
|
+
* **rattler-lock**: a library to create and parse lockfiles for conda environments.
|
|
185
|
+
* **rattler-networking**: common functionality for networking, like authentication, mirroring and more.
|
|
186
|
+
* **rattler-bin**: an example of a package manager using all the crates above (see: [showcase](#showcase))
|
|
187
|
+
|
|
188
|
+
You can find these crates in the `crates` folder.
|
|
189
|
+
|
|
190
|
+
Additionally, we provide Python bindings for most of the functionalities provided by the above crates.
|
|
191
|
+
A python package `py-rattler` is available on [conda-forge](https://prefix.dev/channels/conda-forge/packages/py-rattler) and [PyPI](https://pypi.org/project/py-rattler/).
|
|
192
|
+
Documentation for the python bindings can be found [here](https://conda.github.io/rattler/py-rattler).
|
|
193
|
+
|
|
194
|
+
## What is conda & conda-forge?
|
|
195
|
+
|
|
196
|
+
The conda ecosystem provides **cross-platform**, **binary** packages that you can use with **any programming language**.
|
|
197
|
+
`conda` is an open-source package management system and environment management system that can install and manage multiple versions of software packages and their dependencies.
|
|
198
|
+
`conda` is written in Python.
|
|
199
|
+
The aim of Rattler is to provide all functionality required to work with the conda ecosystem from Rust.
|
|
200
|
+
Rattler is not a reimplementation of `conda`.
|
|
201
|
+
`conda` is a package management tool.
|
|
202
|
+
Rattler is a _library_ to work with the conda ecosystem from different languages and applications.
|
|
203
|
+
For example, it powers the backend of https://prefix.dev.
|
|
204
|
+
|
|
205
|
+
`conda-forge` is a community-driven effort to bring new and existing software into the conda ecosystem.
|
|
206
|
+
It provides _tens-of-thousands of up-to-date_ packages that are maintained by a community of contributors.
|
|
207
|
+
For an overview of available packages see https://prefix.dev.
|
|
208
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
py_rattler-0.22.0.dist-info/METADATA,sha256=efwJCkhVTceAjsvtsV8hoclHa9EtswPlRxM8ZFFHIXQ,9941
|
|
2
|
+
py_rattler-0.22.0.dist-info/WHEEL,sha256=s8NxmDbYHddg5oVzZ4QZLSyBus4nl_93OiuRGzf4MbU,127
|
|
3
|
+
rattler/__init__.py,sha256=YTtm1FQckDkkVJgeF-iR1hz8kmhR4b17biPFBycoS3E,2789
|
|
4
|
+
rattler/channel/__init__.py,sha256=K-ZAo0qFzchXWP-6DpMHLg_djGD25-0CRwusisIGp8k,221
|
|
5
|
+
rattler/channel/channel.py,sha256=kGeZKa_YkSM943CA1i_8O1FXG9kS9hkrnmSl6OhkbbQ,2474
|
|
6
|
+
rattler/channel/channel_config.py,sha256=rRD4dGeHTBIcm3vTuQR1wTGTELNdN69yq4lyCaTaN3M,1532
|
|
7
|
+
rattler/channel/channel_priority.py,sha256=OQfCHp_DeInkMB0YahCf2X7yCk0_RtM_C_Vy4Ny-65M,474
|
|
8
|
+
rattler/exceptions.py,sha256=Bkwdmc7Wt25wsSr7d84b3JTBBd8eYTyHlmdv0B5aO5M,4258
|
|
9
|
+
rattler/explicit_environment/__init__.py,sha256=QHmwZkdVt-tFL-tEEdhLdH3apuI5F7ElpMzCRZeH3_o,170
|
|
10
|
+
rattler/explicit_environment/environment.py,sha256=Dqcvm5c7C3K0FJ04YVN8WIUrl0R8Fe2TeXZ4Qq8Dg-0,2641
|
|
11
|
+
rattler/index/__init__.py,sha256=X02qeNDYnyWR-J7FaAvNoQfw5DtYRbUGtNEq5nAva0Y,119
|
|
12
|
+
rattler/index/index.py,sha256=37z_o9yXEdDyUfFDbwX5xmfI8tw0Y32RiVmVdAdym3A,4621
|
|
13
|
+
rattler/install/__init__.py,sha256=F_DwKOql1YkdV78JV5jT0RglNhs2ZwSup9uWGv9wO4I,69
|
|
14
|
+
rattler/install/installer.py,sha256=_0Z8PKUitbtnGHZfzZr9657QZIN_ji1LBucr3zVipTM,4226
|
|
15
|
+
rattler/lock/__init__.py,sha256=JkighOKfDQBqX3xrw1NXYlA_j1IFNI47_s6p2XvFtQc,571
|
|
16
|
+
rattler/lock/channel.py,sha256=PaLb-vWRLTJWUx7fyMdP2Tow5wMlGuq3WUrHkrQIzeg,1331
|
|
17
|
+
rattler/lock/environment.py,sha256=sbcGqkb9rrGwpVCucDKkwdp2SFOyHZQGqvBArGEZFYs,7915
|
|
18
|
+
rattler/lock/hash.py,sha256=qNig1sf5EfRfaCK9x352DgqTpLdo75Gu4qvRZDbL33Q,805
|
|
19
|
+
rattler/lock/lock_file.py,sha256=6lwZPALFu53kIbh0Z6945_5yDhkTRFjGNGAgMmG_Ark,3463
|
|
20
|
+
rattler/lock/package.py,sha256=FnjWrHfcgRgqZepCKuCDA7tuIa0INGF8ivGswkQ_17E,9024
|
|
21
|
+
rattler/match_spec/__init__.py,sha256=uBV3ov1VlCIZlIWhkxxMPcTqRBF5p5lqvT2g6kQv5kQ,167
|
|
22
|
+
rattler/match_spec/match_spec.py,sha256=JyMwVy21vIK66XBudbj6vnw-43hPfQ-n7UNPNdw-iso,10893
|
|
23
|
+
rattler/match_spec/nameless_match_spec.py,sha256=TFemOm6kZ6Q4j3dBHusWRYzvubFfNVLcPSgHdrqs-mw,5366
|
|
24
|
+
rattler/networking/__init__.py,sha256=s-20DnfLQ_YaMOmpVfBbJDjUEEZEHFPbVycvqkdWlNo,528
|
|
25
|
+
rattler/networking/client.py,sha256=Gd4AjQhaepQbhV0S4DcqvOwu_jis2_LibTytVEO-L9I,1755
|
|
26
|
+
rattler/networking/fetch_repo_data.py,sha256=ByZ0yH9WmYWvQ0soyXaPpulamCasc9EJfMGy-_ca_m8,3742
|
|
27
|
+
rattler/networking/middleware.py,sha256=yxPGDr0Y4zxsfIL1_EtvwDhAONiOqVUTm2SVQuvYlBc,6298
|
|
28
|
+
rattler/package/__init__.py,sha256=omXnLVICkiH7HiaUzpRWAaJxS955Uimm1pT8dejJgVU,624
|
|
29
|
+
rattler/package/about_json.py,sha256=FElWUXFNeF1gQJXE6lmYNEdxQjhsuimVObIeqxn3y8M,8958
|
|
30
|
+
rattler/package/index_json.py,sha256=BxnJg5SPpiFsLhabz-Uuvc4ea_sg4N7Q-hqdQnXk8oc,12419
|
|
31
|
+
rattler/package/no_arch_type.py,sha256=y_1spiImY3654SDLRQWyp5mqr4l-gYKIuK4pCnEPj1s,3740
|
|
32
|
+
rattler/package/package_name.py,sha256=4k9mzoYZnPQ5u4om1Vk_vq96waZwsHRvOXSmHtwMpAs,5985
|
|
33
|
+
rattler/package/package_name_matcher.py,sha256=4MruLSx6fVtDkFqBHInUgs95v4rr7zaTyF8UT0BHXgQ,2545
|
|
34
|
+
rattler/package/paths_json.py,sha256=7l2Wmqobwcoe-TStXhoafWzXCT4OWif_yAAa6KVnKyg,21465
|
|
35
|
+
rattler/package/run_exports_json.py,sha256=fZlM_H7IBuVi6lfL4SLsV_NDb22TgFhpCkxjm8YIvfg,9305
|
|
36
|
+
rattler/package_streaming/__init__.py,sha256=I-mbr0sJnHzdFQP8v0Yb_GKpu4bIO3JbAJtq_wzA71Q,898
|
|
37
|
+
rattler/platform/__init__.py,sha256=YZaXxnJmG_WjYbhIAxA0jQDhaPYAR4rTVQCm4yRoyZQ,154
|
|
38
|
+
rattler/platform/arch.py,sha256=quY41vZordAaVGc-Y-ZR55mE8aHTpwWGqbUE9162OWs,1164
|
|
39
|
+
rattler/platform/platform.py,sha256=lkAB62zEzglAs3wZZfW5sujiRAbxr1On5SKcmr8HbuA,4900
|
|
40
|
+
rattler/prefix/__init__.py,sha256=gkgyqZ0yTmxOCW8DHuSG-X0spEzb8BIoiox8YG50XYc,257
|
|
41
|
+
rattler/prefix/prefix_paths.py,sha256=B0EwOFkVbSzuLChdjkjenTehfxjXwwMBIodSGOfBHFU,12828
|
|
42
|
+
rattler/prefix/prefix_record.py,sha256=1ALSRxHlhkOAl86_HKhU_l-Ny0PK11je6rnHo9alfh8,7048
|
|
43
|
+
rattler/pty/__init__.py,sha256=lIoecUQnscJ1tui5XvyIiVFcqtxB-jpZsA1PeXDKO7Q,794
|
|
44
|
+
rattler/pty/pty_process.py,sha256=rHaWqdE38kDt4nWaX34N8hfR-ShsfB_haqnMdEkA4IU,11583
|
|
45
|
+
rattler/pty/pty_session.py,sha256=Gmj2FBC9bW5ua7t523T9bJNwqe5q8sqDu61t6Y_D0ws,7329
|
|
46
|
+
rattler/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
|
+
rattler/rattler.abi3.so,sha256=JT-6aNj8R7KdQC5GhAeWmiIhE4DbitZvQ642d-MAhRM,52157720
|
|
48
|
+
rattler/repo_data/__init__.py,sha256=u0DmgChUgNwYkqNGKNioA0NXCbCbFQMuBaISuiHJEtQ,623
|
|
49
|
+
rattler/repo_data/gateway.py,sha256=tPW3Q4-7dtUiKvUWdrnO96U4k4I3NFpMyj6YPky2k8E,13348
|
|
50
|
+
rattler/repo_data/package_record.py,sha256=MB1ppI89VS4ZDS8CfUCIPhTDoixO1Cs5Cf_nTuYR3xA,28333
|
|
51
|
+
rattler/repo_data/patch_instructions.py,sha256=TNa7NgLtqGQ6lSpibLFxuPFwsmqRLrORpDZOpeZ5fnk,694
|
|
52
|
+
rattler/repo_data/record.py,sha256=uVmesHhEzll4CKmLnNdTh3GXMO66x_dmG49djJjKcho,4587
|
|
53
|
+
rattler/repo_data/repo_data.py,sha256=39VnTUVCwXDy22FD1UluA3MGyzUYw2rLY9G91u-28TE,2261
|
|
54
|
+
rattler/repo_data/source.py,sha256=WHpXXnZ0At0ciWothXcCau9vYJCO1oLsdW6snX1WBa4,2959
|
|
55
|
+
rattler/repo_data/sparse.py,sha256=sdJFI_PDNgMCPjMm7MdkOwB7DKvoUTgZtevuR5M6uoI,12772
|
|
56
|
+
rattler/shell/__init__.py,sha256=GW5Amfmw7ln9l4kBBZCelaJxYBP5xbk5NjdNLMZhNMU,179
|
|
57
|
+
rattler/shell/shell.py,sha256=FJ1Hd3fMQSCd7jNHmpPOR3wIKlADdNZTZZW42lkNTY0,4543
|
|
58
|
+
rattler/solver/__init__.py,sha256=NZabrelb_pcqOi5PyZTr3OeBbjd85IqW1-2ymOBO-k0,119
|
|
59
|
+
rattler/solver/solver.py,sha256=MzSbNs4Ui88Hbtt6sHD5dRX3ZLkWqrzOLE5lxy57d7E,11614
|
|
60
|
+
rattler/utils/rattler_version.py,sha256=eXAVN6NYg5EmsQ_DrfgxW1yJ_eWAlWx7IANasMRYgV4,526
|
|
61
|
+
rattler/version/__init__.py,sha256=n8wi1-mw4AgaEHzUoc-pG0l-7G0665TMMsEKb-fSHBA,214
|
|
62
|
+
rattler/version/version.py,sha256=5CWe2wjH-7lmKUgzFFMSfNwLF04lzLgarhckkmdQ4cY,15954
|
|
63
|
+
rattler/version/version_spec.py,sha256=Ymhcz73uEre1-n3TBIdFz3W6YXBE4UfcAdzNqNe-4dU,4820
|
|
64
|
+
rattler/version/with_source.py,sha256=nEW_jetdsB-5hKnxHVYgwOsd0EAe0fNKaCLlD4fIZiM,2539
|
|
65
|
+
rattler/virtual_package/__init__.py,sha256=pOvvD-8V6Ld5gYBj2KPI3-cZLx8m2hcl6dqRUoBTHuw,262
|
|
66
|
+
rattler/virtual_package/generic.py,sha256=ztDVHLNbO2SemZSpdoa2SdoXcZT1hopvBFQ11fNBZmQ,4411
|
|
67
|
+
rattler/virtual_package/virtual_package.py,sha256=hrFvoT2LjIsW5ubfXdXEZnKlSIfLP5G4vrbJST9xukI,6707
|
|
68
|
+
py_rattler-0.22.0.dist-info/RECORD,,
|
rattler/__init__.py
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
from rattler.version import Version, VersionSpec, VersionWithSource
|
|
2
|
+
from rattler.match_spec import MatchSpec, NamelessMatchSpec
|
|
3
|
+
from rattler.repo_data import (
|
|
4
|
+
PackageRecord,
|
|
5
|
+
RepoData,
|
|
6
|
+
RepoDataRecord,
|
|
7
|
+
PatchInstructions,
|
|
8
|
+
SparseRepoData,
|
|
9
|
+
Gateway,
|
|
10
|
+
SourceConfig,
|
|
11
|
+
PackageFormatSelection,
|
|
12
|
+
RepoDataSource,
|
|
13
|
+
)
|
|
14
|
+
from rattler.channel import Channel, ChannelConfig, ChannelPriority
|
|
15
|
+
from rattler.networking import Client, fetch_repo_data
|
|
16
|
+
from rattler.virtual_package import GenericVirtualPackage, VirtualPackage, VirtualPackageOverrides, Override
|
|
17
|
+
from rattler.package import (
|
|
18
|
+
PackageName,
|
|
19
|
+
AboutJson,
|
|
20
|
+
RunExportsJson,
|
|
21
|
+
PathsJson,
|
|
22
|
+
PathsEntry,
|
|
23
|
+
PathType,
|
|
24
|
+
PrefixPlaceholder,
|
|
25
|
+
FileMode,
|
|
26
|
+
IndexJson,
|
|
27
|
+
NoArchType,
|
|
28
|
+
NoArchLiteral,
|
|
29
|
+
)
|
|
30
|
+
from rattler.prefix import PrefixRecord, PrefixPaths, PrefixPathsEntry, PrefixPathType, Link, LinkType
|
|
31
|
+
from rattler.platform import Platform
|
|
32
|
+
from rattler.utils.rattler_version import get_rattler_version as _get_rattler_version
|
|
33
|
+
from rattler.install import install
|
|
34
|
+
from rattler.index import index
|
|
35
|
+
from rattler.lock import (
|
|
36
|
+
LockFile,
|
|
37
|
+
Environment,
|
|
38
|
+
LockChannel,
|
|
39
|
+
PackageHashes,
|
|
40
|
+
LockedPackage,
|
|
41
|
+
CondaLockedSourcePackage,
|
|
42
|
+
CondaLockedBinaryPackage,
|
|
43
|
+
CondaLockedPackage,
|
|
44
|
+
PypiLockedPackage,
|
|
45
|
+
)
|
|
46
|
+
from rattler.solver import solve, solve_with_sparse_repodata
|
|
47
|
+
|
|
48
|
+
__version__ = _get_rattler_version()
|
|
49
|
+
del _get_rattler_version
|
|
50
|
+
|
|
51
|
+
__all__ = [
|
|
52
|
+
"Version",
|
|
53
|
+
"VersionSpec",
|
|
54
|
+
"VersionWithSource",
|
|
55
|
+
"MatchSpec",
|
|
56
|
+
"NamelessMatchSpec",
|
|
57
|
+
"PackageRecord",
|
|
58
|
+
"Channel",
|
|
59
|
+
"ChannelConfig",
|
|
60
|
+
"ChannelPriority",
|
|
61
|
+
"Client",
|
|
62
|
+
"PatchInstructions",
|
|
63
|
+
"RepoDataRecord",
|
|
64
|
+
"RepoData",
|
|
65
|
+
"fetch_repo_data",
|
|
66
|
+
"GenericVirtualPackage",
|
|
67
|
+
"VirtualPackage",
|
|
68
|
+
"VirtualPackageOverrides",
|
|
69
|
+
"Override",
|
|
70
|
+
"PackageName",
|
|
71
|
+
"PrefixRecord",
|
|
72
|
+
"PrefixPaths",
|
|
73
|
+
"PrefixPathsEntry",
|
|
74
|
+
"PrefixPathType",
|
|
75
|
+
"SparseRepoData",
|
|
76
|
+
"PackageFormatSelection",
|
|
77
|
+
"LockFile",
|
|
78
|
+
"Environment",
|
|
79
|
+
"LockChannel",
|
|
80
|
+
"PackageHashes",
|
|
81
|
+
"LockedPackage",
|
|
82
|
+
"CondaLockedSourcePackage",
|
|
83
|
+
"CondaLockedBinaryPackage",
|
|
84
|
+
"CondaLockedPackage",
|
|
85
|
+
"PypiLockedPackage",
|
|
86
|
+
"solve",
|
|
87
|
+
"solve_with_sparse_repodata",
|
|
88
|
+
"Platform",
|
|
89
|
+
"install",
|
|
90
|
+
"index",
|
|
91
|
+
"AboutJson",
|
|
92
|
+
"RunExportsJson",
|
|
93
|
+
"PathsJson",
|
|
94
|
+
"PathsEntry",
|
|
95
|
+
"PathType",
|
|
96
|
+
"PrefixPlaceholder",
|
|
97
|
+
"FileMode",
|
|
98
|
+
"IndexJson",
|
|
99
|
+
"Gateway",
|
|
100
|
+
"SourceConfig",
|
|
101
|
+
"RepoDataSource",
|
|
102
|
+
"NoArchType",
|
|
103
|
+
"NoArchLiteral",
|
|
104
|
+
"Link",
|
|
105
|
+
"LinkType",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
# PTY support - only available on Unix platforms
|
|
109
|
+
try:
|
|
110
|
+
from rattler.pty import PtySession, PtyProcess, PtyProcessOptions # noqa: F401
|
|
111
|
+
|
|
112
|
+
__all__.extend(["PtySession", "PtyProcess", "PtyProcessOptions"])
|
|
113
|
+
except ImportError:
|
|
114
|
+
pass
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import Optional, TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
if TYPE_CHECKING:
|
|
5
|
+
from rattler.lock.channel import LockChannel
|
|
6
|
+
|
|
7
|
+
from rattler.rattler import PyChannel
|
|
8
|
+
from rattler.channel.channel_config import ChannelConfig
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Channel:
|
|
12
|
+
def __init__(self, name: str, channel_configuration: Optional[ChannelConfig] = None) -> None:
|
|
13
|
+
"""
|
|
14
|
+
Create a new channel.
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
>>> channel = Channel("conda-forge")
|
|
18
|
+
>>> channel
|
|
19
|
+
Channel(name="conda-forge", base_url="https://conda.anaconda.org/conda-forge/")
|
|
20
|
+
>>>
|
|
21
|
+
```
|
|
22
|
+
"""
|
|
23
|
+
if not channel_configuration:
|
|
24
|
+
channel_configuration = ChannelConfig()
|
|
25
|
+
|
|
26
|
+
self._channel = PyChannel(name, channel_configuration._channel_configuration)
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def _from_py_channel(cls, py_channel: PyChannel) -> Channel:
|
|
30
|
+
channel = cls.__new__(cls)
|
|
31
|
+
channel._channel = py_channel
|
|
32
|
+
return channel
|
|
33
|
+
|
|
34
|
+
def to_lock_channel(self) -> LockChannel:
|
|
35
|
+
"""
|
|
36
|
+
Returns a new [`LockChannel`] from existing channel.
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
>>> channel = Channel("conda-forge")
|
|
40
|
+
>>> channel.to_lock_channel()
|
|
41
|
+
LockChannel(url="https://conda.anaconda.org/conda-forge/")
|
|
42
|
+
>>>
|
|
43
|
+
```
|
|
44
|
+
"""
|
|
45
|
+
from rattler.lock.channel import LockChannel
|
|
46
|
+
|
|
47
|
+
return LockChannel(self.base_url)
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def name(self) -> Optional[str]:
|
|
51
|
+
"""
|
|
52
|
+
Return the name of this channel.
|
|
53
|
+
|
|
54
|
+
Examples
|
|
55
|
+
--------
|
|
56
|
+
```python
|
|
57
|
+
>>> channel = Channel("conda-forge")
|
|
58
|
+
>>> channel.name
|
|
59
|
+
'conda-forge'
|
|
60
|
+
>>>
|
|
61
|
+
```
|
|
62
|
+
"""
|
|
63
|
+
return self._channel.name
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def base_url(self) -> str:
|
|
67
|
+
"""
|
|
68
|
+
Return the base URL of this channel.
|
|
69
|
+
|
|
70
|
+
Examples
|
|
71
|
+
--------
|
|
72
|
+
```python
|
|
73
|
+
>>> channel = Channel("conda-forge")
|
|
74
|
+
>>> channel.base_url
|
|
75
|
+
'https://conda.anaconda.org/conda-forge/'
|
|
76
|
+
>>>
|
|
77
|
+
```
|
|
78
|
+
"""
|
|
79
|
+
return self._channel.base_url
|
|
80
|
+
|
|
81
|
+
def __repr__(self) -> str:
|
|
82
|
+
"""
|
|
83
|
+
Return a string representation of this channel.
|
|
84
|
+
|
|
85
|
+
Examples
|
|
86
|
+
--------
|
|
87
|
+
```python
|
|
88
|
+
>>> channel = Channel("conda-forge")
|
|
89
|
+
>>> channel
|
|
90
|
+
Channel(name="conda-forge", base_url="https://conda.anaconda.org/conda-forge/")
|
|
91
|
+
>>>
|
|
92
|
+
```
|
|
93
|
+
"""
|
|
94
|
+
return f'Channel(name="{self.name}", base_url="{self.base_url}")'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import os
|
|
3
|
+
from rattler.rattler import PyChannelConfig
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ChannelConfig:
|
|
7
|
+
def __init__(self, channel_alias: str = "https://conda.anaconda.org/", root_dir: str = os.getcwd()) -> None:
|
|
8
|
+
"""
|
|
9
|
+
Create a new channel configuration.
|
|
10
|
+
|
|
11
|
+
Examples
|
|
12
|
+
--------
|
|
13
|
+
```python
|
|
14
|
+
>>> channel_config = ChannelConfig()
|
|
15
|
+
>>> channel_config # doctest: +ELLIPSIS
|
|
16
|
+
ChannelConfig(channel_alias="https://conda.anaconda.org/", ...
|
|
17
|
+
>>> channel_config = ChannelConfig("https://repo.prefix.dev/", "/path/to/root/dir")
|
|
18
|
+
>>> channel_config
|
|
19
|
+
ChannelConfig(channel_alias="https://repo.prefix.dev/", root_dir="/path/to/root/dir")
|
|
20
|
+
>>>
|
|
21
|
+
```
|
|
22
|
+
"""
|
|
23
|
+
if root_dir is None:
|
|
24
|
+
# Use the current working directory as the root directory.
|
|
25
|
+
root_dir = os.getcwd()
|
|
26
|
+
self._channel_configuration = PyChannelConfig(channel_alias, root_dir)
|
|
27
|
+
|
|
28
|
+
def __repr__(self) -> str:
|
|
29
|
+
"""
|
|
30
|
+
Return a string representation of this channel configuration.
|
|
31
|
+
|
|
32
|
+
Examples
|
|
33
|
+
--------
|
|
34
|
+
```python
|
|
35
|
+
>>> channel_config = ChannelConfig()
|
|
36
|
+
>>> channel_config # doctest: +ELLIPSIS
|
|
37
|
+
ChannelConfig(channel_alias="https://conda.anaconda.org/", root_dir="...
|
|
38
|
+
>>>
|
|
39
|
+
```
|
|
40
|
+
"""
|
|
41
|
+
alias = self._channel_configuration.channel_alias
|
|
42
|
+
root_dir = self._channel_configuration.root_dir
|
|
43
|
+
return f'ChannelConfig(channel_alias="{alias}", root_dir="{root_dir}")'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
from rattler.rattler import PyChannelPriority
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ChannelPriority(Enum):
|
|
7
|
+
"""
|
|
8
|
+
Defines how priority of channels functions during solves. If strict, the channel that the package is first
|
|
9
|
+
found in will be used as the only channel for that package. If disabled, then packages can be retrieved from
|
|
10
|
+
any channel as package version takes precedence.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
Strict = PyChannelPriority.Strict
|
|
14
|
+
Disabled = PyChannelPriority.Disabled
|
rattler/exceptions.py
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
try:
|
|
2
|
+
from rattler.rattler import (
|
|
3
|
+
InvalidVersionError,
|
|
4
|
+
InvalidVersionSpecError,
|
|
5
|
+
InvalidMatchSpecError,
|
|
6
|
+
InvalidPackageNameError,
|
|
7
|
+
InvalidUrlError,
|
|
8
|
+
InvalidChannelError,
|
|
9
|
+
ActivationError,
|
|
10
|
+
ParsePlatformError,
|
|
11
|
+
ParseArchError,
|
|
12
|
+
TransactionError,
|
|
13
|
+
LinkError,
|
|
14
|
+
IoError,
|
|
15
|
+
DetectVirtualPackageError,
|
|
16
|
+
CacheDirError,
|
|
17
|
+
FetchRepoDataError,
|
|
18
|
+
SolverError,
|
|
19
|
+
ConvertSubdirError,
|
|
20
|
+
VersionBumpError,
|
|
21
|
+
EnvironmentCreationError,
|
|
22
|
+
ExtractError,
|
|
23
|
+
GatewayError,
|
|
24
|
+
ValidatePackageRecordsException,
|
|
25
|
+
)
|
|
26
|
+
except ImportError:
|
|
27
|
+
# They are only redefined for documentation purposes
|
|
28
|
+
# when there is no binary yet
|
|
29
|
+
|
|
30
|
+
class InvalidVersionError(Exception): # type: ignore[no-redef]
|
|
31
|
+
"""Error that can occur when parsing a Version"""
|
|
32
|
+
|
|
33
|
+
class InvalidVersionSpecError(Exception): # type: ignore[no-redef]
|
|
34
|
+
"""Error that can occur when parsing a VersionSpec"""
|
|
35
|
+
|
|
36
|
+
class InvalidMatchSpecError(Exception): # type: ignore[no-redef]
|
|
37
|
+
"""Error that can occur when parsing a MatchSpec"""
|
|
38
|
+
|
|
39
|
+
class InvalidPackageNameError(Exception): # type: ignore[no-redef]
|
|
40
|
+
"""Error that can occur when parsing a package name"""
|
|
41
|
+
|
|
42
|
+
class InvalidUrlError(Exception): # type: ignore[no-redef]
|
|
43
|
+
"""Error that can occur when parsing a URL"""
|
|
44
|
+
|
|
45
|
+
class InvalidChannelError(Exception): # type: ignore[no-redef]
|
|
46
|
+
"""Error that can occur when parsing a channel."""
|
|
47
|
+
|
|
48
|
+
class ActivationError(Exception): # type: ignore[no-redef]
|
|
49
|
+
"""Error that can occur when activating a conda environment"""
|
|
50
|
+
|
|
51
|
+
class ParsePlatformError(Exception): # type: ignore[no-redef]
|
|
52
|
+
"""An error that can occur when parsing a platform from a string."""
|
|
53
|
+
|
|
54
|
+
class ParseArchError(Exception): # type: ignore[no-redef]
|
|
55
|
+
"""An error that can occur when parsing an arch from a string."""
|
|
56
|
+
|
|
57
|
+
class TransactionError(Exception): # type: ignore[no-redef]
|
|
58
|
+
"""An error that can occur when executing a transaction"""
|
|
59
|
+
|
|
60
|
+
class LinkError(Exception): # type: ignore[no-redef]
|
|
61
|
+
"""An error that can occur when linking a package"""
|
|
62
|
+
|
|
63
|
+
class IoError(Exception): # type: ignore[no-redef]
|
|
64
|
+
"""An error that can occur during io operations"""
|
|
65
|
+
|
|
66
|
+
class DetectVirtualPackageError(Exception): # type: ignore[no-redef]
|
|
67
|
+
"""An error that can occur when trying to detect virtual packages"""
|
|
68
|
+
|
|
69
|
+
class CacheDirError(Exception): # type: ignore[no-redef]
|
|
70
|
+
"""An error that can occur when querying the cache directory"""
|
|
71
|
+
|
|
72
|
+
class FetchRepoDataError(Exception): # type: ignore[no-redef]
|
|
73
|
+
"""An error that can occur when fetching repo data"""
|
|
74
|
+
|
|
75
|
+
class SolverError(Exception): # type: ignore[no-redef]
|
|
76
|
+
"""An error that can occur when trying to solve an environment"""
|
|
77
|
+
|
|
78
|
+
class ConvertSubdirError(Exception): # type: ignore[no-redef]
|
|
79
|
+
"""An error that can occur when parsing a platform from a string."""
|
|
80
|
+
|
|
81
|
+
class VersionBumpError(Exception): # type: ignore[no-redef]
|
|
82
|
+
"""An error that can occur when bumping a version."""
|
|
83
|
+
|
|
84
|
+
class EnvironmentCreationError(Exception): # type: ignore[no-redef]
|
|
85
|
+
"""An error that can occur when creating an environment."""
|
|
86
|
+
|
|
87
|
+
class ExtractError(Exception): # type: ignore[no-redef]
|
|
88
|
+
"""An error that can occur when extracting an archive."""
|
|
89
|
+
|
|
90
|
+
class GatewayError(Exception): # type: ignore[no-redef]
|
|
91
|
+
"""An error that can occur when querying the repodata gateway."""
|
|
92
|
+
|
|
93
|
+
class ValidatePackageRecordsException(Exception): # type: ignore[no-redef]
|
|
94
|
+
"""An error when validating package records."""
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
__all__ = [
|
|
98
|
+
"ActivationError",
|
|
99
|
+
"CacheDirError",
|
|
100
|
+
"DetectVirtualPackageError",
|
|
101
|
+
"FetchRepoDataError",
|
|
102
|
+
"InvalidChannelError",
|
|
103
|
+
"InvalidMatchSpecError",
|
|
104
|
+
"InvalidPackageNameError",
|
|
105
|
+
"InvalidUrlError",
|
|
106
|
+
"InvalidVersionError",
|
|
107
|
+
"InvalidVersionSpecError",
|
|
108
|
+
"IoError",
|
|
109
|
+
"LinkError",
|
|
110
|
+
"ParseArchError",
|
|
111
|
+
"ParsePlatformError",
|
|
112
|
+
"SolverError",
|
|
113
|
+
"TransactionError",
|
|
114
|
+
"ConvertSubdirError",
|
|
115
|
+
"VersionBumpError",
|
|
116
|
+
"EnvironmentCreationError",
|
|
117
|
+
"ExtractError",
|
|
118
|
+
"GatewayError",
|
|
119
|
+
"ValidatePackageRecordsException",
|
|
120
|
+
]
|