llmsbrieftxt 1.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of llmsbrieftxt might be problematic. Click here for more details.
- llmsbrieftxt-1.3.1/.github/ISSUE_TEMPLATE/bug_report.yml +104 -0
- llmsbrieftxt-1.3.1/.github/ISSUE_TEMPLATE/config.yml +8 -0
- llmsbrieftxt-1.3.1/.github/ISSUE_TEMPLATE/feature_request.yml +87 -0
- llmsbrieftxt-1.3.1/.github/ISSUE_TEMPLATE/question.yml +63 -0
- llmsbrieftxt-1.3.1/.github/PULL_REQUEST_TEMPLATE.md +44 -0
- llmsbrieftxt-1.3.1/.github/pull_request_template.md +63 -0
- llmsbrieftxt-1.3.1/.github/workflows/ci.yml +40 -0
- llmsbrieftxt-1.3.1/.github/workflows/pr-title-check.yml +48 -0
- llmsbrieftxt-1.3.1/.github/workflows/release.yml +111 -0
- llmsbrieftxt-1.3.1/.gitignore +14 -0
- llmsbrieftxt-1.3.1/CLAUDE.md +332 -0
- llmsbrieftxt-1.3.1/CONTRIBUTING.md +264 -0
- llmsbrieftxt-1.3.1/LICENSE +21 -0
- llmsbrieftxt-1.3.1/PKG-INFO +351 -0
- llmsbrieftxt-1.3.1/PRODUCTION_CLEANUP_PLAN.md +339 -0
- llmsbrieftxt-1.3.1/README.md +318 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/__init__.py +1 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/cli.py +171 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/constants.py +36 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/crawler.py +358 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/doc_loader.py +150 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/extractor.py +69 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/main.py +142 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/schema.py +42 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/summarizer.py +276 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/url_filters.py +75 -0
- llmsbrieftxt-1.3.1/llmsbrieftxt/url_utils.py +73 -0
- llmsbrieftxt-1.3.1/pyproject.toml +103 -0
- llmsbrieftxt-1.3.1/pytest.ini +17 -0
- llmsbrieftxt-1.3.1/scripts/bump_version.py +187 -0
- llmsbrieftxt-1.3.1/tests/__init__.py +1 -0
- llmsbrieftxt-1.3.1/tests/conftest.py +46 -0
- llmsbrieftxt-1.3.1/tests/fixtures/__init__.py +1 -0
- llmsbrieftxt-1.3.1/tests/integration/__init__.py +1 -0
- llmsbrieftxt-1.3.1/tests/integration/test_doc_loader_integration.py +181 -0
- llmsbrieftxt-1.3.1/tests/unit/__init__.py +1 -0
- llmsbrieftxt-1.3.1/tests/unit/test_cli.py +156 -0
- llmsbrieftxt-1.3.1/tests/unit/test_doc_loader.py +120 -0
- llmsbrieftxt-1.3.1/tests/unit/test_extractor.py +70 -0
- llmsbrieftxt-1.3.1/tests/unit/test_robustness.py +84 -0
- llmsbrieftxt-1.3.1/tests/unit/test_summarizer.py +185 -0
- llmsbrieftxt-1.3.1/uv.lock +1136 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug or unexpected behavior
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug", "triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for taking the time to report a bug! Please fill out the information below to help us resolve the issue.
|
|
10
|
+
|
|
11
|
+
- type: textarea
|
|
12
|
+
id: description
|
|
13
|
+
attributes:
|
|
14
|
+
label: Bug Description
|
|
15
|
+
description: A clear and concise description of what the bug is.
|
|
16
|
+
placeholder: When I run llmtxt with..., I expect..., but instead...
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: reproduction
|
|
22
|
+
attributes:
|
|
23
|
+
label: Steps to Reproduce
|
|
24
|
+
description: Steps to reproduce the behavior
|
|
25
|
+
placeholder: |
|
|
26
|
+
1. Run command: llmtxt https://example.com
|
|
27
|
+
2. Observe error...
|
|
28
|
+
3. ...
|
|
29
|
+
validations:
|
|
30
|
+
required: true
|
|
31
|
+
|
|
32
|
+
- type: textarea
|
|
33
|
+
id: expected
|
|
34
|
+
attributes:
|
|
35
|
+
label: Expected Behavior
|
|
36
|
+
description: What you expected to happen
|
|
37
|
+
placeholder: I expected the tool to...
|
|
38
|
+
validations:
|
|
39
|
+
required: true
|
|
40
|
+
|
|
41
|
+
- type: textarea
|
|
42
|
+
id: actual
|
|
43
|
+
attributes:
|
|
44
|
+
label: Actual Behavior
|
|
45
|
+
description: What actually happened
|
|
46
|
+
placeholder: Instead, the tool...
|
|
47
|
+
validations:
|
|
48
|
+
required: true
|
|
49
|
+
|
|
50
|
+
- type: textarea
|
|
51
|
+
id: logs
|
|
52
|
+
attributes:
|
|
53
|
+
label: Error Logs / Output
|
|
54
|
+
description: Please paste any relevant error messages or output
|
|
55
|
+
render: shell
|
|
56
|
+
placeholder: |
|
|
57
|
+
Paste error output here...
|
|
58
|
+
|
|
59
|
+
- type: input
|
|
60
|
+
id: version
|
|
61
|
+
attributes:
|
|
62
|
+
label: llmsbrieftxt Version
|
|
63
|
+
description: Run `pip show llmsbrieftxt` to get the version
|
|
64
|
+
placeholder: "1.0.0"
|
|
65
|
+
validations:
|
|
66
|
+
required: true
|
|
67
|
+
|
|
68
|
+
- type: input
|
|
69
|
+
id: python-version
|
|
70
|
+
attributes:
|
|
71
|
+
label: Python Version
|
|
72
|
+
description: Run `python --version` to get your Python version
|
|
73
|
+
placeholder: "3.11.0"
|
|
74
|
+
validations:
|
|
75
|
+
required: true
|
|
76
|
+
|
|
77
|
+
- type: input
|
|
78
|
+
id: os
|
|
79
|
+
attributes:
|
|
80
|
+
label: Operating System
|
|
81
|
+
description: Which OS are you using?
|
|
82
|
+
placeholder: "macOS 14.0, Ubuntu 22.04, Windows 11, etc."
|
|
83
|
+
validations:
|
|
84
|
+
required: true
|
|
85
|
+
|
|
86
|
+
- type: textarea
|
|
87
|
+
id: context
|
|
88
|
+
attributes:
|
|
89
|
+
label: Additional Context
|
|
90
|
+
description: Any other context, screenshots, or information that might be helpful
|
|
91
|
+
placeholder: Add any other context about the problem here
|
|
92
|
+
|
|
93
|
+
- type: checkboxes
|
|
94
|
+
id: checks
|
|
95
|
+
attributes:
|
|
96
|
+
label: Pre-submission Checklist
|
|
97
|
+
description: Please confirm the following before submitting
|
|
98
|
+
options:
|
|
99
|
+
- label: I have searched existing issues to ensure this is not a duplicate
|
|
100
|
+
required: true
|
|
101
|
+
- label: I have tested with the latest version of llmsbrieftxt
|
|
102
|
+
required: true
|
|
103
|
+
- label: I have included complete error messages and logs
|
|
104
|
+
required: true
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: 💬 GitHub Discussions
|
|
4
|
+
url: https://github.com/stevennevins/llmsbrief/discussions
|
|
5
|
+
about: Ask questions and discuss ideas with the community
|
|
6
|
+
- name: 📚 Documentation
|
|
7
|
+
url: https://github.com/stevennevins/llmsbrief#readme
|
|
8
|
+
about: Read the documentation and guides
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest a new feature or enhancement
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["enhancement", "triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for suggesting a new feature! Please provide as much detail as possible to help us understand your request.
|
|
10
|
+
|
|
11
|
+
**Note:** llmsbrieftxt follows the Unix philosophy of doing one thing well. Features should align with the core mission: generating llms-brief.txt files from documentation websites.
|
|
12
|
+
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: problem
|
|
15
|
+
attributes:
|
|
16
|
+
label: Problem or Use Case
|
|
17
|
+
description: What problem does this feature solve? What use case does it enable?
|
|
18
|
+
placeholder: |
|
|
19
|
+
I want to be able to... because...
|
|
20
|
+
Currently, I can't... which means...
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: solution
|
|
26
|
+
attributes:
|
|
27
|
+
label: Proposed Solution
|
|
28
|
+
description: How would you like this feature to work?
|
|
29
|
+
placeholder: |
|
|
30
|
+
Add a new option `--example` that would...
|
|
31
|
+
The behavior should be...
|
|
32
|
+
validations:
|
|
33
|
+
required: true
|
|
34
|
+
|
|
35
|
+
- type: textarea
|
|
36
|
+
id: alternatives
|
|
37
|
+
attributes:
|
|
38
|
+
label: Alternatives Considered
|
|
39
|
+
description: What alternatives have you considered? Are there workarounds?
|
|
40
|
+
placeholder: |
|
|
41
|
+
I considered using X, but...
|
|
42
|
+
As a workaround, I currently...
|
|
43
|
+
|
|
44
|
+
- type: textarea
|
|
45
|
+
id: examples
|
|
46
|
+
attributes:
|
|
47
|
+
label: Usage Examples
|
|
48
|
+
description: Provide examples of how this feature would be used
|
|
49
|
+
render: bash
|
|
50
|
+
placeholder: |
|
|
51
|
+
# Example usage
|
|
52
|
+
llmtxt https://example.com --new-option value
|
|
53
|
+
|
|
54
|
+
- type: dropdown
|
|
55
|
+
id: alignment
|
|
56
|
+
attributes:
|
|
57
|
+
label: Alignment with Project Philosophy
|
|
58
|
+
description: Does this feature align with the Unix philosophy of doing one thing well?
|
|
59
|
+
options:
|
|
60
|
+
- "Yes - Directly enhances llms-brief.txt generation"
|
|
61
|
+
- "Maybe - Could be considered a core feature"
|
|
62
|
+
- "No - This is a complementary tool/feature"
|
|
63
|
+
validations:
|
|
64
|
+
required: true
|
|
65
|
+
|
|
66
|
+
- type: textarea
|
|
67
|
+
id: impact
|
|
68
|
+
attributes:
|
|
69
|
+
label: Impact
|
|
70
|
+
description: |
|
|
71
|
+
Who benefits from this feature? How critical is it?
|
|
72
|
+
placeholder: |
|
|
73
|
+
This would benefit users who...
|
|
74
|
+
Impact: High/Medium/Low
|
|
75
|
+
|
|
76
|
+
- type: checkboxes
|
|
77
|
+
id: checks
|
|
78
|
+
attributes:
|
|
79
|
+
label: Pre-submission Checklist
|
|
80
|
+
description: Please confirm the following before submitting
|
|
81
|
+
options:
|
|
82
|
+
- label: I have searched existing issues and discussions to ensure this hasn't been requested
|
|
83
|
+
required: true
|
|
84
|
+
- label: I have considered whether this aligns with the project's Unix philosophy
|
|
85
|
+
required: true
|
|
86
|
+
- label: I have provided a clear use case and motivation
|
|
87
|
+
required: true
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Question or Support
|
|
2
|
+
description: Ask a question or get help using llmsbrieftxt
|
|
3
|
+
title: "[Question]: "
|
|
4
|
+
labels: ["question", "support"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Have a question about using llmsbrieftxt? We're here to help!
|
|
10
|
+
|
|
11
|
+
**Tip:** For general discussions and community help, consider using [GitHub Discussions](https://github.com/stevennevins/llmsbrief/discussions) instead.
|
|
12
|
+
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: question
|
|
15
|
+
attributes:
|
|
16
|
+
label: Question
|
|
17
|
+
description: What would you like to know?
|
|
18
|
+
placeholder: How do I...? What is the best way to...?
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
21
|
+
|
|
22
|
+
- type: textarea
|
|
23
|
+
id: context
|
|
24
|
+
attributes:
|
|
25
|
+
label: Context
|
|
26
|
+
description: Provide any relevant context about what you're trying to accomplish
|
|
27
|
+
placeholder: |
|
|
28
|
+
I'm trying to...
|
|
29
|
+
My use case is...
|
|
30
|
+
|
|
31
|
+
- type: textarea
|
|
32
|
+
id: attempted
|
|
33
|
+
attributes:
|
|
34
|
+
label: What Have You Tried?
|
|
35
|
+
description: What have you already attempted? Include commands, configurations, etc.
|
|
36
|
+
render: bash
|
|
37
|
+
placeholder: |
|
|
38
|
+
I tried running:
|
|
39
|
+
llmtxt https://example.com --option value
|
|
40
|
+
|
|
41
|
+
But I'm not sure if...
|
|
42
|
+
|
|
43
|
+
- type: textarea
|
|
44
|
+
id: documentation
|
|
45
|
+
attributes:
|
|
46
|
+
label: Documentation Consulted
|
|
47
|
+
description: Which documentation have you already checked?
|
|
48
|
+
placeholder: |
|
|
49
|
+
- [ ] README.md
|
|
50
|
+
- [ ] CLAUDE.md
|
|
51
|
+
- [ ] CONTRIBUTING.md
|
|
52
|
+
- [ ] Searched existing issues
|
|
53
|
+
|
|
54
|
+
- type: checkboxes
|
|
55
|
+
id: checks
|
|
56
|
+
attributes:
|
|
57
|
+
label: Pre-submission Checklist
|
|
58
|
+
description: Please confirm the following
|
|
59
|
+
options:
|
|
60
|
+
- label: I have checked the README and documentation
|
|
61
|
+
required: true
|
|
62
|
+
- label: I have searched existing issues and discussions
|
|
63
|
+
required: true
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
<!-- Describe your changes in detail -->
|
|
3
|
+
|
|
4
|
+
## Type of Change
|
|
5
|
+
<!-- Check the one that applies -->
|
|
6
|
+
- [ ] `feat`: New feature (minor version bump)
|
|
7
|
+
- [ ] `fix`: Bug fix (patch version bump)
|
|
8
|
+
- [ ] `docs`: Documentation only changes
|
|
9
|
+
- [ ] `style`: Code style changes (formatting, etc.)
|
|
10
|
+
- [ ] `refactor`: Code refactoring (no functional changes)
|
|
11
|
+
- [ ] `perf`: Performance improvements
|
|
12
|
+
- [ ] `test`: Adding or updating tests
|
|
13
|
+
- [ ] `build`: Changes to build system or dependencies
|
|
14
|
+
- [ ] `ci`: Changes to CI/CD configuration
|
|
15
|
+
- [ ] `chore`: Other changes that don't modify src or test files
|
|
16
|
+
|
|
17
|
+
## Breaking Changes
|
|
18
|
+
<!-- If this introduces breaking changes, check the box and describe them -->
|
|
19
|
+
- [ ] This is a breaking change (major version bump)
|
|
20
|
+
|
|
21
|
+
## Checklist
|
|
22
|
+
- [ ] PR title follows [Conventional Commits](https://www.conventionalcommits.org/) format (e.g., `feat: add new feature` or `fix: resolve bug`)
|
|
23
|
+
- [ ] Tests pass locally (`uv run pytest`)
|
|
24
|
+
- [ ] Code is formatted (`uv run black . && uv run isort .`)
|
|
25
|
+
- [ ] Type checking passes (`uv run mypy llmsbrieftxt/`)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
### PR Title Format
|
|
30
|
+
Your PR title **must** follow this format:
|
|
31
|
+
```
|
|
32
|
+
<type>: <description>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Examples:**
|
|
36
|
+
- `feat: add support for custom output formats`
|
|
37
|
+
- `fix: resolve crash when crawling large sites`
|
|
38
|
+
- `docs: update installation instructions`
|
|
39
|
+
- `feat!: redesign API (breaking change)`
|
|
40
|
+
|
|
41
|
+
**Note:** The PR title determines the version bump:
|
|
42
|
+
- `feat:` → minor version bump (1.0.0 → 1.1.0)
|
|
43
|
+
- `fix:` → patch version bump (1.0.0 → 1.0.1)
|
|
44
|
+
- `feat!:` or `BREAKING CHANGE:` → major version bump (1.0.0 → 2.0.0)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- Provide a brief description of the changes in this PR -->
|
|
4
|
+
|
|
5
|
+
## Motivation
|
|
6
|
+
|
|
7
|
+
<!-- Why is this change needed? What problem does it solve? -->
|
|
8
|
+
|
|
9
|
+
## Type of Change
|
|
10
|
+
|
|
11
|
+
<!-- Mark the relevant option with an 'x' -->
|
|
12
|
+
|
|
13
|
+
- [ ] `feat:` New feature (minor version bump)
|
|
14
|
+
- [ ] `fix:` Bug fix (patch version bump)
|
|
15
|
+
- [ ] `docs:` Documentation only changes
|
|
16
|
+
- [ ] `style:` Code style changes (formatting, whitespace, etc.)
|
|
17
|
+
- [ ] `refactor:` Code refactoring (no functional changes)
|
|
18
|
+
- [ ] `perf:` Performance improvements
|
|
19
|
+
- [ ] `test:` Adding or updating tests
|
|
20
|
+
- [ ] `chore:` Maintenance tasks, dependency updates
|
|
21
|
+
- [ ] `ci:` CI/CD pipeline changes
|
|
22
|
+
- [ ] `BREAKING CHANGE` (requires `!` in PR title or `BREAKING CHANGE:` in description)
|
|
23
|
+
|
|
24
|
+
## Testing
|
|
25
|
+
|
|
26
|
+
<!-- Describe how you tested these changes -->
|
|
27
|
+
|
|
28
|
+
- [ ] Unit tests added/updated
|
|
29
|
+
- [ ] Integration tests added/updated (if applicable)
|
|
30
|
+
- [ ] All existing tests pass (`uv run pytest`)
|
|
31
|
+
- [ ] Manual testing performed (describe below)
|
|
32
|
+
|
|
33
|
+
**Manual Testing:**
|
|
34
|
+
<!-- Describe any manual testing you performed -->
|
|
35
|
+
|
|
36
|
+
## Code Quality Checklist
|
|
37
|
+
|
|
38
|
+
<!-- Confirm all checks pass before requesting review -->
|
|
39
|
+
|
|
40
|
+
- [ ] Code linted successfully (`uv run ruff check llmsbrieftxt/ tests/`)
|
|
41
|
+
- [ ] Code formatted successfully (`uv run ruff format llmsbrieftxt/ tests/`)
|
|
42
|
+
- [ ] Type checking passes (`uv run mypy llmsbrieftxt/`)
|
|
43
|
+
- [ ] All tests pass (`uv run pytest`)
|
|
44
|
+
- [ ] PR title follows [Conventional Commits](https://www.conventionalcommits.org/) format
|
|
45
|
+
- [ ] Commit messages follow Conventional Commits format
|
|
46
|
+
|
|
47
|
+
## Additional Context
|
|
48
|
+
|
|
49
|
+
<!-- Add any other context, screenshots, or information about the PR here -->
|
|
50
|
+
|
|
51
|
+
## Related Issues
|
|
52
|
+
|
|
53
|
+
<!-- Link any related issues using GitHub keywords: Fixes #123, Closes #456, Relates to #789 -->
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
<!--
|
|
58
|
+
PR Title Format:
|
|
59
|
+
- feat: add support for custom user agents
|
|
60
|
+
- fix: resolve URL normalization edge case
|
|
61
|
+
- docs: improve installation instructions
|
|
62
|
+
- feat!: change default output location (breaking change)
|
|
63
|
+
-->
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.12"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v5
|
|
21
|
+
with:
|
|
22
|
+
version: "latest"
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: |
|
|
26
|
+
uv python install ${{ matrix.python-version }}
|
|
27
|
+
uv sync --group dev
|
|
28
|
+
|
|
29
|
+
- name: Run unit tests
|
|
30
|
+
run: |
|
|
31
|
+
uv run pytest tests/unit -v --tb=short
|
|
32
|
+
|
|
33
|
+
- name: Run linting and formatting checks
|
|
34
|
+
run: |
|
|
35
|
+
uv run ruff check llmsbrieftxt/ tests/
|
|
36
|
+
uv run ruff format --check llmsbrieftxt/ tests/
|
|
37
|
+
|
|
38
|
+
- name: Type checking
|
|
39
|
+
run: |
|
|
40
|
+
uv run pyright llmsbrieftxt/
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: PR Title Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- edited
|
|
8
|
+
- synchronize
|
|
9
|
+
- reopened
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
pull-requests: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
validate-pr-title:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: amannn/action-semantic-pull-request@v5
|
|
19
|
+
env:
|
|
20
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
21
|
+
with:
|
|
22
|
+
# Configure allowed types (will affect version bumping)
|
|
23
|
+
types: |
|
|
24
|
+
feat
|
|
25
|
+
fix
|
|
26
|
+
docs
|
|
27
|
+
style
|
|
28
|
+
refactor
|
|
29
|
+
perf
|
|
30
|
+
test
|
|
31
|
+
build
|
|
32
|
+
ci
|
|
33
|
+
chore
|
|
34
|
+
revert
|
|
35
|
+
# Require scope to be present (e.g., "feat(api): ...")
|
|
36
|
+
requireScope: false
|
|
37
|
+
# Subjects must not be empty
|
|
38
|
+
subjectPattern: ^(?![A-Z]).+$
|
|
39
|
+
subjectPatternError: |
|
|
40
|
+
The subject "{subject}" found in the pull request title "{title}"
|
|
41
|
+
didn't match the configured pattern. Please ensure that the subject
|
|
42
|
+
doesn't start with an uppercase character.
|
|
43
|
+
# GitHub releases will be created for these types when using bump script
|
|
44
|
+
# feat -> minor bump
|
|
45
|
+
# fix -> patch bump
|
|
46
|
+
# feat! or BREAKING CHANGE -> major bump
|
|
47
|
+
wip: false
|
|
48
|
+
validateSingleCommit: false
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
create-release-tag:
|
|
14
|
+
# Only run on main branch pushes (not tags)
|
|
15
|
+
if: github.ref == 'refs/heads/main'
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
outputs:
|
|
18
|
+
tag: ${{ steps.bump.outputs.tag }}
|
|
19
|
+
bumped: ${{ steps.bump.outputs.bumped }}
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0 # Fetch all history and tags
|
|
25
|
+
|
|
26
|
+
- name: Configure Git
|
|
27
|
+
run: |
|
|
28
|
+
git config user.name "github-actions[bot]"
|
|
29
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
30
|
+
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@v5
|
|
33
|
+
with:
|
|
34
|
+
version: "latest"
|
|
35
|
+
|
|
36
|
+
- name: Analyze commits and create version tag
|
|
37
|
+
id: bump
|
|
38
|
+
run: |
|
|
39
|
+
uv python install 3.11
|
|
40
|
+
uv run python scripts/bump_version.py | tee bump_output.txt
|
|
41
|
+
|
|
42
|
+
# Parse output
|
|
43
|
+
VERSION=$(grep "^version=" bump_output.txt | cut -d'=' -f2)
|
|
44
|
+
BUMPED=$(grep "^bumped=" bump_output.txt | cut -d'=' -f2)
|
|
45
|
+
TAG=$(grep "^tag=" bump_output.txt | cut -d'=' -f2)
|
|
46
|
+
|
|
47
|
+
echo "version=$VERSION"
|
|
48
|
+
echo "bumped=$BUMPED"
|
|
49
|
+
echo "tag=$TAG"
|
|
50
|
+
|
|
51
|
+
# Set outputs for next job
|
|
52
|
+
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
53
|
+
echo "bumped=$BUMPED" >> $GITHUB_OUTPUT
|
|
54
|
+
|
|
55
|
+
# Only push tag if a bump occurred
|
|
56
|
+
if [ "$BUMPED" = "true" ]; then
|
|
57
|
+
echo "Pushing tag $TAG"
|
|
58
|
+
git push origin $TAG
|
|
59
|
+
else
|
|
60
|
+
echo "No version bump needed, skipping tag creation"
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
build-and-publish:
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
needs: [create-release-tag]
|
|
66
|
+
# Only run if automated tag was created
|
|
67
|
+
if: needs.create-release-tag.outputs.bumped == 'true'
|
|
68
|
+
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
with:
|
|
72
|
+
fetch-depth: 0
|
|
73
|
+
|
|
74
|
+
- name: Inject static version into pyproject.toml
|
|
75
|
+
run: |
|
|
76
|
+
# Extract version from tag (strip 'v' prefix)
|
|
77
|
+
VERSION="${{ needs.create-release-tag.outputs.tag }}"
|
|
78
|
+
VERSION="${VERSION#v}"
|
|
79
|
+
echo "Injecting static version: $VERSION"
|
|
80
|
+
|
|
81
|
+
# Replace dynamic version with static version
|
|
82
|
+
sed -i 's/^dynamic = \["version"\]/version = "'$VERSION'"/' pyproject.toml
|
|
83
|
+
|
|
84
|
+
# Remove hatch-vcs configuration section
|
|
85
|
+
sed -i '/^\[tool\.hatch\.version\]/,/^$/d' pyproject.toml
|
|
86
|
+
|
|
87
|
+
# Verify the changes
|
|
88
|
+
echo "Modified pyproject.toml [project] section:"
|
|
89
|
+
grep -A 3 '^\[project\]' pyproject.toml | head -5
|
|
90
|
+
|
|
91
|
+
- name: Install uv
|
|
92
|
+
uses: astral-sh/setup-uv@v5
|
|
93
|
+
with:
|
|
94
|
+
version: "latest"
|
|
95
|
+
|
|
96
|
+
- name: Build package
|
|
97
|
+
run: |
|
|
98
|
+
uv python install 3.11
|
|
99
|
+
uv build
|
|
100
|
+
|
|
101
|
+
- name: Publish to PyPI
|
|
102
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
103
|
+
with:
|
|
104
|
+
skip-existing: true
|
|
105
|
+
|
|
106
|
+
- name: Create GitHub Release
|
|
107
|
+
uses: softprops/action-gh-release@v2
|
|
108
|
+
with:
|
|
109
|
+
tag_name: ${{ needs.create-release-tag.outputs.tag }}
|
|
110
|
+
files: dist/*
|
|
111
|
+
generate_release_notes: true
|