mirror of
https://github.com/wilsonfreitas/awesome-quant.git
synced 2026-11-02 12:26:33 +00:00
feat: support curated historical projects
This commit is contained in:
@@ -89,6 +89,9 @@ Rules:
|
||||
marketing repository as repository-less for every eligibility check.
|
||||
- Backtick tags are optional only for commercial services and other metadata-free
|
||||
sections such as `Related Lists`.
|
||||
- `Historical & Archived Projects` is the documented exception to normal activity and
|
||||
archive-state requirements. Entries still require substantive, reachable, documented source
|
||||
and the `Historical` tag; use `CONTRIBUTING.md` for eligibility.
|
||||
- Use `CONTRIBUTING.md` as the user-facing source for contribution rules.
|
||||
|
||||
## PR Review Workflow
|
||||
|
||||
+12
-4
@@ -75,9 +75,15 @@ Link to the PyPI package page. If the project has a GitHub repo, append it after
|
||||
|
||||
## Quality Requirements
|
||||
|
||||
- **Source-backed projects**: Projects backed by substantive source must show recent
|
||||
repository activity (commits within the last 12 months) and provide a clear README with
|
||||
usage examples.
|
||||
- **Active source-backed projects**: Projects backed by substantive source in the active
|
||||
categories must show recent repository activity (commits within the last 12 months) and
|
||||
provide a clear README with usage examples.
|
||||
- **Historical & Archived Projects**: This category is the narrow exception to the active
|
||||
activity and archive-state requirements. An entry must use `Historical` plus a language or
|
||||
runtime tag, link to reachable substantive source or documentation, state a specific
|
||||
historical, educational, or foundational reason to retain the project, and clearly disclose
|
||||
that it is archived or unmaintained. It is not for thin wrappers, tutorials, generated data,
|
||||
marketing material, unsupported SDKs, or duplicate implementations.
|
||||
- **Repository-less commercial services**: See the permanent-free-tier, public-documentation,
|
||||
and transparency rules in the commercial section below.
|
||||
|
||||
@@ -128,6 +134,7 @@ The README is organized by **category** (not by language). Add your entry under
|
||||
- Cross-Language Frameworks
|
||||
- Reproducing Works, Training & Books
|
||||
- Commercial & Proprietary Services
|
||||
- Historical & Archived Projects
|
||||
- Related Lists
|
||||
|
||||
For example, if your project is a Python backtesting library, it goes under `## Trading & Backtesting` (not under Technical Indicators or another category).
|
||||
@@ -183,5 +190,6 @@ PRs will be closed if:
|
||||
- Multiple unrelated projects added in a single PR without a clear grouping rationale.
|
||||
- Entry format does not match the required pattern.
|
||||
- Duplicate of an existing entry or a recently closed PR.
|
||||
- Project is archived or abandoned.
|
||||
- Project is archived or abandoned, unless it meets the documented
|
||||
**Historical & Archived Projects** eligibility criteria.
|
||||
- Empty PR description.
|
||||
|
||||
+21
-2
@@ -27,6 +27,8 @@ if str(ROOT) not in sys.path:
|
||||
from scripts.readme_entries import (
|
||||
ENTRY_RE,
|
||||
GITHUB_LINK_RE,
|
||||
HISTORICAL_SECTION,
|
||||
HISTORICAL_TAG,
|
||||
MARKDOWN_URL_RE,
|
||||
VALID_SECTIONS,
|
||||
extract_languages,
|
||||
@@ -531,6 +533,7 @@ def review_entry(
|
||||
url = match.group(2).strip()
|
||||
tail = match.group(3).strip()
|
||||
tags, clean_description = extract_languages(tail)
|
||||
is_historical = section == HISTORICAL_SECTION
|
||||
|
||||
if section not in VALID_SECTIONS:
|
||||
findings.append(
|
||||
@@ -540,6 +543,22 @@ def review_entry(
|
||||
if section not in NO_TAG_SECTIONS and not tags:
|
||||
findings.append(Finding("tags", "missing required backtick tag prefix"))
|
||||
|
||||
if is_historical and HISTORICAL_TAG not in tags:
|
||||
findings.append(
|
||||
Finding(
|
||||
"historical-tag",
|
||||
"Historical & Archived Projects entries must include the `Historical` tag",
|
||||
)
|
||||
)
|
||||
|
||||
if is_historical and not any(tag != HISTORICAL_TAG for tag in tags):
|
||||
findings.append(
|
||||
Finding(
|
||||
"tags",
|
||||
"Historical & Archived Projects entries require a language or runtime tag",
|
||||
)
|
||||
)
|
||||
|
||||
github_label_count = clean_description.count("[GitHub](")
|
||||
github_marker = clean_description.rfind("[GitHub](")
|
||||
github_suffix = (
|
||||
@@ -602,10 +621,10 @@ def review_entry(
|
||||
else:
|
||||
owner, repo_name = repository_parts
|
||||
github_repo = client.get_repo(f"{owner}/{repo_name}")
|
||||
if github_repo.archived:
|
||||
if github_repo.archived and not is_historical:
|
||||
findings.append(Finding("activity", "repository is archived"))
|
||||
pushed_at = github_repo.pushed_at
|
||||
if (
|
||||
if not is_historical and (
|
||||
pushed_at is None
|
||||
or pushed_at < current_time - timedelta(days=365)
|
||||
):
|
||||
|
||||
@@ -1040,6 +1040,40 @@ class ValidationPipelineTests(unittest.TestCase):
|
||||
self.review(configure_project=make_stale),
|
||||
)
|
||||
|
||||
def test_accepts_archived_stale_historical_repository(self):
|
||||
def make_historical(repository):
|
||||
repository.archived = True
|
||||
repository.pushed_at = NOW - timedelta(days=366)
|
||||
|
||||
patch_text = VALID_PATCH.replace(
|
||||
"Trading & Backtesting",
|
||||
"Historical & Archived Projects",
|
||||
).replace(
|
||||
"`Python` - Fresh project.",
|
||||
"`Python` `Historical` - Archived reference retained for its early design.",
|
||||
)
|
||||
|
||||
self.assertNotIn(
|
||||
"activity",
|
||||
self.review(patch_text=patch_text, configure_project=make_historical),
|
||||
)
|
||||
|
||||
def test_requires_historical_tag_for_historical_repository(self):
|
||||
patch_text = VALID_PATCH.replace(
|
||||
"Trading & Backtesting",
|
||||
"Historical & Archived Projects",
|
||||
)
|
||||
|
||||
self.assertIn("historical-tag", self.review(patch_text=patch_text))
|
||||
|
||||
def test_requires_non_status_tag_for_historical_repository(self):
|
||||
patch_text = VALID_PATCH.replace(
|
||||
"Trading & Backtesting",
|
||||
"Historical & Archived Projects",
|
||||
).replace("`Python` - Fresh project.", "`Historical` - Historical project.")
|
||||
|
||||
self.assertIn("tags", self.review(patch_text=patch_text))
|
||||
|
||||
def test_rejects_repository_without_readme(self):
|
||||
def remove_readme(repository):
|
||||
repository.has_root_readme = False
|
||||
|
||||
Reference in New Issue
Block a user