ci: update python-package.yml

This commit is contained in:
zweien 2021-07-13 08:06:45 +08:00
parent e4c1a46501
commit 1d5984d9f0
2 changed files with 22 additions and 5 deletions

View File

@ -26,7 +26,7 @@ jobs:
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install flake8 pytest python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pip install -e .
- name: Lint with flake8 - name: Lint with flake8
run: | run: |
# stop the build if there are Python syntax errors or undefined names # 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 flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest - name: Test with pytest
run: | run: |
pytest python examples/simple_poisson/simple_poisson.py

View File

@ -1,7 +1,23 @@
import setuptools 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( setuptools.setup(
name="idrlnet", # Replace with your own username name="idrlnet", # Replace with your own username
@ -18,5 +34,6 @@ setuptools.setup(
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Operating System :: OS Independent", "Operating System :: OS Independent",
], ],
python_requires='>=3.6', python_requires=">=3.6",
install_requires=load_requirements(),
) )