Skip to content

Commit

Permalink
Merge pull request #312 from nsoranzo/tox_fixes
Browse files Browse the repository at this point in the history
Test and mypy fixes. Add support for 3.11
  • Loading branch information
nsoranzo committed Apr 12, 2023
2 parents fea6969 + 63103a3 commit f02b31d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 43 deletions.
30 changes: 10 additions & 20 deletions .github/workflows/pulsar.yaml
Expand Up @@ -24,10 +24,8 @@ jobs:
include:
- tox-env: py36-mypy
python: 3.6
- tox-env: py37-mypy
python: 3.7
- tox-env: py38-mypy
python: 3.8
- tox-env: py311-mypy
python: 3.11
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
Expand All @@ -36,7 +34,7 @@ jobs:
- name: Install tox
run: pip install tox
- name: Setup pycurl
run: sudo apt update; sudo apt install -y libxml2-dev libxslt1-dev libcurl4-openssl-dev python-pycurl openssh-server
run: sudo apt update; sudo apt install -y libxml2-dev libxslt1-dev libcurl4-openssl-dev openssh-server
- name: Run tox
run: tox -e ${{ matrix.tox-env }}
test:
Expand All @@ -49,21 +47,13 @@ jobs:
python: 3.6
- tox-env: py36-test-unit
python: 3.6
- tox-env: py37-test-ci
python: 3.7
- tox-env: py37-test-unit
python: 3.7
- tox-env: py38-test-ci
python: 3.8
- tox-env: py38-test-unit
python: 3.8
- tox-env: py39-test-ci
python: 3.9
- tox-env: py39-test-unit
python: 3.9
- tox-env: py39-install-wheel-no-conda
- tox-env: py311-test-ci
python: 3.11
- tox-env: py311-test-unit
python: 3.11
- tox-env: py39-install_wheel-no_conda
python: 3.9
- tox-env: py37-install-wheel
- tox-env: py37-install_wheel
python: 3.7
services:
job-files:
Expand Down Expand Up @@ -94,7 +84,7 @@ jobs:
## connect to the host running the Pulsar server for file transfers in stage out/in.
# tes-test:
# name: Run Tests
# runs-on: ubuntu-20.04
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# include:
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
@@ -1,3 +1,7 @@
[mypy]
show_error_codes = True
pretty = True

[mypy-galaxy.*]
ignore_missing_imports = True

Expand Down
7 changes: 2 additions & 5 deletions pulsar/client/manager.py
Expand Up @@ -52,6 +52,7 @@ def get_client(self, destination_params: Dict[str, Any], job_id: str, **kwargs:

def shutdown(self, ensure_cleanup=False) -> None:
"""Mark client manager's work as complete and clean up resources it managed."""
return


class ClientManager(ClientManagerInterface):
Expand Down Expand Up @@ -104,10 +105,6 @@ def get_client(self, destination_params, job_id, **kwargs):
job_manager_interface = job_manager_interface_class(**job_manager_interface_args)
return self.client_class(destination_params, job_id, job_manager_interface, **self.extra_client_kwds)

def shutdown(self, ensure_cleanup=False):
"""Mark client manager's work as complete and clean up resources it managed."""
pass


try:
from galaxy.jobs.runners.util.cli import factory as cli_factory
Expand Down Expand Up @@ -336,7 +333,7 @@ def __perform_transfer(self, transfer_info):
def __init_transfer_threads(self, num_transfer_threads):
self.num_transfer_threads = num_transfer_threads
self.transfer_queue = Queue()
for i in range(num_transfer_threads):
for _ in range(num_transfer_threads):
t = threading.Thread(target=self._transfer_worker)
t.daemon = True
t.start()
Expand Down
4 changes: 2 additions & 2 deletions pulsar/web/framework.py
Expand Up @@ -69,7 +69,7 @@ def add_args(func_args, arg_values):
if func_arg not in args and func_arg in arg_values:
args[func_arg] = arg_values[func_arg]

func_args = inspect.getargspec(func).args
func_args = inspect.getfullargspec(func).args
for arg_dict in arg_dicts:
add_args(func_args, arg_dict)

Expand Down Expand Up @@ -108,7 +108,7 @@ def __handle_access(self, req, environ, start_response):

def __build_args(self, func, args, req, environ):
args = build_func_args(func, args, req.GET, self._app_args(args, req))
func_args = inspect.getargspec(func).args
func_args = inspect.getfullargspec(func).args

for func_arg in func_args:
if func_arg == "ip":
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Expand Up @@ -2,9 +2,9 @@ webob
psutil
PasteDeploy
pyyaml
galaxy-job-metrics
galaxy-objectstore
galaxy-tool-util
galaxy-job-metrics>=19.9.0
galaxy-objectstore>=19.9.0
galaxy-tool-util>=19.9.0
galaxy-util>=22.1.2
paramiko
typing-extensions
Expand Down
7 changes: 1 addition & 6 deletions setup.py
Expand Up @@ -31,10 +31,6 @@
if PULSAR_GALAXY_LIB:
requirements = [r for r in requirements if not r.startswith("galaxy-")]

test_requirements = [
# TODO: put package test requirements here
]


_version_re = re.compile(r'__version__\s+=\s+(.*)')

Expand Down Expand Up @@ -128,7 +124,6 @@
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
test_suite='test',
tests_require=test_requirements
)
14 changes: 7 additions & 7 deletions tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py{36,37,38,39}-lint, py{36,37,38,39}-docs, py{36,37,38,39}-dist, py{36,37,38,39}-test-unit, py{36,37,38,39}-test, py{36,37,38,39}-install-wheel, py{36,37,38,39}-install-wheel-no-conda
envlist = lint, docs, dist, test-unit, test, install_wheel, install_wheel-no_conda
toxworkdir={env:TOX_WORK_DIR:.tox}
source_dir = pulsar
test_dir = test
Expand All @@ -11,18 +11,18 @@ commands =
lint: flake8 --ignore W504 {[tox]source_dir} {[tox]test_dir}
dist: make lint-dist
docs: make lint-docs
install-wheel: make test-install-wheel
install-wheel-no-conda: make test-install-wheel-no-conda
install_wheel-!no_conda: make test-install-wheel
install_wheel-no_conda: make test-install-wheel-no-conda
mypy: mypy {[tox]source_dir} {[tox]test_dir}

deps =
test,docs,mypy: -rrequirements.txt
test,test-install-wheel,test-install-wheel-no-conda,mypy: -rdev-requirements.txt
test,install_wheel,mypy: -rdev-requirements.txt
test: drmaa
lint: flake8
docs: sphinx==1.2
dist: twine
install-wheel,install-wheel-no-conda: virtualenv
install_wheel: virtualenv

setenv =
# tests ready to go after setup_tests.sh
Expand All @@ -40,10 +40,10 @@ passenv =
DRMAA_LIBRARY_PATH

skip_install =
lint,dist,install-wheel,install-wheel-no-conda: True
lint,dist,install_wheel: True

skipsdist =
docs: True

allowlist_externals =
docs,dist,install-wheel,install-wheel-no-conda: make
docs,dist,install_wheel: make

0 comments on commit f02b31d

Please sign in to comment.