diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4f46c62..6ef0ee7 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -26,7 +26,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -e . - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -35,4 +35,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest + python examples/simple_poisson/simple_poisson.py diff --git a/setup.py b/setup.py index 951f3f4..8edda9d 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,23 @@ import setuptools +import os +import pathlib + +here = pathlib.Path(__file__).parent.resolve() +long_description = (here / "README.md").read_text(encoding="utf-8") + + +def load_requirements(path_dir=here, comment_char="#"): + with open(os.path.join(path_dir, "requirements.txt"), "r") as file: + lines = [line.strip() for line in file.readlines()] + requirements = [] + for line in lines: + # filer all comments + if comment_char in line: + line = line[: line.index(comment_char)] + if line: # if requirement is not empty + requirements.append(line) + return requirements -with open("README.md", "r") as fh: - long_description = fh.read() setuptools.setup( name="idrlnet", # Replace with your own username @@ -18,5 +34,6 @@ setuptools.setup( "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], - python_requires='>=3.6', + python_requires=">=3.6", + install_requires=load_requirements(), )