Skip to content

OS _ makefile

dwisianto edited this page Feb 7, 2023 · 6 revisions

Env Vars

Makefile Location

Makefile and Env Variables

Makefile and Anaconda

# Oneshell means I can run multiple lines in a recipe in the same shell, so I don't have to
# chain commands together with semicolon
.ONESHELL:
# Need to specify bash in order for conda activate to work.
SHELL=/bin/bash
# Note that the extra activate is needed to ensure that the activate floats env to the front of PATH
CONDA_ACTIVATE=source $$(conda info --base)/etc/profile.d/conda.sh ; conda activate ; conda activate

test:
    $(CONDA_ACTIVATE) eg_env
    echo $$(which python)

# format the file with black
lint:
    $(CONDA_ACTIVATE) eg_env
    black eg.py

# Run the file directly
run_py:
    $(CONDA_ACTIVATE) eg_env
    python eg.py

# Run the file from a shell script
run_sh:
    $(CONDA_ACTIVATE) eg_env
    bash eg.sh

eg_env.yml

name: eg_env
dependencies:
    - numpy
    - black

eg.sh

#!/bin/bash

echo "This is my test bash script"
echo "Activating conda environment"
eval "$($(which conda) 'shell.bash' 'hook')"
conda activate eg_env
echo "Running python script"
python eg.py

Makefile and Jupyter

home - Journey22 - jn22q3

OS - win - mac - bash - make - Git - Git GitHub - VSCode - vscode - settings - Docker - docker - dk-compose

Ubuntu - tigervnc

AirFlow - airflow_install_anaconda

Geo - geo_course_gds16 - geo_course_gds G_tools pysal G_data geo_data G_format geo_format_shapefile g_db geo_db_spatialite geo_dash geo_plotly_dash

AWS - awscli - iam

Semantic - s1 - s2 - RDF - OWL - SKOS - FOAF - Protoge - rdflib - owlready - swrl1 - sql1

Graph - g1

TinkerPopOverview = GremlinTraversalLanguage - TinkerGraph - GremlinConsole - GremlinLanguageVariant - GremlinServer - Documentation TinkerPopInstallation =

Clone this wiki locally