Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Add environment scripts to remove dx python2 from PYTHONPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
Nana Mensah authored and Aledj2 committed Oct 28, 2019
1 parent 38f37be commit 2a36570
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wscleaner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ optional arguments:
pytest . --auth_token DNA_NEXUS_KEY
```

## Workstation Environment
The directory `env/` in this repository contains conda environment scripts for the workstation. These remove conflicts in the PYTHONPATH environment variable by editing the variable when conda is activated. The conda documentation describes where to place these scripts under ['saving environment variables'](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#macos-and-linux).


## License

Developed by Viapath Genome Informatics
10 changes: 10 additions & 0 deletions wscleaner/env/activate_env_vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# Cache the python path
export wsc_PPCACHE=$PYTHONPATH

# Remove the dxtoolkit path from the pythonpath environment variable
# Python searches this when importing modules, causing clashes with conda install
PYTHONPATH_CLEAN=$(echo $PYTHONPATH | sed s,/usr/share/dnanexus/lib/python2.7/site-packages:,,)
# Set the new pythonpath
export PYTHONPATH=$PYTHONPATH_CLEAN
4 changes: 4 additions & 0 deletions wscleaner/env/deactivate_env_vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

# Set the python path to the original before the environment was active
export PYTHONPATH=${wsc_PPCACHE}

0 comments on commit 2a36570

Please sign in to comment.