diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b5b7a553..a267f53d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 diff --git a/psiturk/experiment_server_controller.py b/psiturk/experiment_server_controller.py index a3e9cd02..56aae489 100644 --- a/psiturk/experiment_server_controller.py +++ b/psiturk/experiment_server_controller.py @@ -159,9 +159,12 @@ def shutdown(self, ppid=None): def check_server_process_running(self, process_hash): server_process_running = False for proc in psutil.process_iter(): - if process_hash in str(proc.as_dict(['cmdline'])): - server_process_running = True - break + try: + if process_hash in str(proc.as_dict(['cmdline'])): + server_process_running = True + break + except: + pass return server_process_running def get_project_hash(self): diff --git a/psiturk/psiturk_config.py b/psiturk/psiturk_config.py index 40a91113..c6428557 100644 --- a/psiturk/psiturk_config.py +++ b/psiturk/psiturk_config.py @@ -142,6 +142,10 @@ def load_config(self): 'database_url') if ('localhost' in database_url) or ('sqlite' in database_url): raise EphemeralContainerDBError(database_url) + + # if found, replace postgres:// with postgresql:// in database + database_url = self.get('Database Parameters', 'database_url') + self.set('Database Parameters', 'database_url', database_url.replace('postgres://', 'postgresql://')) def get_ad_url(self): diff --git a/psiturk/psiturk_shell.py b/psiturk/psiturk_shell.py index 7743c5a9..cd4422a6 100644 --- a/psiturk/psiturk_shell.py +++ b/psiturk/psiturk_shell.py @@ -98,7 +98,7 @@ def amt_services_wrapper(self): if not self.quiet: message = '{}{}'.format(message, still_can_do) self.perror(message) - sys.exit() + # sys.exit() <- This was failing a test earlier, preventing using commands w/o AMT connection except PsiturkException as e: self.poutput(e) diff --git a/setup.cfg b/setup.cfg index 85161e98..ba0a86c2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,8 +4,10 @@ version = attr: psiturk.version.version_number classifiers = Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 author = NYU Computation and Cognition Lab author_email = authors@psiturk.org description = An open platform for science on Amazon Mechanical Turk @@ -15,33 +17,31 @@ url = https://github.com/NYUCCL/psiturk [options] install_requires = - Flask_RESTful~=0.3.7 - boto3~=1.9.179 - fuzzywuzzy~=0.17.0 - cmd2~=0.9.14 - psutil~=5.6.3 - Flask_Login~=0.4.1 - gunicorn[gevent]~=20.0.4 - Flask~=1.1.4 - itsdangerous~=1.1.0 - markupsafe~=2.0.1 - certifi~=2019.11.28 - pytz~=2019.1 - user_agents~=2.0 + Flask_RESTful~=0.3.8 + boto3~=1.26.31 + botocore~=1.29.31 + fuzzywuzzy~=0.18.0 + cmd2~=2.4.2 + psutil~=5.9.4 + Flask_Login~=0.6.2 + gunicorn[gevent]~=20.1.0 + Flask~=2.2.2 + certifi~=2022.12.7 + pytz~=2022.6 + user_agents~=2.2.0 docopt~=0.6.2 - urllib3~=1.25.3 - Faker~=1.0.7 - requests~=2.22.0 - APScheduler~=3.6.1 - botocore~=1.12.179 - SQLAlchemy~=1.3.5 - pytest~=6.1.1 - future~=0.17.1 - GitPython~=3.1.0 - python-dotenv~=0.12.0 - python_dateutil~=2.8.1 - pyOpenSSL~=22.0.0 - setproctitle~=1.1.10 + urllib3~=1.26.13 + Faker~=15.3.4 + requests~=2.28.1 + APScheduler~=3.9.1 + SQLAlchemy~=1.4.45 + pytest~=7.2.0 + future~=0.18.2 + python-dotenv~=0.21.0 + python_dateutil~=2.8.2 + pyOpenSSL~=22.1.0 + setproctitle~=1.3.2 + python-Levenshtein~=0.20.8 packages= psiturk psiturk.api diff --git a/tests/test_noaws.py b/tests/test_noaws.py index a7ec32dd..bfa0cefa 100644 --- a/tests/test_noaws.py +++ b/tests/test_noaws.py @@ -45,7 +45,7 @@ def test_awskeys_invalid_shell(capfd, experiment_server_controller, out, err = capfd.readouterr() assert NoMturkConnectionError().message in err - +@pytest.mark.enable_socket def test_nonaws_still_can_do(capfd, edit_config_file, experiment_server_controller, psiturk_shell): """test_nonaws_still_can_do.""" diff --git a/tox.ini b/tox.ini index 240e54c6..47939346 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py36, py37, py38 +envlist = py37, py38, py39, py310 [testenv] deps =