dataflow-conda-plugin 0.1.0__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.0.dist-info/METADATA +3 -0
- dataflow_conda_plugin-0.1.0.dist-info/RECORD +8 -0
- dataflow_conda_plugin-0.1.0.dist-info/WHEEL +5 -0
- dataflow_conda_plugin-0.1.0.dist-info/entry_points.txt +2 -0
- dataflow_conda_plugin-0.1.0.dist-info/top_level.txt +1 -0
- plugin/__init__.py +0 -0
- plugin/plugin.py +42 -0
- plugin/scripts/install_dataflow_deps.sh +25 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
plugin/plugin.py,sha256=eFeDWyigMqLaBo7RSyvPEZjek-ToDb-JJBwctTP6eiA,1254
|
|
3
|
+
plugin/scripts/install_dataflow_deps.sh,sha256=tZUMJRORVYr0koxSsJAXyXDjfJGFLzzVVYwCUbYExAU,1091
|
|
4
|
+
dataflow_conda_plugin-0.1.0.dist-info/METADATA,sha256=b1gjmYsDnNVMut6E0_aFLRKbfaj0oTUFl7uS1Gv-1KA,65
|
|
5
|
+
dataflow_conda_plugin-0.1.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
6
|
+
dataflow_conda_plugin-0.1.0.dist-info/entry_points.txt,sha256=Vk2GKuQjr-5WV4NDKyPsnF37p3LUoAgPYOSMHxnpac8,46
|
|
7
|
+
dataflow_conda_plugin-0.1.0.dist-info/top_level.txt,sha256=Io_dflkI6h0vZSGOzZxx4e76CDTSANVfu4v4tVY6zsA,7
|
|
8
|
+
dataflow_conda_plugin-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
plugin
|
plugin/__init__.py
ADDED
|
File without changes
|
plugin/plugin.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import subprocess, sys, pkg_resources, os
|
|
2
|
+
from conda import plugins
|
|
3
|
+
from conda.base.context import context
|
|
4
|
+
|
|
5
|
+
def install_deps(command: str):
|
|
6
|
+
"""Install dataflow dependencies."""
|
|
7
|
+
target_prefix = context.target_prefix
|
|
8
|
+
args = context._argparse_args
|
|
9
|
+
try:
|
|
10
|
+
# if cloning, skip the install
|
|
11
|
+
if (args.get('clone') is not None):
|
|
12
|
+
return
|
|
13
|
+
|
|
14
|
+
install_dataflow_deps = pkg_resources.resource_filename('plugin', 'scripts/install_dataflow_deps.sh')
|
|
15
|
+
process = subprocess.Popen(
|
|
16
|
+
["bash", install_dataflow_deps, target_prefix],
|
|
17
|
+
stdout=subprocess.PIPE,
|
|
18
|
+
stderr=subprocess.STDOUT,
|
|
19
|
+
text=True,
|
|
20
|
+
bufsize=1
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
for line in iter(process.stdout.readline, ''):
|
|
24
|
+
print(line, end='')
|
|
25
|
+
sys.stdout.flush()
|
|
26
|
+
|
|
27
|
+
return_code = process.wait()
|
|
28
|
+
if return_code != 0:
|
|
29
|
+
print(f"Error in creating environment!!")
|
|
30
|
+
|
|
31
|
+
except Exception as e:
|
|
32
|
+
print(f"An unexpected error occurred: {str(e)}")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@plugins.hookimpl
|
|
37
|
+
def conda_post_commands():
|
|
38
|
+
yield plugins.CondaPostCommand(
|
|
39
|
+
name=f"install_deps_post_command",
|
|
40
|
+
action=install_deps,
|
|
41
|
+
run_for={"create"},
|
|
42
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
conda_env_path=$1
|
|
4
|
+
|
|
5
|
+
py_version=$(${conda_env_path}/bin/python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))")
|
|
6
|
+
|
|
7
|
+
${conda_env_path}/bin/pip install dash dash-renderer plotly flask flask-appbuilder typing jupyterhub oauthenticator jupyter-server-proxy jupyter streamlit ipython ipykernel ipython-sql jupysql psycopg2-binary dataflow-core dataflow-dbt
|
|
8
|
+
|
|
9
|
+
# 3. Install Dataflow Airflow to a separate path in environment
|
|
10
|
+
${conda_env_path}/bin/pip install \
|
|
11
|
+
--force-reinstall --root-user-action ignore \
|
|
12
|
+
--no-warn-conflicts dataflow-airflow==2.10.5 \
|
|
13
|
+
--target ${conda_env_path}/bin/airflow-libraries/
|
|
14
|
+
|
|
15
|
+
files=(
|
|
16
|
+
${conda_env_path}/lib/python${py_version}/site-packages/dbt/config/profile.py
|
|
17
|
+
${conda_env_path}/lib/python${py_version}/site-packages/dbt/task/debug.py
|
|
18
|
+
)
|
|
19
|
+
for file in ${files[@]}
|
|
20
|
+
do
|
|
21
|
+
awk '{gsub("from dbt.clients.yaml_helper import load_yaml_text", "from dbt.dataflow_config.secrets_manager import load_yaml_text"); print}' $file > temp
|
|
22
|
+
mv temp $file
|
|
23
|
+
done
|
|
24
|
+
|
|
25
|
+
echo "Environment Creation Successful"
|