Bump dev status

Shouldn't be considered pre-release anymore

Also fixed pep8 test.

Change-Id: I9ad41ce6e60736a944af4195542c409f59e110b2
This commit is contained in:
Monsyne Dragon 2015-08-17 22:41:49 +00:00
parent 8ff276f548
commit f5bc8c2a13
4 changed files with 30 additions and 16 deletions

View File

@ -1,13 +1,13 @@
[metadata]
name = simport
version = 0.2
version = 0.3
author = Dark Secret Software Inc.
author-email = admin@darksecretsoftware.com
summary = simple import with python path management
description-file = README.md
license = Apache-2
classifier =
Development Status :: 3 - Alpha
Development Status :: 5 - Production/Stable
Environment :: Console
Intended Audience :: Developers
Intended Audience :: Information Technology

View File

@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import imp
import logging
import os
import os.path
@ -76,13 +75,15 @@ def _get_module(target):
sys.path.append(filepath)
if not class_or_function:
raise MissingMethodOrFunction("No Method or Function specified in '%s'" % target)
raise MissingMethodOrFunction("No Method or Function specified in "
"'%s'" % target)
if module:
try:
__import__(module)
except ImportError as e:
raise ImportFailed("Failed to import '%s'. Error: %s" % (module, e))
raise ImportFailed("Failed to import '%s'. "
"Error: %s" % (module, e))
klass, sep, function = class_or_function.rpartition('.')
return module, klass, function
@ -94,7 +95,8 @@ def load(target, source_module=None):
if not module and source_module:
module = source_module
if not module:
raise MissingModule("No module name supplied or source_module provided.")
raise MissingModule("No module name supplied or "
"source_module provided.")
actual_module = sys.modules[module]
if not klass:
return getattr(actual_module, function)

14
tox.ini
View File

@ -1,10 +1,22 @@
[tox]
envlist = py26, py27
envlist = py26,py27,pep8
[testenv]
deps =
coverage
nose
mock
flake8
setenv = VIRTUAL_ENV={envdir}
commands = nosetests -d -v --with-coverage --cover-inclusive --cover-package simport []
[testenv:pep8]
commands =
flake8
[flake8]
ignore = H405
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,timex/__init__.py
show-source = True