diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1805e2a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: test + +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 2 + strategy: + matrix: + python-version: ["3.11"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + pip install .[dev,test] + - name: Test + run: | + python -m pytest diff --git a/pyproject.toml b/pyproject.toml index 6e381d7..17000ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,12 +16,21 @@ authors = [ license = {file = "LICENSE.md"} requires-python = ">=3.11" # keywords = [] -dependencies = ["pandas"] # classifiers = [ # "Programming Language :: Python :: 3", # "License :: OSI Approved :: MIT License", # "Operating System :: OS Independent", # ] +dependencies = ["pandas"] + +[project.optional-dependencies] +dev = [ + "black >= 22.0.0", + "pre-commit" +] +test = [ + "pytest" +] # [project.urls] # Homepage = "https://github.com/pypa/sampleproject" diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 0000000..ab3a8d0 --- /dev/null +++ b/tests/test_cli.py @@ -0,0 +1,9 @@ +import pytest +import subprocess + + +def test_help(): + output = subprocess.run( + "parkit --help", capture_output=True, shell=True, text=True + ).stdout + assert "ERROR:HPC_DM_UTILS in unset!" in output