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
80 changes: 80 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Bug report
description: Report reproducible incorrect behavior in ecosystem policy or tooling
title: "[Bug]: "
labels:
- "type: bug"
- "priority: normal"
- "status: needs-triage"
- "compatibility: affected"
body:
- type: markdown
attributes:
value: |
Search existing issues first. Do not disclose suspected vulnerabilities here.
- type: dropdown
id: library
attributes:
label: Affected library
options:
- data
- engineer
- backtest
- specs
- live
- diagnostic
- models
- ecosystem
validations:
required: true
- type: input
id: version
attributes:
label: Affected package version
placeholder: "0.1.0"
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: Include Python version, operating system, installation method, and relevant extras.
validations:
required: true
- type: textarea
id: observed
attributes:
label: Observed behavior
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Minimal reproduction
description: Provide the smallest complete example and error output.
validations:
required: true
- type: dropdown
id: compatibility
attributes:
label: Compatibility impact
options:
- Public behavior or results
- Python or operating-system support
- Cross-library contract
- Installation or dependency resolution
- No known compatibility impact
validations:
required: true
- type: textarea
id: acceptance
attributes:
label: Acceptance criteria
description: State the observable conditions that demonstrate the issue is resolved.
validations:
required: true
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Security vulnerability
url: https://github.com/ml4t/models/security/advisories/new
about: Report suspected vulnerabilities privately.
- name: Usage questions
url: https://github.com/orgs/ml4t/discussions
about: Ask questions that do not describe a defect or requested change.
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Documentation problem
description: Report missing, incorrect, or difficult documentation
title: "[Docs]: "
labels:
- "type: documentation"
- "priority: normal"
- "status: needs-triage"
- "compatibility: none"
body:
- type: dropdown
id: library
attributes:
label: Affected library
options:
- data
- engineer
- backtest
- specs
- live
- diagnostic
- models
- ecosystem
validations:
required: true
- type: input
id: version
attributes:
label: Package or documentation version
validations:
required: true
- type: input
id: location
attributes:
label: Page or API location
validations:
required: true
- type: textarea
id: problem
attributes:
label: Problem
description: State what is missing, incorrect, or difficult to follow.
validations:
required: true
- type: textarea
id: expected
attributes:
label: Required documentation outcome
validations:
required: true
- type: textarea
id: acceptance
attributes:
label: Acceptance criteria
validations:
required: true
66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Feature request
description: Request a concrete new or expanded capability
title: "[Feature]: "
labels:
- "type: feature"
- "priority: normal"
- "status: needs-triage"
- "compatibility: affected"
body:
- type: dropdown
id: library
attributes:
label: Owning library
options:
- data
- engineer
- backtest
- specs
- live
- diagnostic
- models
- ecosystem
validations:
required: true
- type: input
id: version
attributes:
label: Current package version
validations:
required: true
- type: textarea
id: problem
attributes:
label: User problem
description: Describe the workflow that cannot be completed or is unnecessarily difficult.
validations:
required: true
- type: textarea
id: outcome
attributes:
label: Required outcome
description: State observable behavior without prescribing an implementation.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Existing alternatives
description: Describe workarounds or related APIs already considered.
- type: dropdown
id: compatibility
attributes:
label: Compatibility impact
options:
- Existing API extension
- New cross-library contract
- Potentially incompatible behavior
- No known compatibility impact
validations:
required: true
- type: textarea
id: acceptance
attributes:
label: Acceptance criteria
validations:
required: true
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Owning issue

Closes #

## Outcome

Describe the user-visible or standards outcome.

## Compatibility

- [ ] No public compatibility impact
- [ ] Compatibility impact is documented in the owning issue and migration guidance

## Verification

- [ ] Tests reproduce the prior failure or verify the requested behavior
- [ ] Ruff lint and format checks pass
- [ ] `ty` passes
- [ ] Test suite passes
- [ ] Package build passes when applicable
- [ ] Strict MkDocs build passes when documentation is affected
- [ ] Ecosystem qualification passes

## Documentation and release

State the documentation, release notes, and patch-release work required after merge.
25 changes: 25 additions & 0 deletions .github/workflows/ecosystem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Ecosystem qualification

on:
pull_request:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ecosystem-qualification-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
qualification:
permissions:
contents: read
uses: ml4t/ecosystem/.github/workflows/qualify-library.yml@457678d8860d0c816b1dc376e7e2691daa93af4d # v0.1.0
with:
import-package: ml4t.models
prerelease-test-paths: >-
["tests/test_configs.py", "tests/test_forecasters.py", "tests/test_integration_data.py",
"tests/test_pca_pipeline.py", "tests/test_rp_pca.py", "tests/test_types.py"]
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ concurrency:
cancel-in-progress: false

jobs:
ecosystem-qualification:
name: Ecosystem Qualification
permissions:
contents: read
uses: ml4t/ecosystem/.github/workflows/qualify-library.yml@457678d8860d0c816b1dc376e7e2691daa93af4d # v0.1.0
with:
import-package: ml4t.models

select-candidate:
name: Select Qualified Candidate
runs-on: ubuntu-latest
Expand Down Expand Up @@ -170,7 +178,7 @@ jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [select-candidate, docs]
needs: [ecosystem-qualification, select-candidate, docs]
environment: pypi
permissions:
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
site_name: ML4T Models
site_description: Finance-native model implementations for latent factors and portfolio learning
site_url: https://ml4trading.io/docs/models/
site_url: https://www.ml4trading.io/docs/models/
repo_url: https://github.com/ml4t/models
repo_name: ml4t/models

Expand Down
13 changes: 8 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dependencies = [

[project.optional-dependencies]
deep = [
"torch>=2.13.0",
"torch>=2.13.0; python_version < '3.15'",
]
integration = [
"polars>=1.0.0",
Expand All @@ -83,7 +83,7 @@ dev = [
"ruff>=0.8.0",
"ty>=0.0.32",
"pre-commit>=3.3.0",
"torch>=2.13.0",
"torch>=2.13.0; python_version < '3.15'",
]
docs = [
"mkdocs>=1.6,<2",
Expand All @@ -96,21 +96,24 @@ all = [

[project.urls]
Homepage = "https://ml4trading.io/docs/models/"
Documentation = "https://ml4trading.io/docs/models/"
Documentation = "https://www.ml4trading.io/docs/models/"
Repository = "https://github.com/ml4t/models"
Issues = "https://github.com/ml4t/models/issues"
Changelog = "https://github.com/ml4t/models/blob/main/CHANGELOG.md"

[dependency-groups]
dev = [
test = [
"ml4t-specs>=0.1.0b0",
"polars>=1.0.0",
"pytest>=9.0.3",
"pytest-cov>=5.0.0",
"torch>=2.13.0; python_version < '3.15'",
]
dev = [
{ include-group = "test" },
"ruff>=0.8.0",
"ty>=0.0.32",
"pre-commit>=3.3.0",
"torch>=2.13.0",
"twine>=6.0.0",
]

Expand Down
29 changes: 28 additions & 1 deletion tests/test_repo_hygiene.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import re
import subprocess
import tomllib
from pathlib import Path

import ml4t.models as models
Expand Down Expand Up @@ -96,6 +97,32 @@ def test_ci_qualifies_one_candidate_across_required_platforms() -> None:
assert 'test "$CUDA_RESULT" = skipped' in workflow


def test_python_315_qualifies_the_published_core_without_torch() -> None:
root = Path(__file__).parents[1]
project = tomllib.loads((root / "pyproject.toml").read_text(encoding="utf-8"))
workflow = (root / ".github/workflows/ecosystem.yml").read_text(encoding="utf-8")

assert not any(
"torch" in requirement and "python_version >= '3.15'" in requirement
for requirement in project["dependency-groups"]["test"]
)
assert not any(
"torch" in requirement and "python_version >= '3.15'" in requirement
for requirement in project["project"]["optional-dependencies"]["deep"]
)
assert "pytorch-nightly" not in (root / "pyproject.toml").read_text(encoding="utf-8")
assert "prerelease-test-paths:" in workflow
for test_name in (
"test_configs.py",
"test_forecasters.py",
"test_integration_data.py",
"test_pca_pipeline.py",
"test_rp_pca.py",
"test_types.py",
):
assert test_name in workflow


def test_release_promotes_qualified_candidate_without_rebuilding() -> None:
root = Path(__file__).parents[1]
workflow = (root / ".github/workflows/release.yml").read_text(encoding="utf-8")
Expand All @@ -109,7 +136,7 @@ def test_release_promotes_qualified_candidate_without_rebuilding() -> None:
assert "DOCS_DEPLOY_KEY is required for a stable release" in workflow
assert "scripts/ci/verify_docs_deployment.py" in workflow
assert "https://ml4trading.io/docs/models/release.json" in verifier
assert "needs: [select-candidate, docs]" in workflow
assert "needs: [ecosystem-qualification, select-candidate, docs]" in workflow
assert '--repo "${{ github.repository }}"' in workflow


Expand Down
Loading