coauthor 0.1.3__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.
- coauthor-0.1.3/.bumpversion.toml +29 -0
- coauthor-0.1.3/.coauthor/templates/coauthor/python/system.md +83 -0
- coauthor-0.1.3/.coauthor/templates/coauthor/python/user.md +1 -0
- coauthor-0.1.3/.coauthor/templates/coauthor-doc/system.md +40 -0
- coauthor-0.1.3/.coauthor/templates/coauthor-doc/user/context/file.md +6 -0
- coauthor-0.1.3/.coauthor/templates/coauthor-doc/user/context/url.md +6 -0
- coauthor-0.1.3/.coauthor/templates/coauthor-doc/user/context.md +9 -0
- coauthor-0.1.3/.coauthor/templates/coauthor-doc/user.md +1 -0
- coauthor-0.1.3/.coauthor.yml +100 -0
- coauthor-0.1.3/.github/dependabot.yml +22 -0
- coauthor-0.1.3/.github/template-sync.yml +21 -0
- coauthor-0.1.3/.github/workflows/CI.yml +21 -0
- coauthor-0.1.3/.github/workflows/publish.yml +10 -0
- coauthor-0.1.3/.github/workflows/schedule-update-actions.yml +25 -0
- coauthor-0.1.3/.github/workflows/semantic-pr-check.yml +17 -0
- coauthor-0.1.3/.github/workflows/sphinx.yml +18 -0
- coauthor-0.1.3/.github/workflows/template-sync.yml +12 -0
- coauthor-0.1.3/.gitignore +133 -0
- coauthor-0.1.3/.gitlab-ci.yml +107 -0
- coauthor-0.1.3/.pre-commit-config.yaml +60 -0
- coauthor-0.1.3/.pypirc +10 -0
- coauthor-0.1.3/.readthedocs.yaml +15 -0
- coauthor-0.1.3/.vscode/launch.json +19 -0
- coauthor-0.1.3/.vscode/settings.json +33 -0
- coauthor-0.1.3/CHANGELOG.md +148 -0
- coauthor-0.1.3/COAUTHOR.md +47 -0
- coauthor-0.1.3/CODE_OF_CONDUCT.md +9 -0
- coauthor-0.1.3/LICENSE +21 -0
- coauthor-0.1.3/PKG-INFO +125 -0
- coauthor-0.1.3/README.md +69 -0
- coauthor-0.1.3/SECURITY.md +41 -0
- coauthor-0.1.3/SUPPORT.md +25 -0
- coauthor-0.1.3/docs/_static/logo.png +0 -0
- coauthor-0.1.3/docs/conf.py +77 -0
- coauthor-0.1.3/docs/contributors/contributing.md +88 -0
- coauthor-0.1.3/docs/index.md +36 -0
- coauthor-0.1.3/docs/requirements.txt +6 -0
- coauthor-0.1.3/docs/users/changelog.md +6 -0
- coauthor-0.1.3/docs/users/configuration_file/examples.md +104 -0
- coauthor-0.1.3/docs/users/configuration_file/jira.md +111 -0
- coauthor-0.1.3/docs/users/configuration_file.md +329 -0
- coauthor-0.1.3/docs/users/installation_and_usage.md +11 -0
- coauthor-0.1.3/pyproject.toml +298 -0
- coauthor-0.1.3/src/README.md +1 -0
- coauthor-0.1.3/src/coauthor/__init__.py +5 -0
- coauthor-0.1.3/src/coauthor/config/tools.yml +240 -0
- coauthor-0.1.3/src/coauthor/main.py +103 -0
- coauthor-0.1.3/src/coauthor/modules/__init__.py +3 -0
- coauthor-0.1.3/src/coauthor/modules/ai.py +237 -0
- coauthor-0.1.3/src/coauthor/modules/file_processor.py +180 -0
- coauthor-0.1.3/src/coauthor/modules/file_scanner.py +101 -0
- coauthor-0.1.3/src/coauthor/modules/file_watcher.py +301 -0
- coauthor-0.1.3/src/coauthor/modules/jira_watcher.py +379 -0
- coauthor-0.1.3/src/coauthor/modules/langgraph.py +60 -0
- coauthor-0.1.3/src/coauthor/modules/markdown.py +56 -0
- coauthor-0.1.3/src/coauthor/modules/plantuml.py +58 -0
- coauthor-0.1.3/src/coauthor/modules/request_history.py +124 -0
- coauthor-0.1.3/src/coauthor/modules/tools.py +419 -0
- coauthor-0.1.3/src/coauthor/modules/web_tasks.py +59 -0
- coauthor-0.1.3/src/coauthor/modules/workflow.py +62 -0
- coauthor-0.1.3/src/coauthor/modules/workflow_tasks.py +32 -0
- coauthor-0.1.3/src/coauthor/modules/youtube.py +111 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/config.yml +134 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/examples/ansible-role-template.md +52 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/ansible-collection/system.md +33 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/ansible-collection/user.md +7 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/ansible-collection-readme/system.md +28 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/ansible-collection-readme/user.md +7 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/module-doc/system.md +157 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/module-doc/user/code.md +18 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/module-doc/user.md +5 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/modules-linux/system.md +26 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/modules-linux/user/git_remote.py +78 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/modules-linux/user.md +7 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/modules-win/system.md +26 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/modules-win/user/win_certificate.ps1 +142 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/modules-win/user.md +7 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/role-meta-file/system.md +94 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/role-meta-file/user/galaxy.md +6 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/role-meta-file/user/readme.md +2 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/role-meta-file/user.md +5 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/role-readme/system.md +86 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/role-readme/user/role-file.md +5 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/role-readme/user/role-template.md +3 -0
- coauthor-0.1.3/src/coauthor/profiles/ansible-collection/templates/role-readme/user.md +5 -0
- coauthor-0.1.3/src/coauthor/profiles/jira/config.yml +13 -0
- coauthor-0.1.3/src/coauthor/profiles/jira/templates/jira/system.md +5 -0
- coauthor-0.1.3/src/coauthor/profiles/jira/templates/jira/system_comment.md +191 -0
- coauthor-0.1.3/src/coauthor/profiles/jira/templates/jira/system_ticket/bug.md +30 -0
- coauthor-0.1.3/src/coauthor/profiles/jira/templates/jira/system_ticket/epic.md +23 -0
- coauthor-0.1.3/src/coauthor/profiles/jira/templates/jira/system_ticket/story.md +38 -0
- coauthor-0.1.3/src/coauthor/profiles/jira/templates/jira/system_ticket/task.md +16 -0
- coauthor-0.1.3/src/coauthor/profiles/jira/templates/jira/system_ticket.md +131 -0
- coauthor-0.1.3/src/coauthor/profiles/jira/templates/jira/user.md +82 -0
- coauthor-0.1.3/src/coauthor/utils/ai_utils.py +307 -0
- coauthor-0.1.3/src/coauthor/utils/c2platform_org.py +48 -0
- coauthor-0.1.3/src/coauthor/utils/config.py +182 -0
- coauthor-0.1.3/src/coauthor/utils/evaluators.py +66 -0
- coauthor-0.1.3/src/coauthor/utils/export.py +164 -0
- coauthor-0.1.3/src/coauthor/utils/file.py +67 -0
- coauthor-0.1.3/src/coauthor/utils/git.py +47 -0
- coauthor-0.1.3/src/coauthor/utils/inotify_utils.py +37 -0
- coauthor-0.1.3/src/coauthor/utils/jinja.py +190 -0
- coauthor-0.1.3/src/coauthor/utils/jinja_filters.py +145 -0
- coauthor-0.1.3/src/coauthor/utils/jira_utils.py +291 -0
- coauthor-0.1.3/src/coauthor/utils/log_utils.py +11 -0
- coauthor-0.1.3/src/coauthor/utils/logger.py +53 -0
- coauthor-0.1.3/src/coauthor/utils/markdown.py +69 -0
- coauthor-0.1.3/src/coauthor/utils/match_utils.py +155 -0
- coauthor-0.1.3/src/coauthor/utils/notify.py +11 -0
- coauthor-0.1.3/src/coauthor/utils/retriever.py +41 -0
- coauthor-0.1.3/src/coauthor/utils/workflow_utils.py +36 -0
- coauthor-0.1.3/tests/conftest.py +65 -0
- coauthor-0.1.3/tests/data/coauthor-include-file.yml +41 -0
- coauthor-0.1.3/tests/data/coauthor-markdown-no-regex.yml +2 -0
- coauthor-0.1.3/tests/data/coauthor-markdown.yml +8 -0
- coauthor-0.1.3/tests/data/coauthor-markdown2.yml +13 -0
- coauthor-0.1.3/tests/data/coauthor-regex-replace.yml +20 -0
- coauthor-0.1.3/tests/data/coauthor-workflows.yml +35 -0
- coauthor-0.1.3/tests/data/coauthor.yml +2 -0
- coauthor-0.1.3/tests/data/coauthor_task_pong.yml +23 -0
- coauthor-0.1.3/tests/data/coauthor_test_match_utils.yml +11 -0
- coauthor-0.1.3/tests/data/coauthor_translation.yml +25 -0
- coauthor-0.1.3/tests/data/coauthor_translation2.yml +19 -0
- coauthor-0.1.3/tests/data/whatever.md +10 -0
- coauthor-0.1.3/tests/data/whatever_without_instruction.md +5 -0
- coauthor-0.1.3/tests/modules/test_file_scanner.py +72 -0
- coauthor-0.1.3/tests/modules/test_langgraph.py +186 -0
- coauthor-0.1.3/tests/modules/test_markdown.py +112 -0
- coauthor-0.1.3/tests/modules/test_plantuml.py +57 -0
- coauthor-0.1.3/tests/modules/test_web_tasks.py +115 -0
- coauthor-0.1.3/tests/modules/test_youtube.py +78 -0
- coauthor-0.1.3/tests/requirements.txt +5 -0
- coauthor-0.1.3/tests/test_ai.py +234 -0
- coauthor-0.1.3/tests/test_ai_live.py +98 -0
- coauthor-0.1.3/tests/test_ai_translation.py +73 -0
- coauthor-0.1.3/tests/test_c2platform_org.py +42 -0
- coauthor-0.1.3/tests/test_config_utils.py +152 -0
- coauthor-0.1.3/tests/test_evaluators.py +23 -0
- coauthor-0.1.3/tests/test_file_processor.py +221 -0
- coauthor-0.1.3/tests/test_file_watcher.py +383 -0
- coauthor-0.1.3/tests/test_git.py +41 -0
- coauthor-0.1.3/tests/test_inotify_utils.py +84 -0
- coauthor-0.1.3/tests/test_jinja.py +149 -0
- coauthor-0.1.3/tests/test_jinja_filters.py +298 -0
- coauthor-0.1.3/tests/test_logger_utils.py +66 -0
- coauthor-0.1.3/tests/test_main.py +63 -0
- coauthor-0.1.3/tests/test_match_utils.py +165 -0
- coauthor-0.1.3/tests/test_workflow.py +185 -0
- coauthor-0.1.3/tests/test_workflow_utils.py +52 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[tool.bumpversion]
|
|
2
|
+
current_version = "0.1.3"
|
|
3
|
+
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
4
|
+
serialize = ["{major}.{minor}.{patch}"]
|
|
5
|
+
search = "{current_version}"
|
|
6
|
+
replace = "{new_version}"
|
|
7
|
+
regex = false
|
|
8
|
+
ignore_missing_version = false
|
|
9
|
+
ignore_missing_files = false
|
|
10
|
+
tag = false
|
|
11
|
+
sign_tags = false
|
|
12
|
+
tag_name = "v{new_version}"
|
|
13
|
+
tag_message = "Bump version: {current_version} → {new_version}"
|
|
14
|
+
allow_dirty = false
|
|
15
|
+
commit = false
|
|
16
|
+
message = "Bump version: {current_version} → {new_version}"
|
|
17
|
+
commit_args = ""
|
|
18
|
+
setup_hooks = []
|
|
19
|
+
pre_commit_hooks = []
|
|
20
|
+
post_commit_hooks = []
|
|
21
|
+
|
|
22
|
+
[[tool.bumpversion.files]]
|
|
23
|
+
filename = "pyproject.toml"
|
|
24
|
+
|
|
25
|
+
[[tool.bumpversion.files]]
|
|
26
|
+
filename = "src/coauthor/__init__.py"
|
|
27
|
+
|
|
28
|
+
[[tool.bumpversion.files]]
|
|
29
|
+
filename = "docs/conf.py"
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Python Coauthor
|
|
2
|
+
|
|
3
|
+
## IDENTITY AND PURPOSE
|
|
4
|
+
|
|
5
|
+
You are a co-author of Python files tasked with enhancing, completing and
|
|
6
|
+
refining them based on specific embedded instructions.
|
|
7
|
+
|
|
8
|
+
## GOAL
|
|
9
|
+
|
|
10
|
+
Effectively process the Python file by understanding and implementing
|
|
11
|
+
the instructions provided. Achieve this by following these guidelines:
|
|
12
|
+
|
|
13
|
+
## STEPS
|
|
14
|
+
|
|
15
|
+
1. **Evaluation**:
|
|
16
|
+
- Thoroughly read the Python file received as input for comprehensive
|
|
17
|
+
understanding.
|
|
18
|
+
|
|
19
|
+
2. **Instruction Identification**:
|
|
20
|
+
- Locate all co-author instructions contained between parentheses,
|
|
21
|
+
prefixed
|
|
22
|
+
with `ai:` (e.g., `(ai: modify this sentence...)`) or `@ai:`.
|
|
23
|
+
|
|
24
|
+
3. **Instruction Interpretation**:
|
|
25
|
+
- Comprehend each instruction in the context of the given Python file
|
|
26
|
+
content.
|
|
27
|
+
Differentiate between localized instructions and those applicable to the
|
|
28
|
+
entire document.
|
|
29
|
+
4. **Python Guidelines**:
|
|
30
|
+
- **Pytest**: The Python project used Pytest so if asked for a test, you should
|
|
31
|
+
assume a Pytest test. An example test is:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
def test_ping():
|
|
35
|
+
test_content = "ping"
|
|
36
|
+
mocked_open = mock_open(read_data=test_content)
|
|
37
|
+
|
|
38
|
+
# Create a mock logger
|
|
39
|
+
mock_logger = mock.Mock()
|
|
40
|
+
|
|
41
|
+
with mock.patch("builtins.open", mocked_open):
|
|
42
|
+
# Call the pong function with a mock path and mock logger
|
|
43
|
+
pong("mock_path", config=None, logger=mock_logger)
|
|
44
|
+
|
|
45
|
+
# Check if the file content was updated to 'pong'
|
|
46
|
+
# Reconfigure the mocked_open to check the write call
|
|
47
|
+
mocked_open().write.assert_called_once_with("pong")
|
|
48
|
+
|
|
49
|
+
# Ensure logger was called with appropriate messages
|
|
50
|
+
mock_logger.info.assert_any_call("Running the pong file processor" + "mock_path")
|
|
51
|
+
mock_logger.info.assert_any_call('Updating mock_path to "pong"')
|
|
52
|
+
```
|
|
53
|
+
- Python methods in the project often utilize `logger` and `config` parameters, here is an example of that
|
|
54
|
+
```python
|
|
55
|
+
def test_get_config_not_found_with_logger():
|
|
56
|
+
logger = Logger(__name__)
|
|
57
|
+
config = get_config(logger=logger, config_filename="non-existing-file.yml", search_dir="/tmp")
|
|
58
|
+
assert config != None
|
|
59
|
+
```
|
|
60
|
+
5. **File Modification**:
|
|
61
|
+
- Execute changes to the File document as per the instructions,
|
|
62
|
+
ensuring
|
|
63
|
+
improvements, clarification, corrections, and optimization.
|
|
64
|
+
|
|
65
|
+
6. **Output Structuring**:
|
|
66
|
+
- Finalize the file by removing all instructional cues. - Deliver a
|
|
67
|
+
coherent and clean Python file document that is easily readable and
|
|
68
|
+
effective.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## OUTPUT INSTRUCTIONS
|
|
72
|
+
|
|
73
|
+
- The finalized document should not contain any of the instructional
|
|
74
|
+
annotations.
|
|
75
|
+
- Produce a pristine Python file content, adhering strictly to the original
|
|
76
|
+
content integrity while incorporating instructed changes.
|
|
77
|
+
- Don't return the code as a Markdown code block starting with ```python
|
|
78
|
+
and ending with ```. Only return valid Python code. Your response should be
|
|
79
|
+
valid Python code.
|
|
80
|
+
|
|
81
|
+
## INPUT
|
|
82
|
+
|
|
83
|
+
Receive a Python file featuring embedded instructions for processing.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ task['path-modify-event'] | include_file_content }}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Python Coauthor
|
|
2
|
+
|
|
3
|
+
## IDENTITY AND PURPOSE
|
|
4
|
+
|
|
5
|
+
You are a co-author of documentation in Markdown documentation tasked with
|
|
6
|
+
enhancing, completing and refining them based on specific embedded instructions.
|
|
7
|
+
|
|
8
|
+
## GOAL
|
|
9
|
+
|
|
10
|
+
Effectively process the Python file by understanding and implementing
|
|
11
|
+
the instructions provided. Achieve this by following these guidelines:
|
|
12
|
+
|
|
13
|
+
## STEPS
|
|
14
|
+
|
|
15
|
+
1. **Evaluation**: Thoroughly read the Markdown file received as input for
|
|
16
|
+
comprehensive understanding.
|
|
17
|
+
2. **Instruction Identification**: Locate all co-author instructions contained
|
|
18
|
+
between parentheses, prefixed with `ai:` (e.g., `(ai: modify this
|
|
19
|
+
sentence...)`) or `@ai:`.
|
|
20
|
+
3. **Instruction Interpretation**: Comprehend each instruction in the context of
|
|
21
|
+
the given Markdown file content. Differentiate between localized
|
|
22
|
+
instructions and those applicable to the entire document.
|
|
23
|
+
4. **Output Structuring**: Finalize the file by removing all instructional
|
|
24
|
+
cues. Deliver a coherent and clean Markdown file document that is easily
|
|
25
|
+
readable and effective.
|
|
26
|
+
5. **Tips and Suggestions**: Review the file for additional improvements,
|
|
27
|
+
additions and fixes and provide tips and suggestions as a hidden comment
|
|
28
|
+
between a line that starts with `<!--` and a line that ends with `-->`.
|
|
29
|
+
|
|
30
|
+
## OUTPUT INSTRUCTIONS
|
|
31
|
+
|
|
32
|
+
- The finalized document should not contain any of the instructional
|
|
33
|
+
annotations.
|
|
34
|
+
- Produce a pristine Markdown file content, adhering strictly to the original
|
|
35
|
+
content integrity while incorporating instructed changes.
|
|
36
|
+
- Only return valid Python code. Your response should be valid Markdown code.
|
|
37
|
+
|
|
38
|
+
## INPUT
|
|
39
|
+
|
|
40
|
+
Receive a Markdown file featuring embedded instructions for processing.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{%- if 'url' in task['frontmatter-item'] -%}
|
|
2
|
+
{%- include 'context/url.md' -%}
|
|
3
|
+
{%- endif -%}
|
|
4
|
+
{%- if 'file' in task['frontmatter-item'] -%}
|
|
5
|
+
{%- include 'context/file.md' -%}
|
|
6
|
+
{%- endif -%}
|
|
7
|
+
{%- if 'diff' in task['frontmatter-item'] -%}
|
|
8
|
+
{%- include 'context/diff.md' -%}
|
|
9
|
+
{%- endif -%}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ task['path-modify-event'] | include_file_content }}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coauthor
|
|
3
|
+
type: Python
|
|
4
|
+
description: Coauthor AI Agent for working on code and documentation
|
|
5
|
+
jinja:
|
|
6
|
+
search_path: .coauthor/templates
|
|
7
|
+
# custom_delimiters:
|
|
8
|
+
# block_start_string: "{{%"
|
|
9
|
+
# block_end_string: "%}}"
|
|
10
|
+
# variable_start_string: "{{"
|
|
11
|
+
# variable_end_string: "}}"
|
|
12
|
+
agent:
|
|
13
|
+
# model: x-ai/grok-4
|
|
14
|
+
model: openai/gpt-5.2-pro
|
|
15
|
+
api_key_var: OPENAI_API_KEY
|
|
16
|
+
api_url_var: OPENAI_API_URL
|
|
17
|
+
tool_environment: |
|
|
18
|
+
source ~/.bashrc
|
|
19
|
+
source ~/.virtualenv/c2d_ai/bin/activate
|
|
20
|
+
file-watcher:
|
|
21
|
+
ignore-folders:
|
|
22
|
+
- docs/_build
|
|
23
|
+
- __pycache__
|
|
24
|
+
- src/coauthor/profiles # config.yml contain @ai:
|
|
25
|
+
workflows:
|
|
26
|
+
- name: coauthor
|
|
27
|
+
path_patterns:
|
|
28
|
+
- .*\.py$
|
|
29
|
+
- .*\.yml$
|
|
30
|
+
content_patterns:
|
|
31
|
+
- ".*@ai:.*"
|
|
32
|
+
watch:
|
|
33
|
+
filesystem:
|
|
34
|
+
paths:
|
|
35
|
+
- src
|
|
36
|
+
- tests
|
|
37
|
+
tasks:
|
|
38
|
+
- id: python
|
|
39
|
+
type: ai
|
|
40
|
+
- id: write-file
|
|
41
|
+
type: write_file
|
|
42
|
+
content: >-
|
|
43
|
+
{{ config | get_task_attribute('python', 'response') }}
|
|
44
|
+
- name: coauthor-doc
|
|
45
|
+
path_patterns:
|
|
46
|
+
- .*\.md$
|
|
47
|
+
content_patterns:
|
|
48
|
+
- ".*@ai:.*"
|
|
49
|
+
watch:
|
|
50
|
+
filesystem:
|
|
51
|
+
paths:
|
|
52
|
+
- docs
|
|
53
|
+
tasks:
|
|
54
|
+
- id: docs
|
|
55
|
+
type: ai
|
|
56
|
+
messages:
|
|
57
|
+
- file: coauthor-doc/user/context.md
|
|
58
|
+
frontmatter: coauthor/context
|
|
59
|
+
- id: write-file
|
|
60
|
+
type: write_file
|
|
61
|
+
content: >-
|
|
62
|
+
{{ config | get_task_attribute('docs', 'response') }}
|
|
63
|
+
projects:
|
|
64
|
+
- name: jira
|
|
65
|
+
type: jira
|
|
66
|
+
description: Coauthor tickets in JIRA
|
|
67
|
+
profile: jira
|
|
68
|
+
profile_args:
|
|
69
|
+
agent:
|
|
70
|
+
# model: x-ai/grok-4
|
|
71
|
+
model: openai/gpt-5.2-pro
|
|
72
|
+
api_key_var: OPENAI_API_KEY
|
|
73
|
+
api_url_var: OPENAI_API_URL
|
|
74
|
+
content_patterns:
|
|
75
|
+
- '\[~coauthor\]'
|
|
76
|
+
watch:
|
|
77
|
+
jira:
|
|
78
|
+
# url: https://www.example.com/jira/
|
|
79
|
+
query: >-
|
|
80
|
+
project = C2 AND component = COAUTHOR
|
|
81
|
+
AND (updated >= -0.35h OR created >= -0.35h)
|
|
82
|
+
sleep: 10
|
|
83
|
+
# content_patterns:
|
|
84
|
+
# - "@ai: "
|
|
85
|
+
# watch:
|
|
86
|
+
# jira:
|
|
87
|
+
# # url: https://www.example.com/jira/
|
|
88
|
+
# comments:
|
|
89
|
+
# - query: >-
|
|
90
|
+
# project = C2 AND component = COAUTHOR
|
|
91
|
+
# AND (updated >= -0.35h OR created >= -0.35h)
|
|
92
|
+
# # AND labels in (coauthor-comments)
|
|
93
|
+
# add_labels: [coauthor-comments]
|
|
94
|
+
# # remove_labels: [ai-comment]
|
|
95
|
+
# tickets:
|
|
96
|
+
# - query: project = C2 AND component = COAUTHOR AND labels in (rfai)
|
|
97
|
+
# add_labels: [rfr]
|
|
98
|
+
# remove_labels: [rfai]
|
|
99
|
+
# assign_to_creator: false
|
|
100
|
+
# sleep: 10
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: pip
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: daily
|
|
7
|
+
time: "13:00"
|
|
8
|
+
open-pull-requests-limit: 10
|
|
9
|
+
reviewers:
|
|
10
|
+
- dciborow
|
|
11
|
+
allow:
|
|
12
|
+
- dependency-type: direct
|
|
13
|
+
- dependency-type: indirect
|
|
14
|
+
commit-message:
|
|
15
|
+
prefix: "fix: "
|
|
16
|
+
- package-ecosystem: "github-actions"
|
|
17
|
+
directory: "/"
|
|
18
|
+
schedule:
|
|
19
|
+
interval: daily
|
|
20
|
+
time: "13:00"
|
|
21
|
+
commit-message:
|
|
22
|
+
prefix: "fix: "
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
files:
|
|
2
|
+
- ".gitignore" # include
|
|
3
|
+
- ".github"
|
|
4
|
+
- ".vscode"
|
|
5
|
+
- "tests/conftest.py"
|
|
6
|
+
- ".flake8"
|
|
7
|
+
- ".pre-commit-config.yml"
|
|
8
|
+
- ".pypirc"
|
|
9
|
+
- "docs"
|
|
10
|
+
- "src/README.md"
|
|
11
|
+
- "CODE_OF_CONDUCT.md"
|
|
12
|
+
- "LICENSE"
|
|
13
|
+
- "README.md"
|
|
14
|
+
- "SECURITY.md"
|
|
15
|
+
- "SUPPORT.md"
|
|
16
|
+
- "pyproject.toml"
|
|
17
|
+
|
|
18
|
+
- "!.github/workflows/template-sync.yml"
|
|
19
|
+
- "!.github/template-sync.yml"
|
|
20
|
+
- "!src/python_project"
|
|
21
|
+
- "!tests/test_methods.py"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Python CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [ main ]
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [ main ]
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
validation:
|
|
13
|
+
uses: microsoft/action-python/.github/workflows/validation.yml@0.6.4
|
|
14
|
+
with:
|
|
15
|
+
workdir: '.'
|
|
16
|
+
|
|
17
|
+
publish:
|
|
18
|
+
uses: microsoft/action-python/.github/workflows/publish.yml@0.6.4
|
|
19
|
+
secrets:
|
|
20
|
+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
21
|
+
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: GitHub Actions Version Updater
|
|
2
|
+
|
|
3
|
+
# Controls when the action will run.
|
|
4
|
+
on:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
schedule:
|
|
7
|
+
# Automatically run on every Sunday
|
|
8
|
+
- cron: '0 0 * * 0'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v3.5.2
|
|
16
|
+
with:
|
|
17
|
+
# [Required] Access token with `workflow` scope.
|
|
18
|
+
token: ${{ secrets.PAT }}
|
|
19
|
+
|
|
20
|
+
- name: Run GitHub Actions Version Updater
|
|
21
|
+
uses: saadmk11/github-actions-version-updater@v0.7.4
|
|
22
|
+
with:
|
|
23
|
+
# [Required] Access token with `workflow` scope.
|
|
24
|
+
token: ${{ secrets.PAT }}
|
|
25
|
+
pull_request_title: "ci: Update GitHub Actions to Latest Version"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: "Semantic PR Check"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- edited
|
|
8
|
+
- synchronize
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
main:
|
|
12
|
+
name: Validate PR title
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: amannn/action-semantic-pull-request@v5.2.0
|
|
16
|
+
env:
|
|
17
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Deploy Sphinx documentation to Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main] # branch to trigger deployment
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
pages:
|
|
9
|
+
runs-on: ubuntu-20.04
|
|
10
|
+
environment:
|
|
11
|
+
name: github-pages
|
|
12
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
13
|
+
permissions:
|
|
14
|
+
pages: write
|
|
15
|
+
id-token: write
|
|
16
|
+
steps:
|
|
17
|
+
- id: deployment
|
|
18
|
+
uses: sphinx-notes/pages@v3
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name: Template Sync
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
jobs:
|
|
5
|
+
sync:
|
|
6
|
+
runs-on: ubuntu-latest
|
|
7
|
+
steps:
|
|
8
|
+
- uses: actions/checkout@v3.5.2 # important!
|
|
9
|
+
- uses: euphoricsystems/action-sync-template-repository@v2.5.1
|
|
10
|
+
with:
|
|
11
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
12
|
+
dry-run: true
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
coverage_html
|
|
50
|
+
*.cover
|
|
51
|
+
*.py,cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
.python-version
|
|
87
|
+
|
|
88
|
+
# pipenv
|
|
89
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
90
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
91
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
92
|
+
# install all needed dependencies.
|
|
93
|
+
#Pipfile.lock
|
|
94
|
+
|
|
95
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
96
|
+
__pypackages__/
|
|
97
|
+
|
|
98
|
+
# Celery stuff
|
|
99
|
+
celerybeat-schedule
|
|
100
|
+
celerybeat.pid
|
|
101
|
+
|
|
102
|
+
# SageMath parsed files
|
|
103
|
+
*.sage.py
|
|
104
|
+
|
|
105
|
+
# Environments
|
|
106
|
+
.env
|
|
107
|
+
.venv
|
|
108
|
+
env/
|
|
109
|
+
venv/
|
|
110
|
+
ENV/
|
|
111
|
+
env.bak/
|
|
112
|
+
venv.bak/
|
|
113
|
+
|
|
114
|
+
# Spyder project settings
|
|
115
|
+
.spyderproject
|
|
116
|
+
.spyproject
|
|
117
|
+
|
|
118
|
+
# Rope project settings
|
|
119
|
+
.ropeproject
|
|
120
|
+
|
|
121
|
+
# mkdocs documentation
|
|
122
|
+
/site
|
|
123
|
+
|
|
124
|
+
# mypy
|
|
125
|
+
.mypy_cache/
|
|
126
|
+
.dmypy.json
|
|
127
|
+
dmypy.json
|
|
128
|
+
|
|
129
|
+
# Pyre type checker
|
|
130
|
+
.pyre/
|
|
131
|
+
|
|
132
|
+
# Coauthor
|
|
133
|
+
.coauthor_dump.yml
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
stages:
|
|
3
|
+
# - lint
|
|
4
|
+
- test
|
|
5
|
+
- build
|
|
6
|
+
- release
|
|
7
|
+
|
|
8
|
+
variables:
|
|
9
|
+
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
10
|
+
CI_PYTHON_VERSION: "3.11"
|
|
11
|
+
|
|
12
|
+
default:
|
|
13
|
+
image: python:$CI_PYTHON_VERSION
|
|
14
|
+
|
|
15
|
+
before_script:
|
|
16
|
+
- python --version
|
|
17
|
+
- pip install --upgrade pip
|
|
18
|
+
|
|
19
|
+
# .linters:
|
|
20
|
+
# stage: lint
|
|
21
|
+
# script:
|
|
22
|
+
# - pip install . pre-commit mypy==1.13.0 -r tests/requirements.txt
|
|
23
|
+
# - mypy src/ tests/
|
|
24
|
+
|
|
25
|
+
# .lint:
|
|
26
|
+
# extends: .linters
|
|
27
|
+
# tags:
|
|
28
|
+
# - docker
|
|
29
|
+
# only:
|
|
30
|
+
# - master
|
|
31
|
+
|
|
32
|
+
prepare:
|
|
33
|
+
stage: build
|
|
34
|
+
script:
|
|
35
|
+
- |
|
|
36
|
+
C2_VERSION=$(grep 'version =' pyproject.toml | awk -F '"' '{print $2}')
|
|
37
|
+
- 'echo "C2_VERSION: $C2_VERSION"'
|
|
38
|
+
- |
|
|
39
|
+
echo "C2_VERSION=$C2_VERSION" >> variables.env
|
|
40
|
+
artifacts:
|
|
41
|
+
reports:
|
|
42
|
+
dotenv: variables.env
|
|
43
|
+
|
|
44
|
+
build:
|
|
45
|
+
stage: build
|
|
46
|
+
script:
|
|
47
|
+
- python3 -m pip install flit
|
|
48
|
+
- flit build
|
|
49
|
+
artifacts:
|
|
50
|
+
paths:
|
|
51
|
+
- dist/
|
|
52
|
+
|
|
53
|
+
pypi-publish:
|
|
54
|
+
stage: release
|
|
55
|
+
script:
|
|
56
|
+
- python3 -m pip install flit
|
|
57
|
+
- flit build
|
|
58
|
+
- flit publish
|
|
59
|
+
# environment: # require approval
|
|
60
|
+
# name: release
|
|
61
|
+
# url: https://pypi.org/project/coauthor
|
|
62
|
+
# variables:
|
|
63
|
+
# # FLIT_INDEX_URL: https://test.pypi.org/legacy/
|
|
64
|
+
# FLIT_USERNAME: __token__
|
|
65
|
+
only:
|
|
66
|
+
- tags
|
|
67
|
+
|
|
68
|
+
test:
|
|
69
|
+
stage: test
|
|
70
|
+
parallel:
|
|
71
|
+
matrix:
|
|
72
|
+
- PY: ["3.10", "3.11"]
|
|
73
|
+
# DEPS_VERSION: ["min_deps_version", "latest_deps_version"]
|
|
74
|
+
image: "python:$PY"
|
|
75
|
+
# services:
|
|
76
|
+
# - docker:dind
|
|
77
|
+
script:
|
|
78
|
+
- git config --global user.email "you@example.com"
|
|
79
|
+
- git config --global user.name "Your Name"
|
|
80
|
+
- pip install . -r tests/requirements.txt
|
|
81
|
+
- pytest --cov src --cov-fail-under 100
|
|
82
|
+
coverage: '/TOTAL\s+\d+\s+\d+\s+\d+\s+\d+\s+(\d+(?:\.\d+)?)\%$/'
|
|
83
|
+
allow_failure: true
|
|
84
|
+
artifacts:
|
|
85
|
+
paths:
|
|
86
|
+
- coverage.xml
|
|
87
|
+
- coverage_html
|
|
88
|
+
|
|
89
|
+
gitlab-release:
|
|
90
|
+
stage: release
|
|
91
|
+
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
92
|
+
needs: [prepare]
|
|
93
|
+
before_script: []
|
|
94
|
+
script:
|
|
95
|
+
- echo "Create Coauthor release $C2_VERSION"
|
|
96
|
+
release:
|
|
97
|
+
name: Coauthor $C2_VERSION
|
|
98
|
+
description: "./CHANGELOG.md"
|
|
99
|
+
tag_name: $C2_VERSION
|
|
100
|
+
ref: $CI_COMMIT_SHA
|
|
101
|
+
when: manual
|
|
102
|
+
only:
|
|
103
|
+
- master
|
|
104
|
+
# assets:
|
|
105
|
+
# links:
|
|
106
|
+
# - name: coauthor
|
|
107
|
+
# url: https://galaxy.ansible.com/$C2_NAMESPACE/$C2_NAME
|