From d7a0079213828d8d6dc9bb98e17c075a150c7058 Mon Sep 17 00:00:00 2001 From: "Michael E. Rose" Date: Sun, 18 Aug 2024 14:36:52 +0200 Subject: [PATCH] Combine workflow and pyproject.toml --- .github/workflows/test-and-build-docs.yml | 17 ++++++----------- docs/doc_requirements.txt | 3 --- pyproject.toml | 11 +++++++++++ 3 files changed, 17 insertions(+), 14 deletions(-) delete mode 100644 docs/doc_requirements.txt diff --git a/.github/workflows/test-and-build-docs.yml b/.github/workflows/test-and-build-docs.yml index 26ca4c7..b713695 100644 --- a/.github/workflows/test-and-build-docs.yml +++ b/.github/workflows/test-and-build-docs.yml @@ -7,6 +7,7 @@ on: branches: [ master ] jobs: + test: runs-on: ubuntu-latest steps: @@ -18,14 +19,11 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.11 - name: Install dependencies run: | - python --version pip install -U pip - pip install -r requirements.txt # Install project dependencies - pip install pytest pytest-cov # Install pytest and coverage plugin - python setup.py install + pip install .[tests] - name: Run tests run: pytest --cov=pubmed_parser tests/ --verbose - name: Upload coverage to Codecov @@ -42,14 +40,11 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.11 - name: Install dependencies run: | - pip install -r docs/doc_requirements.txt - - name: Install project dependencies - run: | - pip install -r requirements.txt # Install project dependencies - python setup.py install + pip install -U pip + pip install -e .[docs] - name: Build documentation run: | cd docs diff --git a/docs/doc_requirements.txt b/docs/doc_requirements.txt deleted file mode 100644 index 74d8a78..0000000 --- a/docs/doc_requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -sphinx_rtd_theme -sphinx -sphinx-gallery \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 1ff4d63..6b675c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,17 @@ dependencies = [ ] dynamic = ["version"] +[project.optional-dependencies] +tests = [ + "pytest", + "pytest-cov" +] +docs = [ + "sphinx_rtd_theme", + "sphinx", + "sphinx-gallery" +] + [project.urls] homepage = "https://github.com/titipata/pubmed_parser" download = "https://github.com/titipata/pubmed_parser.git"