Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure workflows #17

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,20 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: ${{ matrix.python-version }}

- 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![MIT License](https://img.shields.io/github/license/harisankar95/pathfinding3d)](LICENSE)
[![PyPI](https://img.shields.io/pypi/v/pathfinding3d)](https://pypi.org/project/pathfinding3d/)
[![Pipeline](https://github.com/harisankar95/pathfinding3D/actions/workflows/test-main.yml/badge.svg?branch=main)](https://github.com/harisankar95/pathfinding3D/actions/workflows/test-main.yml)
[![Pipeline](https://github.com/harisankar95/pathfinding3D/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/harisankar95/pathfinding3D/actions/workflows/run-tests.yml)
[![codecov](https://codecov.io/gh/harisankar95/pathfinding3D/branch/main/graph/badge.svg?token=ZQZQZQZQZQ)](https://codecov.io/gh/harisankar95/pathfinding3D)
[![codestyle](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Documentation](https://img.shields.io/badge/documentation-view-blue)](https://harisankar95.github.io/pathfinding3D/INTRO.html)
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"],
)
Loading