From c6695b9b076501bf3bc0374db6f5255950a7a005 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 19 Mar 2021 19:05:11 -0700 Subject: [PATCH 1/6] Fixed setup.py and added a simple test file which can be run to check basic functionality --- setup.py | 19 ++++++++++--------- tests/run_local_job.py | 12 ++++++++++++ 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 tests/run_local_job.py diff --git a/setup.py b/setup.py index 014fc5b49..59d3cea69 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,9 @@ from setuptools import setup, find_packages -if __name__ == "__main__": +if __name__ == '__main__': setup( - name="jpsi-python", - version="0.1", + name='psi-j-python', + version='0.1', description='''This is an implementation of the J/PSI (Portable Submission Interface for Jobs) specification.''', @@ -11,20 +11,20 @@ author='The ExaWorks Team', author_email='hategan@mcs.anl.gov', - url='https://github.com/exaworks/jpsi-python', + url='https://github.com/exaworks/psi-j-python', classifiers=( - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: MIT License', ), - packages={"jpsi-python": "src"}, - package_dir={"jpsi-python": "src"}, + packages=setuptools.find_packages(where='src'), + package_dir={'': 'src'}, package_data={ '': ['README.md', 'LICENSE'], - 'jpsi-python': ['config.yaml.sample'] + 'psi-j-python': ['*.sh'] }, @@ -35,4 +35,5 @@ install_requires=[ ], + python_requires='>=3.6', ) \ No newline at end of file diff --git a/tests/run_local_job.py b/tests/run_local_job.py new file mode 100644 index 000000000..f78eb4a11 --- /dev/null +++ b/tests/run_local_job.py @@ -0,0 +1,12 @@ +# This is meant as a simple test file to check if psi/j was installed successfully + +from psi.j import SubmitException, Job, JobExecutor, JobSpec, JobState + + +if __name__ == '__main__': + job = Job(JobSpec(executable='/bin/date')) + exec = JobExecutor.get_instance('local') + exec.submit(job) + print('Job submitted') + status = job.wait() + print('Job done: {}'.format(status)) From e29f1e3c6642f5ab0a1f5f075731750754f4a8a8 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 20 Mar 2021 11:15:32 -0700 Subject: [PATCH 2/6] Added tests directory to type/style checks --- .flake8 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.flake8 b/.flake8 index 402494492..5de163c27 100644 --- a/.flake8 +++ b/.flake8 @@ -29,3 +29,9 @@ max-line-length = 100 ignore = B902, D401, D100 + +# D103 - Missing docstring in public function +# +# Ignore docstrings requirement in tests + +per-file-ignores = tests/*:D103 From d6fc1b7f3c6ef646dbd4cb3b86a3a409f1f87cab Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 20 Mar 2021 11:15:43 -0700 Subject: [PATCH 3/6] Fixed unused imports --- tests/run_local_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_local_job.py b/tests/run_local_job.py index f78eb4a11..677c53c3b 100644 --- a/tests/run_local_job.py +++ b/tests/run_local_job.py @@ -1,6 +1,6 @@ # This is meant as a simple test file to check if psi/j was installed successfully -from psi.j import SubmitException, Job, JobExecutor, JobSpec, JobState +from psi.j import Job, JobExecutor, JobSpec if __name__ == '__main__': From 3fb64c499e26db0add4352cb6fd76ea8d8ed59b1 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 20 Mar 2021 11:16:01 -0700 Subject: [PATCH 4/6] Renamed "check" to "checks" in Makefile --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5a276ce9c..b7b4a6a0f 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,9 @@ typecheck: .PHONY: stylecheck stylecheck: flake8 src + flake8 tests -.PHONY: check +.PHONY: checks check: typecheck stylecheck From 59e7538731eb137ce87a43d015f151d4b325fa65 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 20 Mar 2021 11:16:23 -0700 Subject: [PATCH 5/6] Added package info to git ignore list --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0ffe11cca..e02bb435e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ docs/.generated/ src/test.py +psi_j_python.egg-info/ From cbe666a485d7325d58c995255ca14e131b1df88d Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 20 Mar 2021 11:17:36 -0700 Subject: [PATCH 6/6] Rename all occurrences of "check" --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b7b4a6a0f..c63070095 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ stylecheck: flake8 tests .PHONY: checks -check: typecheck stylecheck +checks: typecheck stylecheck .PHONY: genautodocs