-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from databio/dev
Release for v0.9
- Loading branch information
Showing
17 changed files
with
271 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
Contributing | ||
========================= | ||
|
||
We welcome contributions in the form of pull requests. | ||
|
||
If proposing changes to package source code, please run the test suite in `python2` and `python3` by running ``pytest`` or ``python setup.py test`` from within the repository root. | ||
|
||
If using ``pytest`` directly, we suggest first activating the appropriate Python version's virtual environment and running ``pip install --ugprade ./``. | ||
Otherwise, simply specify the appropriate Python version, i.e. ``python2 setup.py test`` or ``python3 setup.py test``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.8.1" | ||
__version__ = "0.9.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" Context manager for temporarily changing folder. """ | ||
|
||
import os | ||
|
||
|
||
__author__ = "Vince Reuter" | ||
__email__ = "[email protected]" | ||
|
||
|
||
|
||
class FolderContext(object): | ||
""" Context manager for temporarily changing directory. """ | ||
|
||
def __init__(self, folder): | ||
""" | ||
Store the previous working path to restore upon exit. | ||
:param str folder: Path to set as new working directory | ||
""" | ||
if not os.path.isdir(folder): | ||
raise ValueError( | ||
"Requested temp entry to non-folder: {}".format(folder)) | ||
self._prevdir = os.getcwd() | ||
self._currdir = folder | ||
|
||
def __enter__(self): | ||
""" Make the working directory switch. """ | ||
os.chdir(self._currdir) | ||
|
||
def __exit__(self, exc_type, exc_val, exc_tb): | ||
""" Switch back to the previous working directory. """ | ||
if not os.path.isdir(self._prevdir): | ||
raise RuntimeError("Return path is no longer a directory: {}". | ||
format(self._prevdir)) | ||
os.chdir(self._prevdir) |
Oops, something went wrong.