Skip to content
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
46 changes: 43 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ on:
pull_request:
branches: [ main ]

permissions:
contents: read

jobs:
test:
name: Test on Python ${{ matrix.python-version }}
name: Unit Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -30,9 +33,46 @@ jobs:
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run tests
- name: Run unit tests
run: |
pytest -v --ignore=tests/accuracy --ignore=tests/benchmark -x

- name: Run tests with coverage
if: matrix.python-version == '3.12'
run: |
pip install pytest-cov
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pytest-cov package is already added to the dev dependencies at line 38, so the pip install pytest-cov command in the workflow is redundant. The package should already be installed from the pip install -e ".[dev]" step on line 34.

Suggested change
pip install pytest-cov

Copilot uses AI. Check for mistakes.
pytest --cov=numta --cov-report=xml --ignore=tests/accuracy --ignore=tests/benchmark

- name: Upload coverage reports
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow uses codecov/codecov-action@v4 but doesn't provide the required token parameter. While the action has fail_ci_if_error: false and continue-on-error: true to prevent CI failures, codecov uploads typically require a token for private repositories. Consider adding the token via secrets or documenting that this only works for public repositories.

Suggested change
fail_ci_if_error: false
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

Copilot uses AI. Check for mistakes.
continue-on-error: true

benchmark:
name: Benchmark Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run benchmark tests
run: |
pytest -v
pytest tests/benchmark/test_benchmark.py -v

build:
name: Build package
Expand Down
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies = [
dev = [
"pytest>=7.0.0",
"pytest-benchmark>=4.0.0",
"pytest-cov>=4.0.0",
"pandas>=1.3.0",
]
pandas = [
Expand Down Expand Up @@ -79,3 +80,33 @@ testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"numba: marks tests requiring numba",
"pandas: marks tests requiring pandas",
"talib: marks tests requiring TA-Lib",
"pandas_ta: marks tests requiring pandas-ta",
"slow: marks tests as slow",
"benchmark: marks tests as benchmark tests",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]

[tool.coverage.run]
source = ["src/numta"]
branch = true
omit = [
"*/tests/*",
"*/_version.py",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an inconsistency in the regex pattern escaping. The pattern should be "if __name__ == .__main__.:" but in coverage configuration, the dots typically need to be escaped as \\. or the string should be more precisely written as 'if __name__ == "__main__":'. The current pattern with unescaped dots will match any character instead of literal dots.

Suggested change
"if __name__ == .__main__.:",
"if __name__ == \"__main__\":",

Copilot uses AI. Check for mistakes.
]
show_missing = true
Loading
Loading