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

Commit

Permalink
Merge pull request #20 from moka-guys/development
Browse files Browse the repository at this point in the history
Add environment scripts to remove dx python2 from PYTHONPATH
  • Loading branch information
Graeme-Smith authored Oct 28, 2019
2 parents 3234bd5 + f26f808 commit ddb7a53
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workstation Housekeeping v1.5
# Workstation Housekeeping v1.6

Scripts to manage data on the NGS workstation

Expand Down Expand Up @@ -56,6 +56,7 @@ Delete local directories that have been uploaded to the DNAnexus cloud storage s
git clone https://github.com/moka-guys/workstation_housekeeping.git
pip install workstation_housekeeping/wscleaner
wscleaner --version # Print version number
# If installing on workstation see wscleaner/README.md section 'Workstation Environment'
```

### Usage
Expand All @@ -65,4 +66,4 @@ wscleaner --set-key DNA_NEXUS_KEY # Cache dnanexus api key
wscleaner ROOT_DIRECTORY --logfile LOGFILE_PATH
```

---
---
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 ddb7a53

Please sign in to comment.