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 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/ diff --git a/Makefile b/Makefile index 5a276ce9c..c63070095 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,10 @@ typecheck: .PHONY: stylecheck stylecheck: flake8 src + flake8 tests -.PHONY: check -check: typecheck stylecheck +.PHONY: checks +checks: typecheck stylecheck .PHONY: genautodocs 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..677c53c3b --- /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 Job, JobExecutor, JobSpec + + +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))