Skip to content

Commit

Permalink
Combine workflow and pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-E-Rose committed Aug 19, 2024
1 parent fdb3169 commit 55a796c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/test-and-build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches: [ master ]

jobs:

test:
runs-on: ubuntu-latest
steps:
Expand All @@ -18,14 +19,14 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
python-version: 3.11
- name: Install package and 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: Verify pubmed_parser installation
run: |
python -c "import pubmed_parser; print(f'pubmed_parser version: {pubmed_parser.__version__}')"
- name: Run tests
run: pytest --cov=pubmed_parser tests/ --verbose
- name: Upload coverage to Codecov
Expand All @@ -42,14 +43,14 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
python-version: 3.11
- name: Install package and dependencies
run: |
pip install -r docs/doc_requirements.txt
- name: Install project dependencies
pip install -U pip
pip install -e .[docs]
- name: Verify pubmed_parser installation
run: |
pip install -r requirements.txt # Install project dependencies
python setup.py install
python -c "import pubmed_parser; print(f'pubmed_parser version: {pubmed_parser.__version__}')"
- name: Build documentation
run: |
cd docs
Expand Down
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
# sys.path.insert(0, os.path.abspath('.'))
import sys
import os
sys.path.insert(0, os.path.abspath('..'))

import pubmed_parser
import sphinx
import sphinx_gallery
import pubmed_parser

# -- Project information -----------------------------------------------------

Expand Down
3 changes: 0 additions & 3 deletions docs/doc_requirements.txt

This file was deleted.

11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ dependencies = [
]
dynamic = ["version"]

[project.optional-dependencies]
tests = [
"pytest",
"pytest-cov"
]
docs = [
"sphinx",
"sphinx_rtd_theme",
"sphinx-gallery"
]

[project.urls]
homepage = "https://github.com/titipata/pubmed_parser"
download = "https://github.com/titipata/pubmed_parser.git"
Expand Down

0 comments on commit 55a796c

Please sign in to comment.