conda-share 2.0.3__cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.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.
conda_share/__init__.py
ADDED
|
Binary file
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: conda-share
|
|
3
|
+
Version: 2.0.3
|
|
4
|
+
Summary: Easily share conda environments.
|
|
5
|
+
Keywords: conda,environment,sharing,python,package,dependency,data science,reproducibility
|
|
6
|
+
Author-email: James Bruska <bruskatech@protonmail.com>
|
|
7
|
+
License-Expression: GPL-3.0-or-later
|
|
8
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
9
|
+
|
|
10
|
+
# conda-share
|
|
11
|
+
|
|
12
|
+
Have you ever want to make conda environments sharable? Well this is the package for you!
|
|
13
|
+
|
|
14
|
+
After years of waiting for someone to build a tool that exports conda environments that can easily transfer across computers (and operating systems) while still keeping the package versions, I decided to build it myself.
|
|
15
|
+
|
|
16
|
+
## Why use conda-share?
|
|
17
|
+
|
|
18
|
+
### TL;DR
|
|
19
|
+
|
|
20
|
+
There is (at time of writing) no conda command in existence that exports only the user installed packages, with their version numbers, and also includes the installed pip packages. This is what you need to share an environment consistently and effectively.
|
|
21
|
+
|
|
22
|
+
conda-share makes this easy.
|
|
23
|
+
|
|
24
|
+
There is even a single line you can add to your python files and jupyer notebooks to save an updated environment every time it is run (so you don't have to keep track of it).
|
|
25
|
+
|
|
26
|
+
### General Goals
|
|
27
|
+
|
|
28
|
+
The primary goal is to generate a **shareable environment YAML** that is closer to “what you explicitly installed” (via `--from-history`) while also including version
|
|
29
|
+
numbers and pip packages.
|
|
30
|
+
|
|
31
|
+
The secondary goal is to provide a **programmatic API** for Python applications to read and evaluate conda environments.
|
|
32
|
+
|
|
33
|
+
### So why not just use "conda env export"?
|
|
34
|
+
|
|
35
|
+
Well, it outputs all the operating system specific packages too!
|
|
36
|
+
|
|
37
|
+
So if you export on your lab server that runs Linux and try to install it on your MacBook, it won't be able to build. That is not because there is any difference in practice if you manually install the packages, but because of those extra operating system specific packages.
|
|
38
|
+
|
|
39
|
+
Guess how I know this...
|
|
40
|
+
|
|
41
|
+
Conda-share solves this problem by only including the packages you specifically installed, just like `conda env export --from-history`
|
|
42
|
+
|
|
43
|
+
### So why not just use "conda env export --from-history"?
|
|
44
|
+
|
|
45
|
+
Because that command doesn't return any version numbers that you didn't ask for at time of install. It also doesn't include any pip packages.
|
|
46
|
+
|
|
47
|
+
This means that if you were to `conda install python=3.13 numpy` at the beginning, then only the `python` package will have a version number in your export. If numpy has upgraded 5 major versions since then, then when the next person goes to recreate this environment, they will install the wrong version of numpy.
|
|
48
|
+
|
|
49
|
+
To solve this, conda-share only includes the packages in `--from-history`, but it includes the version numbers as well. Additionally, conda-share includes the pip packages.
|
|
50
|
+
|
|
51
|
+
### Other small benefits
|
|
52
|
+
|
|
53
|
+
There are other small benefits to using this software:
|
|
54
|
+
|
|
55
|
+
- If you happen to make a typo when writing the environment name, it will tell you if the environment doesn't exist. I'm surprised that the default conda command doesn't error in this situation.
|
|
56
|
+
- Convenient functions to get info from conda environments in Python.
|
|
57
|
+
- You help me get my name out there. :)
|
|
58
|
+
|
|
59
|
+
## How to use
|
|
60
|
+
|
|
61
|
+
This makes it super easy to automatically keep your environment up to date for a python file or a jupyter notebook.
|
|
62
|
+
|
|
63
|
+
First, make sure conda-share is installed in your conda environment.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Make sure to replace <env_name> with the environment name
|
|
67
|
+
conda activate <env_name>
|
|
68
|
+
pip install conda-share
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Then, just add this one line to the top of your code.
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
import conda_share; conda_share.save_current_env()
|
|
75
|
+
# You can also save it to a different directory with a different name.
|
|
76
|
+
# import conda_share; conda_share.save_current_env("/path/to/my_envs/env.yml")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Voilà! That's it.
|
|
80
|
+
|
|
81
|
+
There are also other functions available in the python package for viewing and sharing conda environments.
|
|
82
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
conda_share/__init__.py,sha256=Sk3f8Rlj6_vnM3oJjQ-TFNc8b9U_xWXpUplejyc-IKY,127
|
|
2
|
+
conda_share/conda_share.cpython-311-aarch64-linux-gnu.so,sha256=aZVZerm3xNu8gEyUMOpX4s0mN8ue4IRGQDpXfsFQeqo,1447240
|
|
3
|
+
conda_share-2.0.3.dist-info/METADATA,sha256=AmOONm2bhgf8YxLVBsn0VNeGCUWVgf3RW8IAyge_Ps0,3870
|
|
4
|
+
conda_share-2.0.3.dist-info/WHEEL,sha256=PLvbfVhp1U4zlxcbeRWVeNaODcI6eSAR6nVnjJeXGIo,149
|
|
5
|
+
conda_share-2.0.3.dist-info/RECORD,,
|