tdlib-oracle 0.1.0__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.
- tdlib_oracle-0.1.0/.editorconfig +13 -0
- tdlib_oracle-0.1.0/.gitattributes +6 -0
- tdlib_oracle-0.1.0/.github/ISSUE_TEMPLATE/bug-report.yml +85 -0
- tdlib_oracle-0.1.0/.github/ISSUE_TEMPLATE/config.yml +14 -0
- tdlib_oracle-0.1.0/.github/ISSUE_TEMPLATE/feature-request.yml +80 -0
- tdlib_oracle-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +15 -0
- tdlib_oracle-0.1.0/.github/dependabot.yml +44 -0
- tdlib_oracle-0.1.0/.github/workflows/ci.yml +95 -0
- tdlib_oracle-0.1.0/.github/workflows/pr-title.yml +48 -0
- tdlib_oracle-0.1.0/.github/workflows/release.yml +146 -0
- tdlib_oracle-0.1.0/.github/workflows/upstream-pin.yml +26 -0
- tdlib_oracle-0.1.0/.gitignore +29 -0
- tdlib_oracle-0.1.0/.pre-commit-config.yaml +45 -0
- tdlib_oracle-0.1.0/CHANGELOG.md +20 -0
- tdlib_oracle-0.1.0/CODE_OF_CONDUCT.md +44 -0
- tdlib_oracle-0.1.0/CONTRIBUTING.md +115 -0
- tdlib_oracle-0.1.0/LICENSE +21 -0
- tdlib_oracle-0.1.0/LICENSES/BSL-1.0.txt +23 -0
- tdlib_oracle-0.1.0/PKG-INFO +111 -0
- tdlib_oracle-0.1.0/README.md +82 -0
- tdlib_oracle-0.1.0/SECURITY.md +44 -0
- tdlib_oracle-0.1.0/docs/behavior.md +52 -0
- tdlib_oracle-0.1.0/docs/compatibility.md +36 -0
- tdlib_oracle-0.1.0/docs/library.md +76 -0
- tdlib_oracle-0.1.0/pyproject.toml +151 -0
- tdlib_oracle-0.1.0/scripts/check-pin.sh +30 -0
- tdlib_oracle-0.1.0/scripts/check-release.sh +45 -0
- tdlib_oracle-0.1.0/scripts/release-notes.sh +32 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/__init__.py +29 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/botapi/__init__.py +1 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/botapi/checks.py +28 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/botapi/descriptions.py +53 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/exceptions.py +9 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/py.typed +0 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/server.py +126 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/tdlib/__init__.py +1 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/tdlib/cleaning.py +198 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/tdlib/content.py +44 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/tdlib/fixing.py +89 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/text/__init__.py +1 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/text/failure.py +22 -0
- tdlib_oracle-0.1.0/src/tdlib_oracle/text/utf8.py +108 -0
- tdlib_oracle-0.1.0/tests/__init__.py +0 -0
- tdlib_oracle-0.1.0/tests/botapi/__init__.py +0 -0
- tdlib_oracle-0.1.0/tests/botapi/test_checks.py +17 -0
- tdlib_oracle-0.1.0/tests/botapi/test_descriptions.py +32 -0
- tdlib_oracle-0.1.0/tests/tdlib/__init__.py +0 -0
- tdlib_oracle-0.1.0/tests/tdlib/test_cleaning.py +131 -0
- tdlib_oracle-0.1.0/tests/tdlib/test_content.py +23 -0
- tdlib_oracle-0.1.0/tests/tdlib/test_fixing.py +59 -0
- tdlib_oracle-0.1.0/tests/test_exceptions.py +6 -0
- tdlib_oracle-0.1.0/tests/test_init.py +27 -0
- tdlib_oracle-0.1.0/tests/test_server.py +191 -0
- tdlib_oracle-0.1.0/tests/text/__init__.py +0 -0
- tdlib_oracle-0.1.0/tests/text/test_failure.py +17 -0
- tdlib_oracle-0.1.0/tests/text/test_utf8.py +92 -0
- tdlib_oracle-0.1.0/tests/upstream/__init__.py +0 -0
- tdlib_oracle-0.1.0/tests/upstream/test_message_entities.py +78 -0
- tdlib_oracle-0.1.0/tests/upstream/test_string_cleaning.py +115 -0
- tdlib_oracle-0.1.0/tests/upstream/test_tdutils_misc.py +63 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
name: Report a bug
|
|
2
|
+
description: >-
|
|
3
|
+
Report a defect in TDLib Oracle. Security vulnerabilities must be reported via
|
|
4
|
+
GitHub's private advisory feature, not this form.
|
|
5
|
+
title: "bug: <short description>"
|
|
6
|
+
labels: [bug, triage]
|
|
7
|
+
body:
|
|
8
|
+
- type: checkboxes
|
|
9
|
+
id: preflight-checks
|
|
10
|
+
attributes:
|
|
11
|
+
label: Before submitting
|
|
12
|
+
options:
|
|
13
|
+
- label: >-
|
|
14
|
+
The issue is not already reported in
|
|
15
|
+
[open issues](https://github.com/theodiv/tdlib-oracle/issues?q=is:issue+state:open).
|
|
16
|
+
required: true
|
|
17
|
+
|
|
18
|
+
- type: input
|
|
19
|
+
id: version
|
|
20
|
+
attributes:
|
|
21
|
+
label: TDLib Oracle version
|
|
22
|
+
description: Output of `pip show tdlib-oracle`.
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
|
|
26
|
+
- type: input
|
|
27
|
+
id: python-version
|
|
28
|
+
attributes:
|
|
29
|
+
label: Python version
|
|
30
|
+
description: Output of `python3 --version`.
|
|
31
|
+
validations:
|
|
32
|
+
required: true
|
|
33
|
+
|
|
34
|
+
- type: input
|
|
35
|
+
id: operating-system
|
|
36
|
+
attributes:
|
|
37
|
+
label: Operating system
|
|
38
|
+
placeholder: Ubuntu 24.04 LTS (Noble Numbat)
|
|
39
|
+
validations:
|
|
40
|
+
required: true
|
|
41
|
+
|
|
42
|
+
- type: input
|
|
43
|
+
id: installation-method
|
|
44
|
+
attributes:
|
|
45
|
+
label: Installation method
|
|
46
|
+
placeholder: pip or a local clone
|
|
47
|
+
validations:
|
|
48
|
+
required: true
|
|
49
|
+
|
|
50
|
+
- type: textarea
|
|
51
|
+
id: description
|
|
52
|
+
attributes:
|
|
53
|
+
label: Description
|
|
54
|
+
description: The observed behavior, then the expected behavior.
|
|
55
|
+
validations:
|
|
56
|
+
required: true
|
|
57
|
+
|
|
58
|
+
- type: textarea
|
|
59
|
+
id: steps-to-reproduce
|
|
60
|
+
attributes:
|
|
61
|
+
label: Steps to reproduce
|
|
62
|
+
description: >-
|
|
63
|
+
The smallest command line or Python snippet, with the input, that shows
|
|
64
|
+
the defect with the installed package.
|
|
65
|
+
validations:
|
|
66
|
+
required: true
|
|
67
|
+
|
|
68
|
+
- type: textarea
|
|
69
|
+
id: observed-output
|
|
70
|
+
attributes:
|
|
71
|
+
label: Observed output
|
|
72
|
+
description: >-
|
|
73
|
+
The output, log lines, or error line, exactly as written, with secrets
|
|
74
|
+
and personal data replaced with `REDACTED`.
|
|
75
|
+
render: text
|
|
76
|
+
validations:
|
|
77
|
+
required: true
|
|
78
|
+
|
|
79
|
+
- type: textarea
|
|
80
|
+
id: additional-context
|
|
81
|
+
attributes:
|
|
82
|
+
label: Additional context
|
|
83
|
+
description: Anything a maintainer cannot infer.
|
|
84
|
+
validations:
|
|
85
|
+
required: false
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
|
|
3
|
+
contact_links:
|
|
4
|
+
- name: Ask a question
|
|
5
|
+
url: https://github.com/theodiv/tdlib-oracle/discussions/new?category=q-a
|
|
6
|
+
about: >-
|
|
7
|
+
For usage questions, open a thread in GitHub's Q&A discussions rather than
|
|
8
|
+
the issue tracker.
|
|
9
|
+
|
|
10
|
+
- name: Start a discussion
|
|
11
|
+
url: https://github.com/theodiv/tdlib-oracle/discussions/new?category=general
|
|
12
|
+
about: >-
|
|
13
|
+
For general feedback or open-ended topics, open a thread in GitHub's
|
|
14
|
+
General discussions.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Request a feature
|
|
2
|
+
description: Propose a new capability for TDLib Oracle.
|
|
3
|
+
title: "feat: <short description>"
|
|
4
|
+
labels: [feat, triage]
|
|
5
|
+
body:
|
|
6
|
+
- type: checkboxes
|
|
7
|
+
id: preflight-checks
|
|
8
|
+
attributes:
|
|
9
|
+
label: Before submitting
|
|
10
|
+
options:
|
|
11
|
+
- label: >-
|
|
12
|
+
The feature is not already proposed in
|
|
13
|
+
[open issues](https://github.com/theodiv/tdlib-oracle/issues?q=is:issue+state:open).
|
|
14
|
+
required: true
|
|
15
|
+
- label: >-
|
|
16
|
+
The feature fits the project's scope: reproducing the pinned Bot API
|
|
17
|
+
server's handling of a bot's formatted text.
|
|
18
|
+
required: true
|
|
19
|
+
|
|
20
|
+
- type: input
|
|
21
|
+
id: version
|
|
22
|
+
attributes:
|
|
23
|
+
label: TDLib Oracle version
|
|
24
|
+
description: Output of `pip show tdlib-oracle`.
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
|
|
28
|
+
- type: dropdown
|
|
29
|
+
id: feature-area
|
|
30
|
+
attributes:
|
|
31
|
+
label: Feature area
|
|
32
|
+
description: The part of TDLib Oracle the feature concerns.
|
|
33
|
+
options:
|
|
34
|
+
- Plain text
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
|
|
38
|
+
- type: textarea
|
|
39
|
+
id: problem-statement
|
|
40
|
+
attributes:
|
|
41
|
+
label: Problem statement
|
|
42
|
+
description: The capability gap, then what it costs.
|
|
43
|
+
validations:
|
|
44
|
+
required: true
|
|
45
|
+
|
|
46
|
+
- type: textarea
|
|
47
|
+
id: proposed-solution
|
|
48
|
+
attributes:
|
|
49
|
+
label: Proposed solution
|
|
50
|
+
description: >-
|
|
51
|
+
The behavior the feature should have, in prose; no code or
|
|
52
|
+
configuration blocks.
|
|
53
|
+
validations:
|
|
54
|
+
required: true
|
|
55
|
+
|
|
56
|
+
- type: textarea
|
|
57
|
+
id: alternatives-considered
|
|
58
|
+
attributes:
|
|
59
|
+
label: Alternatives considered
|
|
60
|
+
description: The workaround in use and its limitation.
|
|
61
|
+
validations:
|
|
62
|
+
required: false
|
|
63
|
+
|
|
64
|
+
- type: textarea
|
|
65
|
+
id: additional-context
|
|
66
|
+
attributes:
|
|
67
|
+
label: Additional context
|
|
68
|
+
description: Specifications or comparable tools.
|
|
69
|
+
validations:
|
|
70
|
+
required: false
|
|
71
|
+
|
|
72
|
+
- type: checkboxes
|
|
73
|
+
id: contribution-intent
|
|
74
|
+
attributes:
|
|
75
|
+
label: Contribution intent
|
|
76
|
+
options:
|
|
77
|
+
- label: >-
|
|
78
|
+
A pull request implementing this feature is planned or already
|
|
79
|
+
in progress.
|
|
80
|
+
required: false
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
<!-- Explain why the change is needed. Link the related issue if one exists. -->
|
|
4
|
+
|
|
5
|
+
Closes #
|
|
6
|
+
|
|
7
|
+
## Pre-Submission Checklist
|
|
8
|
+
|
|
9
|
+
<!-- All items must be checked before requesting review. -->
|
|
10
|
+
|
|
11
|
+
- [ ] pre-commit hooks pass on all files
|
|
12
|
+
- [ ] Test suite passes with branch coverage at or above the 90% threshold
|
|
13
|
+
- [ ] Tests added or updated for all changed logic, or no logic changed
|
|
14
|
+
- [ ] `CHANGELOG.md` updated under `[Unreleased]`, or no caller-visible effect
|
|
15
|
+
- [ ] PR title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
updates:
|
|
4
|
+
- package-ecosystem: github-actions
|
|
5
|
+
directory: /
|
|
6
|
+
schedule:
|
|
7
|
+
interval: weekly
|
|
8
|
+
cooldown:
|
|
9
|
+
default-days: 7
|
|
10
|
+
groups:
|
|
11
|
+
ci-actions:
|
|
12
|
+
patterns: ["*"]
|
|
13
|
+
commit-message:
|
|
14
|
+
prefix: ci
|
|
15
|
+
labels: [ci]
|
|
16
|
+
open-pull-requests-limit: 5
|
|
17
|
+
|
|
18
|
+
- package-ecosystem: pip
|
|
19
|
+
directory: /
|
|
20
|
+
schedule:
|
|
21
|
+
interval: weekly
|
|
22
|
+
cooldown:
|
|
23
|
+
default-days: 7
|
|
24
|
+
groups:
|
|
25
|
+
dev-tools:
|
|
26
|
+
patterns: ["*"]
|
|
27
|
+
commit-message:
|
|
28
|
+
prefix: chore
|
|
29
|
+
labels: [chore]
|
|
30
|
+
open-pull-requests-limit: 5
|
|
31
|
+
|
|
32
|
+
- package-ecosystem: pre-commit
|
|
33
|
+
directory: /
|
|
34
|
+
schedule:
|
|
35
|
+
interval: weekly
|
|
36
|
+
cooldown:
|
|
37
|
+
default-days: 7
|
|
38
|
+
groups:
|
|
39
|
+
pre-commit-hooks:
|
|
40
|
+
patterns: ["*"]
|
|
41
|
+
commit-message:
|
|
42
|
+
prefix: chore
|
|
43
|
+
labels: [chore]
|
|
44
|
+
open-pull-requests-limit: 5
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
name: Continuous Integration
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_call:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
hooks:
|
|
19
|
+
name: Enforce code quality
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
timeout-minutes: 10
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- name: Check out source
|
|
25
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
26
|
+
with:
|
|
27
|
+
persist-credentials: false
|
|
28
|
+
|
|
29
|
+
- name: Set up Python 3.15
|
|
30
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
31
|
+
with:
|
|
32
|
+
python-version: "3.15"
|
|
33
|
+
cache: pip
|
|
34
|
+
|
|
35
|
+
- name: Create virtual environment
|
|
36
|
+
run: python -m venv --upgrade-deps .venv
|
|
37
|
+
|
|
38
|
+
- name: Install dev dependencies
|
|
39
|
+
run: .venv/bin/pip install -e . --group dev
|
|
40
|
+
|
|
41
|
+
- name: Run pre-commit hooks
|
|
42
|
+
run: .venv/bin/pre-commit run --all-files --show-diff-on-failure
|
|
43
|
+
env:
|
|
44
|
+
SKIP: no-commit-to-branch
|
|
45
|
+
|
|
46
|
+
tests:
|
|
47
|
+
name: Test using Python ${{ matrix.python-version }}
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
needs: hooks
|
|
50
|
+
timeout-minutes: 15
|
|
51
|
+
|
|
52
|
+
strategy:
|
|
53
|
+
fail-fast: false
|
|
54
|
+
matrix:
|
|
55
|
+
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
|
|
56
|
+
|
|
57
|
+
steps:
|
|
58
|
+
- name: Check out source
|
|
59
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
60
|
+
with:
|
|
61
|
+
persist-credentials: false
|
|
62
|
+
|
|
63
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
64
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
65
|
+
with:
|
|
66
|
+
python-version: ${{ matrix.python-version }}
|
|
67
|
+
cache: pip
|
|
68
|
+
|
|
69
|
+
- name: Create virtual environment
|
|
70
|
+
run: python -m venv --upgrade-deps .venv
|
|
71
|
+
|
|
72
|
+
- name: Install dev dependencies
|
|
73
|
+
run: .venv/bin/pip install -e . --group dev
|
|
74
|
+
|
|
75
|
+
- name: Run test suite
|
|
76
|
+
run: .venv/bin/pytest -v --cov
|
|
77
|
+
|
|
78
|
+
all-passed:
|
|
79
|
+
name: Confirm all jobs passed
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
needs: [hooks, tests]
|
|
82
|
+
if: always()
|
|
83
|
+
timeout-minutes: 5
|
|
84
|
+
|
|
85
|
+
steps:
|
|
86
|
+
- name: Check every job result
|
|
87
|
+
env:
|
|
88
|
+
NEEDS: ${{ toJSON(needs) }}
|
|
89
|
+
run: |
|
|
90
|
+
jq -r 'to_entries[]
|
|
91
|
+
| (if .value.result == "success" then "" else "::error::" end)
|
|
92
|
+
+ "Job \(.key) ended with result \(.value.result)"' <<< "$NEEDS"
|
|
93
|
+
if ! jq -e 'all(.[]; .result == "success")' <<< "$NEEDS" > /dev/null; then
|
|
94
|
+
exit 1
|
|
95
|
+
fi
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Pull Request Title Validation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, edited, synchronize, reopened]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
pull-requests: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
title:
|
|
12
|
+
name: Validate PR title
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 5
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Check title type and scope
|
|
18
|
+
uses: amannn/action-semantic-pull-request@2252a14e810aa9b85c2d560bd7070c802206ecf6 # v6.1.2
|
|
19
|
+
env:
|
|
20
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
21
|
+
with:
|
|
22
|
+
types: |
|
|
23
|
+
feat
|
|
24
|
+
fix
|
|
25
|
+
refactor
|
|
26
|
+
test
|
|
27
|
+
docs
|
|
28
|
+
chore
|
|
29
|
+
perf
|
|
30
|
+
ci
|
|
31
|
+
scopes: |
|
|
32
|
+
api
|
|
33
|
+
text
|
|
34
|
+
botapi
|
|
35
|
+
tdlib
|
|
36
|
+
cli
|
|
37
|
+
build
|
|
38
|
+
requireScope: false
|
|
39
|
+
|
|
40
|
+
- name: Check title length
|
|
41
|
+
if: github.event.pull_request.user.login != 'dependabot[bot]'
|
|
42
|
+
env:
|
|
43
|
+
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
44
|
+
run: |
|
|
45
|
+
if [ "${#PR_TITLE}" -gt 68 ]; then
|
|
46
|
+
echo "::error::PR title is ${#PR_TITLE} characters; the limit is 68"
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
name: Package Publishing
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: [v*]
|
|
6
|
+
workflow_dispatch: # from main: X.Y.Z.devN to TestPyPI, no tag, no release
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
cache-mode: none
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
check:
|
|
15
|
+
name: Prepare release
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
timeout-minutes: 5
|
|
18
|
+
outputs:
|
|
19
|
+
prerelease: ${{ steps.version.outputs.prerelease }}
|
|
20
|
+
version: ${{ steps.version.outputs.version }}
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Check out source
|
|
24
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
25
|
+
with:
|
|
26
|
+
fetch-depth: 0 # check-release.sh compares HEAD with origin/main
|
|
27
|
+
persist-credentials: false
|
|
28
|
+
|
|
29
|
+
- name: Check version and branch
|
|
30
|
+
id: version
|
|
31
|
+
run: scripts/check-release.sh
|
|
32
|
+
|
|
33
|
+
- name: Extract release notes
|
|
34
|
+
if: github.event_name == 'push'
|
|
35
|
+
env:
|
|
36
|
+
VERSION: ${{ steps.version.outputs.version }}
|
|
37
|
+
run: scripts/release-notes.sh "$VERSION" > release-notes.md
|
|
38
|
+
|
|
39
|
+
- name: Upload release notes
|
|
40
|
+
if: github.event_name == 'push'
|
|
41
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
42
|
+
with:
|
|
43
|
+
name: release-notes
|
|
44
|
+
path: release-notes.md
|
|
45
|
+
|
|
46
|
+
ci:
|
|
47
|
+
name: Run continuous integration
|
|
48
|
+
uses: $/.github/workflows/ci.yml
|
|
49
|
+
|
|
50
|
+
package:
|
|
51
|
+
name: Build distributions
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
needs: [check, ci]
|
|
54
|
+
timeout-minutes: 10
|
|
55
|
+
|
|
56
|
+
steps:
|
|
57
|
+
- name: Check out source
|
|
58
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
59
|
+
with:
|
|
60
|
+
persist-credentials: false
|
|
61
|
+
|
|
62
|
+
- name: Set up Python 3.15
|
|
63
|
+
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
64
|
+
with:
|
|
65
|
+
python-version: "3.15"
|
|
66
|
+
|
|
67
|
+
- name: Set development version
|
|
68
|
+
if: github.event_name == 'workflow_dispatch'
|
|
69
|
+
env:
|
|
70
|
+
VERSION: ${{ needs.check.outputs.version }}
|
|
71
|
+
run: sed -i "s/^__version__ = \".*\"$/__version__ = \"$VERSION\"/" src/tdlib_oracle/__init__.py
|
|
72
|
+
|
|
73
|
+
- name: Create virtual environment
|
|
74
|
+
run: python -m venv --upgrade-deps .venv
|
|
75
|
+
|
|
76
|
+
- name: Install release dependencies
|
|
77
|
+
run: .venv/bin/pip install --group release
|
|
78
|
+
|
|
79
|
+
- name: Build sdist and wheel
|
|
80
|
+
run: .venv/bin/python -m build
|
|
81
|
+
|
|
82
|
+
- name: Check distributions
|
|
83
|
+
run: .venv/bin/twine check --strict dist/*
|
|
84
|
+
|
|
85
|
+
- name: Upload distributions
|
|
86
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
87
|
+
with:
|
|
88
|
+
name: dist
|
|
89
|
+
path: dist/
|
|
90
|
+
if-no-files-found: error
|
|
91
|
+
|
|
92
|
+
pypi:
|
|
93
|
+
name: Publish to ${{ github.event_name == 'push' && 'PyPI' || 'TestPyPI' }}
|
|
94
|
+
runs-on: ubuntu-latest
|
|
95
|
+
needs: package
|
|
96
|
+
timeout-minutes: 10
|
|
97
|
+
environment:
|
|
98
|
+
name: ${{ github.event_name == 'push' && 'PyPI' || 'TestPyPI' }}
|
|
99
|
+
url: ${{ github.event_name == 'push' && 'https://pypi.org/p/tdlib-oracle' || 'https://test.pypi.org/p/tdlib-oracle' }}
|
|
100
|
+
permissions:
|
|
101
|
+
id-token: write # trusted publishing
|
|
102
|
+
|
|
103
|
+
steps:
|
|
104
|
+
- name: Download distributions
|
|
105
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
106
|
+
with:
|
|
107
|
+
name: dist
|
|
108
|
+
path: dist/
|
|
109
|
+
|
|
110
|
+
- name: Publish distributions
|
|
111
|
+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
112
|
+
with:
|
|
113
|
+
repository-url: ${{ github.event_name == 'push' && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }}
|
|
114
|
+
|
|
115
|
+
github-release:
|
|
116
|
+
name: Publish GitHub release
|
|
117
|
+
runs-on: ubuntu-latest
|
|
118
|
+
needs: [check, pypi]
|
|
119
|
+
if: github.event_name == 'push'
|
|
120
|
+
timeout-minutes: 5
|
|
121
|
+
permissions:
|
|
122
|
+
contents: write # gh release create
|
|
123
|
+
|
|
124
|
+
steps:
|
|
125
|
+
- name: Download distributions
|
|
126
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
127
|
+
with:
|
|
128
|
+
name: dist
|
|
129
|
+
path: dist/
|
|
130
|
+
|
|
131
|
+
- name: Download release notes
|
|
132
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
133
|
+
with:
|
|
134
|
+
name: release-notes
|
|
135
|
+
|
|
136
|
+
- name: Create release
|
|
137
|
+
env:
|
|
138
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
139
|
+
PRERELEASE: ${{ needs.check.outputs.prerelease }}
|
|
140
|
+
run: |
|
|
141
|
+
gh release create "$GITHUB_REF_NAME" dist/* \
|
|
142
|
+
--repo "$GITHUB_REPOSITORY" \
|
|
143
|
+
--title "$GITHUB_REF_NAME" \
|
|
144
|
+
--notes-file release-notes.md \
|
|
145
|
+
--verify-tag \
|
|
146
|
+
--prerelease="$PRERELEASE"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Upstream Pin Monitoring
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: 17 15 * * 1
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
pin:
|
|
13
|
+
name: Confirm pin is current
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
timeout-minutes: 5
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Check out source
|
|
19
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
|
+
with:
|
|
21
|
+
persist-credentials: false
|
|
22
|
+
|
|
23
|
+
- name: Compare pin with newest upstream commit
|
|
24
|
+
env:
|
|
25
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
26
|
+
run: scripts/check-pin.sh
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Build and distribution
|
|
2
|
+
dist/
|
|
3
|
+
build/
|
|
4
|
+
*.egg-info/
|
|
5
|
+
|
|
6
|
+
# Bytecode
|
|
7
|
+
__pycache__/
|
|
8
|
+
*.py[cod]
|
|
9
|
+
|
|
10
|
+
# Virtual environment
|
|
11
|
+
.venv/
|
|
12
|
+
|
|
13
|
+
# Testing and coverage
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.coverage
|
|
16
|
+
coverage.json
|
|
17
|
+
coverage.xml
|
|
18
|
+
htmlcov/
|
|
19
|
+
|
|
20
|
+
# Tool caches
|
|
21
|
+
.mypy_cache/
|
|
22
|
+
.ruff_cache/
|
|
23
|
+
|
|
24
|
+
# Editors and operating systems
|
|
25
|
+
.idea/
|
|
26
|
+
.vscode/
|
|
27
|
+
*.swp
|
|
28
|
+
.DS_Store
|
|
29
|
+
Thumbs.db
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v6.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-toml
|
|
9
|
+
- id: check-case-conflict
|
|
10
|
+
- id: check-symlinks
|
|
11
|
+
- id: check-added-large-files
|
|
12
|
+
args: [--maxkb=500]
|
|
13
|
+
- id: check-merge-conflict
|
|
14
|
+
- id: debug-statements
|
|
15
|
+
- id: detect-private-key
|
|
16
|
+
- id: no-commit-to-branch
|
|
17
|
+
args: [--branch, main]
|
|
18
|
+
|
|
19
|
+
- repo: local
|
|
20
|
+
hooks:
|
|
21
|
+
- id: ruff-check
|
|
22
|
+
name: lint python with ruff
|
|
23
|
+
entry: .venv/bin/ruff check --fix
|
|
24
|
+
language: system
|
|
25
|
+
types_or: [python, pyi]
|
|
26
|
+
require_serial: true
|
|
27
|
+
- id: ruff-format
|
|
28
|
+
name: format python with ruff
|
|
29
|
+
entry: .venv/bin/ruff format
|
|
30
|
+
language: system
|
|
31
|
+
types_or: [python, pyi]
|
|
32
|
+
require_serial: true
|
|
33
|
+
- id: mypy
|
|
34
|
+
name: check types with mypy
|
|
35
|
+
entry: .venv/bin/mypy src/ tests/
|
|
36
|
+
language: system
|
|
37
|
+
types: [python]
|
|
38
|
+
pass_filenames: false
|
|
39
|
+
- id: zizmor
|
|
40
|
+
name: check workflows with zizmor
|
|
41
|
+
entry: .venv/bin/zizmor --offline .github/
|
|
42
|
+
language: system
|
|
43
|
+
files: ^\.github/
|
|
44
|
+
types: [yaml]
|
|
45
|
+
pass_filenames: false
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to TDLib Oracle are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-11-15
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add `check`, which returns the pinned Bot API server's `Verdict` on a plain
|
|
15
|
+
message text: the error description it refuses the text with, or the text it
|
|
16
|
+
keeps after cleaning and trimming. `BOT_API_VERSION`, `BOT_API_COMMIT`, and
|
|
17
|
+
`TDLIB_COMMIT` name the pin.
|
|
18
|
+
|
|
19
|
+
[Unreleased]: https://github.com/theodiv/tdlib-oracle/compare/v0.1.0...HEAD
|
|
20
|
+
[0.1.0]: https://github.com/theodiv/tdlib-oracle/releases/tag/v0.1.0
|