Skip to content

Commit

Permalink
Merge pull request #48 from pygridtools/master
Browse files Browse the repository at this point in the history
Release 0.7.7
  • Loading branch information
dan-blanchard authored Mar 8, 2017
2 parents c65eca5 + 6f03237 commit 625808f
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 73 deletions.
24 changes: 19 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,36 @@ python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- 3.6-dev

sudo: required

addons:
hostname: drmaa.travis-ci.org
hosts:
- localhost
- localhost.localdomain
- drmaa.travis-ci.org


notifications:
email: false

cache: pip

# Install stuff
virtualenv:
system_site_packages: true
before_install:
- travis/install_sge.sh
- export GRID_MAP_REDIS_PORT=12345
- export SGE_ROOT=/var/lib/gridengine
- export SGE_CELL=default
- export DRMAA_LIBRARY_PATH=/usr/lib/libdrmaa.so.1.0
- pip install --upgrade pip
install:
- pip install python-coveralls --use-mirrors
- pip install nose-cov --use-mirrors
- pip install python-coveralls
- pip install nose-cov
- python setup.py install

# Run test
Expand Down
112 changes: 51 additions & 61 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,90 +1,80 @@
DRMAA Python
------------

.. image:: https://travis-ci.org/drmaa-python/drmaa-python.png
:target: https://travis-ci.org/drmaa-python/drmaa-python
:alt: Travis build status
.. image:: https://img.shields.io/travis/pygridtools/drmaa-python/stable.svg
:alt: Build status
:target: https://travis-ci.org/pygridtools/drmaa-python

.. image:: https://coveralls.io/repos/drmaa-python/drmaa-python/badge.png
:target: https://coveralls.io/r/drmaa-python/drmaa-python
:alt: Test coverage
.. image:: https://img.shields.io/coveralls/pygridtools/drmaa-python/stable.svg
:target: https://coveralls.io/r/pygridtools/drmaa-python

.. image:: https://pypip.in/d/drmaa/badge.png
:target: https://crate.io/packages/drmaa
.. image:: https://img.shields.io/pypi/dm/drmaa.svg
:target: https://warehouse.python.org/project/drmaa/
:alt: PyPI downloads

.. image:: https://pypip.in/v/drmaa/badge.png
:target: https://crate.io/packages/drmaa
.. image:: https://img.shields.io/pypi/v/drmaa.svg
:target: https://warehouse.python.org/project/drmaa/
:alt: Latest version on PyPI

.. image:: https://d2weczhvl823v0.cloudfront.net/drmaa-python/drmaa-python/trend.png
:alt: Bitdeli badge
:target: https://bitdeli.com/free
.. image:: https://img.shields.io/pypi/l/drmaa.svg
:alt: License

`Distributed Resource Management Application API <http://en.wikipedia.org/wiki/DRMAA>`__
(DRMAA) bindings for Python. For more information
`read the docs <http://drmaa-python.readthedocs.org>`__.
`read the docs <http://drmaa-python.readthedocs.org>`__.

If you simply want to run Python functions on a DRMAA-compatible grid, use
`GridMap <https://github.com/pygridtools/gridmap>`__.

Requirements
~~~~~~~~~~~~

- Python 2.6+
- A DRMAA-compatible cluster (e.g., Grid Engine)

License
~~~~~~~
Installation
~~~~~~~~~~~~

- BSD (3 Clause)
To use the DRMAA Python library, you need to install it via ``pip``:

Changelog
~~~~~~~~~

- v0.7.6
.. code-block:: bash
- Fix a typo in ``DictAttribute`` that was causing a crash.
pip install drmaa
- v0.7.5
- Fix an issue where dictionary attributes (like ``jtEnvironment``) could
encounter ``UnicodeDecodeError``s upon assignment.
and then setup any environment variables that are necessary for your particular DRM system.
For SGE, this means ``SGE_ROOT`` and ``SGE_CELL``, which should be set as follows:

- v0.7.4
- Switch to using preferred encoding from ``locale`` module for converting
strings to binary. This should prevent some lingering ``UnicodeEncodeError``
crashes on Python 2.7.

- v0.7.3
.. code-block:: bash
- Fix a couple crashes when certain functions that expect ``str`` were passed
integers.
export SGE_ROOT=/path/to/gridengine
export SGE_CELL=default
- v0.7.2

- Fix a couple inconsistencies with ``str`` vs ``bytes`` in Python 3 in
``drmaa.session``.

- v0.7.1

- Add `Read The Docs documentation <http://drmaa-python.readthedocs.org>`__
- Add ``const`` module identifiers back into package namespace
- Remove ``b`` prefixes from strings inserted into error messages.

- v0.7.0

- String attribute issues with Python 3 have all been resolved, and now each
function that takes a string can handle unicode strings, and returns
unicode strings.
- All code has been updated to use future imports for ``unicode_literals``
and ``print_function``, so we're effectively writing Python 3 code now.
- PEP8 compliance changes all over the place, except those that would break
names required by underlying C DRMAA library.
- Now automatically run unit tests of Travis-CI with SGE, and all tests pass
for Python 2.6, 2.7, and 3.3. SGE is installed using scripts I describe
in `this gist <https://gist.github.com/dan-blanchard/6586533>`__.
- Unit tests are now in a top-level directory instead of a sub-directory
under the drmaa package.
- There is now a `session.py` module that contains most of the code that was
in ``__init__.py`` before, and ``__init__`` just imports things and sets
``__all__`` and ``__version__``, as is typically recommended now.
- Drops support for Python 2.5.
where ``/path/to/gridengine/`` is replaced with the actual path to your Grid Engine installation,
and ``default`` is replaced with your installation's actual cell. The path is typically
``/var/lib/gridengine``.

You will also need access to the ``libdrmaa.so.1.0`` C library, which can often be installed as
part of the ``libdrmaa-dev`` package on most Unixes. Once you have installed that, you may need to
tell DRMAA Python where it is installed by setting the ``DRMAA_LIBRARY_PATH`` environment variable,
if it is not installed in a location that Python usually looks for libraries.


.. code-block:: bash
export DRMAA_LIBRARY_PATH=/usr/lib/libdrmaa.so.1.0
Acknowledgments
~~~~~~~~~~~~~~~

Thank you to `StatPro <http://www.statpro.com/>`__ and
`Educational Testing Service <https://github.com/EducationalTestingService>`__ for
funding the development of DRMAA Python.

Changelog
~~~~~~~~~

`See GitHub releases <https://github.com/drmaa-python/drmaa-python/releases>`__.
8 changes: 6 additions & 2 deletions drmaa/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,15 @@ def attributes_iterator(attributes):

def adapt_rusage(rusage):
"""
transform a rusage data structure into a dict
Transform a rusage data structure into a dict.
Due to the value possibly containing a equal sign make sure we
limit the splits to only the first occurrence.
"""
rv = dict()
for attr in attributes_iterator(rusage.contents):
k, v = attr.split('=')

k, v = attr.split('=',1)
rv[k] = v
return rv

Expand Down
6 changes: 4 additions & 2 deletions drmaa/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,13 @@ def wait(jobId, timeout=-1):
signaled = c_int()
c(drmaa_wifsignaled, byref(signaled), stat)
coredumped = c_int()
c(drmaa_wcoredump, byref(coredumped), stat)
if exited.value == 0:
c(drmaa_wcoredump, byref(coredumped), stat)
exit_status = c_int()
c(drmaa_wexitstatus, byref(exit_status), stat)
term_signal = create_string_buffer(SIGNAL_BUFFER)
c(drmaa_wtermsig, term_signal, sizeof(term_signal), stat)
if signaled.value == 1:
c(drmaa_wtermsig, term_signal, sizeof(term_signal), stat)
return JobInfo(jid_out.value.decode(), bool(exited), bool(signaled),
term_signal.value.decode(), bool(coredumped),
bool(aborted), int(exit_status.value), res_usage)
Expand Down
2 changes: 1 addition & 1 deletion drmaa/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
:author: Dan Blanchard ([email protected])
'''

__version__ = '0.7.6'
__version__ = '0.7.7'
VERSION = tuple(int(x) for x in __version__.split('.'))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def readme():
long_description=readme(),
license="BSD",
keywords="python grid hpc drmaa",
url="https://github.com/drmaa-python/drmaa-python",
url="https://github.com/pygridtools/drmaa-python",
tests_require='nose',
test_suite='nose.collector',
classifiers=["Development Status :: 4 - Beta",
Expand Down
1 change: 0 additions & 1 deletion travis/install_sge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# Written by Dan Blanchard ([email protected]), September 2013

cd travis
sudo sed -i -r "s/^(127.0.0.1\s)(localhost\.localdomain\slocalhost)/\1localhost localhost.localdomain $(hostname) /" /etc/hosts
sudo apt-get update -qq
echo "gridengine-master shared/gridenginemaster string localhost" | sudo debconf-set-selections
echo "gridengine-master shared/gridenginecell string default" | sudo debconf-set-selections
Expand Down

0 comments on commit 625808f

Please sign in to comment.