diff --git a/Makefile b/Makefile index 9aa5914c1ad633a001d35b09f2ae12c5e678c781..1049420f1c42081f8a065db2930918c4786c4989 100644 --- a/Makefile +++ b/Makefile @@ -74,9 +74,11 @@ flake8: lint: $(IN_VENV) tox -e py27-lint && tox -e py34-lint -lint-dist: dist +_lint-dist: $(IN_VENV) twine check dist/* +lint-dist: dist _lint-dist + tests: $(IN_VENV) nosetests $(NOSE_TESTS) @@ -130,7 +132,7 @@ _release-test-artifacts: $(IN_VENV) twine upload -r test dist/* open https://testpypi.python.org/pypi/$(PROJECT_NAME) || xdg-open https://testpypi.python.org/pypi/$(PROJECT_NAME) -dist-all: lint-dist _dist-lib +dist-all: dist _dist-lib _lint-dist release-test-artifacts: dist-all _release-test-artifacts @@ -165,7 +167,7 @@ _dist-lib: $(IN_VENV) PULSAR_GALAXY_LIB=1 python setup.py sdist bdist_wheel ls -l dist -dist-lib: clean _dist-lib +dist-lib: clean-pyc clean-build _dist-lib build-coexecutor-container: $(MAKE) -C docker/coexecutor all diff --git a/pulsar/managers/queued_external_drmaa.py b/pulsar/managers/queued_external_drmaa.py index 9925f13f09d19e499cd1a4ebaef7a16337a4cd83..5f0a89045768279267f432cb0db939b076b2237a 100644 --- a/pulsar/managers/queued_external_drmaa.py +++ b/pulsar/managers/queued_external_drmaa.py @@ -6,7 +6,10 @@ from .base.base_drmaa import BaseDrmaaManager from .util.sudo import sudo_popen from ..managers import status -from galaxy.tools.deps.commands import which +try: + from galaxy.tools.deps.commands import which +except ImportError: + from galaxy.tool_util.deps.commands import which from logging import getLogger log = getLogger(__name__) diff --git a/requirements.txt b/requirements.txt index 5afcbe3f69f4ae9d711558deae5d4c0c60d6acc9..b21274724984fccb1ab90ad93ab650a5c525c0f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,12 +3,14 @@ psutil PasteDeploy six pyyaml -galaxy-lib +galaxy-job-metrics>=19.9.0.dev1 +galaxy-objectstore>=19.9.0.dev1 +galaxy-tool-util>=19.9.0.dev1 paramiko # Problematic for Python 3. -paste -PasteScript +paste ; python_version == '2.7' +PasteScript ; python_version == '2.7' ## Uncomment if using DRMAA queue manager. #drmaa diff --git a/requirements3.txt b/requirements3.txt deleted file mode 100644 index 93fd291c7d99c2ec100e372f028d5d4eec4df929..0000000000000000000000000000000000000000 --- a/requirements3.txt +++ /dev/null @@ -1,10 +0,0 @@ -## Python 3 is not yet working, but when it does it will require -## different libraries. Hence this file. -webob -psutil -PasteDeploy -six -galaxy-lib -paramiko - -chaussette diff --git a/setup.py b/setup.py index 13cd8f69f9b9642b7ec6b5b15491d8862d59126b..d9cd7db624063e00910beb3b099fe6422205f348 100644 --- a/setup.py +++ b/setup.py @@ -23,15 +23,16 @@ PULSAR_GALAXY_LIB = os.environ.get("PULSAR_GALAXY_LIB", "%d" % DEFAULT_PULSAR_GA readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :changelog:', '') -requirements = [ - 'six', - 'webob', - 'psutil', - 'pyyaml', -] +if os.path.exists("requirements.txt"): + requirements = [r for r in open("requirements.txt").read().split("\n") if ";" not in r] + py27_requirements = [r.split(";", 1)[0].strip() for r in open("requirements.txt").read().split("\n") if ";" in r] +else: + # In tox, it will cover them anyway. + requirements = [] + py27_requirements = [] -if not PULSAR_GALAXY_LIB: - requirements.append("galaxy-lib") +if PULSAR_GALAXY_LIB: + requirements = [r for r in requirements if not r.startswith("galaxy-")] # TODO: use extra_requires here to be more correct. if sys.version_info[0] == 2: @@ -108,6 +109,9 @@ setup( package_dir={'pulsar': 'pulsar'}, include_package_data=True, install_requires=requirements, + extras_require={ + ':python_version=="2.7"': py27_requirements, + }, license="Apache License 2.0", zip_safe=False, keywords='pulsar', diff --git a/test/client_staging_test.py b/test/client_staging_test.py index cc570557e9ea7c36f40fbe4510d4005609994919..7e66619910dc171dbb900517a4540f81a3c2214d 100644 --- a/test/client_staging_test.py +++ b/test/client_staging_test.py @@ -5,8 +5,8 @@ from .test_utils import TempDirectoryTestCase from pulsar.client.test.test_common import write_config from pulsar.client import submit_job, ClientJobDescription from pulsar.client import ClientOutputs -from galaxy.tools.deps.dependencies import DependenciesDescription -from galaxy.tools.deps.requirements import ToolRequirement +from galaxy.tool_util.deps.dependencies import DependenciesDescription +from galaxy.tool_util.deps.requirements import ToolRequirement TEST_REQUIREMENT_1 = ToolRequirement("test1", "1.0") TEST_REQUIREMENT_2 = ToolRequirement("test2", "1.0") diff --git a/test/persistence_test.py b/test/persistence_test.py index 21c12c0b5379b694e71057b1d80ee722179eca65..d7221e26a89f72c3f9693f2d1ff4a48cbe0596ac 100644 --- a/test/persistence_test.py +++ b/test/persistence_test.py @@ -9,8 +9,8 @@ from .test_utils import ( temp_directory, TestDependencyManager ) +from galaxy.job_metrics import NULL_JOB_INSTRUMENTER from galaxy.util.bunch import Bunch -from galaxy.jobs.metrics import NULL_JOB_INSTRUMENTER TEST_JOB_ID = "4" TEST_STAGED_FILE = "cow" diff --git a/test/test_utils.py b/test/test_utils.py index 1b267940f6cc8299d0e636728d43b854404dd7c2..232255d550b9c46331426a537e3e449c8ca6b786 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -22,8 +22,8 @@ from webtest.http import StopableWSGIServer import galaxy.util import pulsar.util +from galaxy.job_metrics import NULL_JOB_INSTRUMENTER from galaxy.util.bunch import Bunch -from galaxy.jobs.metrics import NULL_JOB_INSTRUMENTER from pulsar.managers.util import drmaa from pulsar.tools import ToolBox diff --git a/tox.ini b/tox.ini index 4e83580c6ca873575f9fd3843c41533a891d7dd4..e39e62ac5097c759d725188da78c61f29de4c1f5 100644 --- a/tox.ini +++ b/tox.ini @@ -15,14 +15,14 @@ commands = nosetests --exclude '.*integration.*' [] [testenv:py35] deps = - -rrequirements3.txt + -rrequirements.txt -rdev-requirements.txt drmaa [testenv:py35-unit] commands = nosetests --verbose --exclude '.*integration.*' [] deps = - -rrequirements3.txt + -rrequirements.txt -rdev-requirements.txt drmaa