Skip to content

Commit

Permalink
Requirements restructured, workflows streamlined
Browse files Browse the repository at this point in the history
  • Loading branch information
harisankar95 committed Feb 28, 2024
1 parent 1f16406 commit 5b9169a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 36 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ jobs:
- name: Install dependencies
run: |
pip install -e .[vis]
pip install -e .[vis,doc]
- name: Build docs
run: |
pip install sphinx sphinx_rtd_theme myst-parser sphinx-autodoc-typehints sphinx-copybutton sphinx-prompt sphinx-notfound-page
sphinx-build -b html docs/ ./public
cp -r docs/additional_resources/* ./public/
Expand Down
23 changes: 10 additions & 13 deletions .github/workflows/test-main.yml → .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
name: Test main branch 🧪
name: Test 🧪

on:
push:
branches:
- main
pull_request:
branches:
- main
on: [push, pull_request]

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
# Test on oldest and newest supported Python versions
python-version: ["3.8", "3.12"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
Expand All @@ -20,22 +18,21 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Upgrade pip
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Install dependencies
run: |
pip install numpy pytest coverage pytest-mock
pip install -e .[vis]
pip install -e .[vis,test]
- name: Run tests with pytest
run: coverage run --source pathfinding3d -m pytest

- name: Show basic test coverage report
- name: Generate coverage reports
run: |
coverage report -m
coverage xml
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test-and-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ jobs:
- name: Install dependencies
run: |
pip install numpy pytest coverage pytest-mock
pip install -e .[vis]
pip install -e .[vis,test,doc]
- name: Run tests with pytest
run: coverage run --source pathfinding3d -m pytest

- name: Show basic test coverage report
- name: Generate coverage reports
run: |
coverage report -m
coverage xml
Expand All @@ -46,7 +45,6 @@ jobs:

- name: Build docs
run: |
pip install sphinx sphinx_rtd_theme myst-parser sphinx-autodoc-typehints sphinx-copybutton sphinx-prompt sphinx-notfound-page
sphinx-build -b html docs/ ./public
cp -r docs/additional_resources/* ./public/
Expand Down
38 changes: 21 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@
with open(os.path.join("pathfinding3d", "version.txt"), encoding="utf-8") as file_handler:
__version__ = file_handler.read().strip()

# Test requirements
test_requirements = [
"pytest",
"pytest-cov",
"pytest-mock",
]
# Documentation requirements
doc_requirements = [
"sphinx",
"sphinx_rtd_theme",
"myst-parser",
"sphinx-autodoc-typehints",
"sphinx-copybutton",
"sphinx-prompt",
"sphinx-notfound-page",
]

setup(
name="pathfinding3d",
description="Pathfinding algorithms in 3D grids (based on python-pathfinding)",
Expand All @@ -26,25 +43,12 @@
package_data={"pathfinding3d": ["version.txt"]},
install_requires=["numpy"],
extras_require={
"dev": [
"black",
"pytest",
"pytest-mock",
"coverage",
"sphinx<=7.2.6",
"sphinx_rtd_theme",
"myst-parser",
"sphinx-autodoc-typehints",
"sphinx-copybutton",
"sphinx-prompt",
"sphinx-notfound-page",
],
"vis": ["plotly"],
"dev": ["black"] + test_requirements + doc_requirements,
"test": test_requirements,
"doc": doc_requirements,
},
tests_require=[
"pytest",
"coverage",
],
tests_require=test_requirements,
python_requires=">=3.8",
platforms=["any"],
)

0 comments on commit 5b9169a

Please sign in to comment.