dataflow-conda-plugin 0.1.7rc4__py3-none-any.whl → 0.1.9__py3-none-any.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.
Potentially problematic release.
This version of dataflow-conda-plugin might be problematic. Click here for more details.
- {dataflow_conda_plugin-0.1.7rc4.dist-info → dataflow_conda_plugin-0.1.9.dist-info}/METADATA +1 -1
- dataflow_conda_plugin-0.1.9.dist-info/RECORD +8 -0
- plugin/plugin.py +32 -1
- plugin/scripts/install_dataflow_deps.sh +4 -3
- dataflow_conda_plugin-0.1.7rc4.dist-info/RECORD +0 -8
- {dataflow_conda_plugin-0.1.7rc4.dist-info → dataflow_conda_plugin-0.1.9.dist-info}/WHEEL +0 -0
- {dataflow_conda_plugin-0.1.7rc4.dist-info → dataflow_conda_plugin-0.1.9.dist-info}/entry_points.txt +0 -0
- {dataflow_conda_plugin-0.1.7rc4.dist-info → dataflow_conda_plugin-0.1.9.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
plugin/plugin.py,sha256=MR7sLR5JZ0hVKabzwHGFdnaGoWbw4mj1k-twgtgadw8,7581
|
|
3
|
+
plugin/scripts/install_dataflow_deps.sh,sha256=QrwkZRALlgGbO5Dsk1MHMCuWXFl_zYWddkcSsSQ4omY,1279
|
|
4
|
+
dataflow_conda_plugin-0.1.9.dist-info/METADATA,sha256=oVjTOME8aYXCffBVs-ENSJq6IELu5X_Oi6KbhEcA0HA,65
|
|
5
|
+
dataflow_conda_plugin-0.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
+
dataflow_conda_plugin-0.1.9.dist-info/entry_points.txt,sha256=Vk2GKuQjr-5WV4NDKyPsnF37p3LUoAgPYOSMHxnpac8,46
|
|
7
|
+
dataflow_conda_plugin-0.1.9.dist-info/top_level.txt,sha256=Io_dflkI6h0vZSGOzZxx4e76CDTSANVfu4v4tVY6zsA,7
|
|
8
|
+
dataflow_conda_plugin-0.1.9.dist-info/RECORD,,
|
plugin/plugin.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import subprocess, sys, pkg_resources, os, requests
|
|
1
|
+
import subprocess, sys, pkg_resources, os, requests, re, sys
|
|
2
2
|
from conda import plugins
|
|
3
3
|
from conda.base.context import context
|
|
4
4
|
from dataflow.utils.logger import CustomLogger
|
|
@@ -46,6 +46,8 @@ def install_deps(command: str):
|
|
|
46
46
|
"""Install dataflow dependencies."""
|
|
47
47
|
target_prefix = context.target_prefix
|
|
48
48
|
args = context._argparse_args
|
|
49
|
+
python_version = args.get("python")
|
|
50
|
+
print(f"Installing Dataflow dependencies in the environment with Python version: {python_version}")
|
|
49
51
|
env_name = os.path.basename(target_prefix) if target_prefix else None
|
|
50
52
|
|
|
51
53
|
should_save_to_db = is_local_environment(target_prefix) and env_name
|
|
@@ -77,6 +79,7 @@ def install_deps(command: str):
|
|
|
77
79
|
print(f"Error in creating environment!!")
|
|
78
80
|
if should_save_to_db and env_name:
|
|
79
81
|
save_environment(env_name, "Failed")
|
|
82
|
+
raise RuntimeError(f"Dataflow dependency installation failed! Please make sure compatible python version is used")
|
|
80
83
|
else:
|
|
81
84
|
if env_name and should_save_to_db:
|
|
82
85
|
save_environment(env_name, "Success")
|
|
@@ -86,6 +89,7 @@ def install_deps(command: str):
|
|
|
86
89
|
logger.error(f"Error installing dependencies: {str(e)}")
|
|
87
90
|
if should_save_to_db and env_name:
|
|
88
91
|
save_environment(env_name, "Failed")
|
|
92
|
+
raise e
|
|
89
93
|
|
|
90
94
|
def remove_environment(env_name: str):
|
|
91
95
|
"""Remove environment information via API."""
|
|
@@ -147,6 +151,25 @@ def package_operations(command: str):
|
|
|
147
151
|
if should_update_db:
|
|
148
152
|
mark_environment_for_refresh(env_name)
|
|
149
153
|
|
|
154
|
+
def set_pip_constraint(command: str):
|
|
155
|
+
"""Set PIP_CONSTRAINT environment variable based on Python version."""
|
|
156
|
+
if "NO_CONDA_PLUGIN_PIP_CONSTRAINT" in os.environ:
|
|
157
|
+
return
|
|
158
|
+
for arg in sys.argv:
|
|
159
|
+
if arg.startswith("python"):
|
|
160
|
+
# Match python=3.10, python=3.10.1, python=3.11, python=3.11.5, etc.
|
|
161
|
+
match = re.fullmatch(r"python=(3\.10(\.\d+)?|3\.11(\.\d+)?|3\.12(\.\d+)?)", arg)
|
|
162
|
+
if not match:
|
|
163
|
+
raise ValueError(f"Invalid argument: {arg}! Only Python 3.10, 3.11, and 3.12 are supported.")
|
|
164
|
+
version = match.group(1)
|
|
165
|
+
major_minor = ".".join(version.split(".")[:2])
|
|
166
|
+
break
|
|
167
|
+
else:
|
|
168
|
+
major_minor = "3.12"
|
|
169
|
+
# Set PIP_CONSTRAINT environment variable to the appropriate constraint file
|
|
170
|
+
os.environ["PIP_CONSTRAINT"] = f"/dataflow/tmp/pip_constraints/py{major_minor}-constraints.txt"
|
|
171
|
+
|
|
172
|
+
|
|
150
173
|
@plugins.hookimpl
|
|
151
174
|
def conda_post_commands():
|
|
152
175
|
yield plugins.CondaPostCommand(
|
|
@@ -158,4 +181,12 @@ def conda_post_commands():
|
|
|
158
181
|
name=f"package_operations_post_command",
|
|
159
182
|
action=package_operations,
|
|
160
183
|
run_for={"install", "remove", "update"},
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
@plugins.hookimpl
|
|
187
|
+
def conda_pre_commands():
|
|
188
|
+
yield plugins.CondaPreCommand(
|
|
189
|
+
name="set_pip_constraint",
|
|
190
|
+
action=set_pip_constraint,
|
|
191
|
+
run_for={"create"},
|
|
161
192
|
)
|
|
@@ -4,13 +4,14 @@ conda_env_path=$1
|
|
|
4
4
|
|
|
5
5
|
py_version=$(${conda_env_path}/bin/python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))")
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# make sure to install dataflow deps from pypi only
|
|
8
|
+
${conda_env_path}/bin/pip install --index-url https://pypi.org/simple/ dash==3.0.3 dash-renderer==1.9.1 plotly==6.0.1 typing==3.7.4.3 streamlit==1.45.1 ipython==8.37.0 ipykernel==6.29.5 ipython-sql==0.4.1 jupysql==0.10.14 psycopg2-binary==2.9.10 dataflow-core==2.1.17 dataflow-dbt==0.0.3
|
|
8
9
|
|
|
9
10
|
# 3. Install Dataflow Airflow to a separate path in environment
|
|
10
|
-
${conda_env_path}/bin/pip install
|
|
11
|
+
${conda_env_path}/bin/pip install \
|
|
11
12
|
--force-reinstall --root-user-action ignore \
|
|
12
13
|
--no-warn-conflicts dataflow-airflow==2.10.7 \
|
|
13
|
-
--constraint
|
|
14
|
+
--constraint /dataflow/setup/pip_constraints/airflow_constraints${py_version}.txt \
|
|
14
15
|
--target ${conda_env_path}/bin/airflow-libraries/
|
|
15
16
|
|
|
16
17
|
files=(
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
plugin/plugin.py,sha256=83cYuYaTDyYNPY_mWgn_isJaBb8G3kuUbzZtM7Yx15Q,6209
|
|
3
|
-
plugin/scripts/install_dataflow_deps.sh,sha256=VpkJFlzi7isqvL1k6hrfMVJoPVIuALtAV42leG4PLEI,1314
|
|
4
|
-
dataflow_conda_plugin-0.1.7rc4.dist-info/METADATA,sha256=OHtDyLnQ3kqj6q5y3E-EJW8x2O5Jyia5uCQWQmcaB1g,68
|
|
5
|
-
dataflow_conda_plugin-0.1.7rc4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
-
dataflow_conda_plugin-0.1.7rc4.dist-info/entry_points.txt,sha256=Vk2GKuQjr-5WV4NDKyPsnF37p3LUoAgPYOSMHxnpac8,46
|
|
7
|
-
dataflow_conda_plugin-0.1.7rc4.dist-info/top_level.txt,sha256=Io_dflkI6h0vZSGOzZxx4e76CDTSANVfu4v4tVY6zsA,7
|
|
8
|
-
dataflow_conda_plugin-0.1.7rc4.dist-info/RECORD,,
|
|
File without changes
|
{dataflow_conda_plugin-0.1.7rc4.dist-info → dataflow_conda_plugin-0.1.9.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{dataflow_conda_plugin-0.1.7rc4.dist-info → dataflow_conda_plugin-0.1.9.dist-info}/top_level.txt
RENAMED
|
File without changes
|