sphinx-terminal 0.0.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.
Files changed (37) hide show
  1. sphinx_terminal-0.0.1/.github/PULL_REQUEST_TEMPLATE.md +5 -0
  2. sphinx_terminal-0.0.1/.github/release-drafter.yml +24 -0
  3. sphinx_terminal-0.0.1/.github/workflows/policy.yaml +15 -0
  4. sphinx_terminal-0.0.1/.github/workflows/qa.yaml +16 -0
  5. sphinx_terminal-0.0.1/.github/workflows/release-drafter.yaml +16 -0
  6. sphinx_terminal-0.0.1/.github/workflows/release-publish.yaml +72 -0
  7. sphinx_terminal-0.0.1/.gitignore +149 -0
  8. sphinx_terminal-0.0.1/.pre-commit-config.yaml +28 -0
  9. sphinx_terminal-0.0.1/CONTRIBUTING.md +220 -0
  10. sphinx_terminal-0.0.1/LICENSE +674 -0
  11. sphinx_terminal-0.0.1/Makefile +48 -0
  12. sphinx_terminal-0.0.1/PKG-INFO +99 -0
  13. sphinx_terminal-0.0.1/README.md +87 -0
  14. sphinx_terminal-0.0.1/common.mk +271 -0
  15. sphinx_terminal-0.0.1/pyproject.toml +269 -0
  16. sphinx_terminal-0.0.1/setup.cfg +4 -0
  17. sphinx_terminal-0.0.1/sphinx_terminal/__init__.py +58 -0
  18. sphinx_terminal-0.0.1/sphinx_terminal/_static/terminal.css +80 -0
  19. sphinx_terminal-0.0.1/sphinx_terminal/_version.py +34 -0
  20. sphinx_terminal-0.0.1/sphinx_terminal/common.py +67 -0
  21. sphinx_terminal-0.0.1/sphinx_terminal/directive.py +137 -0
  22. sphinx_terminal-0.0.1/sphinx_terminal.egg-info/PKG-INFO +99 -0
  23. sphinx_terminal-0.0.1/sphinx_terminal.egg-info/SOURCES.txt +35 -0
  24. sphinx_terminal-0.0.1/sphinx_terminal.egg-info/dependency_links.txt +1 -0
  25. sphinx_terminal-0.0.1/sphinx_terminal.egg-info/requires.txt +2 -0
  26. sphinx_terminal-0.0.1/sphinx_terminal.egg-info/top_level.txt +1 -0
  27. sphinx_terminal-0.0.1/tests/__init__.py +15 -0
  28. sphinx_terminal-0.0.1/tests/integration/__init__.py +15 -0
  29. sphinx_terminal-0.0.1/tests/integration/example/__init__.py +15 -0
  30. sphinx_terminal-0.0.1/tests/integration/example/conf.py +31 -0
  31. sphinx_terminal-0.0.1/tests/integration/example/index.rst +21 -0
  32. sphinx_terminal-0.0.1/tests/integration/example/myst-source.md +14 -0
  33. sphinx_terminal-0.0.1/tests/integration/terminal_integration_test.py +77 -0
  34. sphinx_terminal-0.0.1/tests/unit/__init__.py +15 -0
  35. sphinx_terminal-0.0.1/tests/unit/conftest.py +22 -0
  36. sphinx_terminal-0.0.1/tests/unit/terminal_unit_test.py +199 -0
  37. sphinx_terminal-0.0.1/uv.lock +856 -0
@@ -0,0 +1,5 @@
1
+ - [ ] Have you followed the guidelines for contributing?
2
+ - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
3
+ - [ ] Have you successfully run `make lint && make test`?
4
+
5
+ ---
@@ -0,0 +1,24 @@
1
+ categories:
2
+ - title: "New Features"
3
+ labels:
4
+ - "enhancement"
5
+ - title: "Maintenance"
6
+ labels:
7
+ - "maintenance"
8
+ - title: "Bug Fixes"
9
+ labels:
10
+ - "bug"
11
+ - title: "Specifications and Documentation"
12
+ label:
13
+ - "specification"
14
+ - "doc"
15
+ - title: "Tooling"
16
+ label:
17
+ - "tooling"
18
+ change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
19
+ template: |
20
+ Special thanks to the contributors that made this release happen: $CONTRIBUTORS
21
+
22
+ ## Full list of changes
23
+
24
+ $CHANGES
@@ -0,0 +1,15 @@
1
+ name: Check policy
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches:
6
+ - main
7
+ - hotfix/*
8
+ - work/check-policy # For development
9
+
10
+ jobs:
11
+ policy:
12
+ uses: canonical/starflow/.github/workflows/policy.yaml@main
13
+ python-scans:
14
+ name: Security scan
15
+ uses: canonical/starflow/.github/workflows/scan-python.yaml@main
@@ -0,0 +1,16 @@
1
+ name: QA
2
+ on:
3
+ push:
4
+ branches:
5
+ - "main"
6
+ - "feature/*"
7
+ - "hotfix/*"
8
+ - "release/*"
9
+ - "renovate/*"
10
+ pull_request:
11
+
12
+ jobs:
13
+ lint:
14
+ uses: canonical/starflow/.github/workflows/lint-python.yaml@main
15
+ test:
16
+ uses: canonical/starflow/.github/workflows/test-python.yaml@main
@@ -0,0 +1,16 @@
1
+ name: Release Drafter
2
+
3
+ on:
4
+ push:
5
+ # branches to consider in the event; optional, defaults to all
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ update_release_draft:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Release Drafter
14
+ uses: release-drafter/release-drafter@v6.1.0
15
+ env:
16
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,72 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ tags:
5
+ # These tags should be protected, remember to enable the rule:
6
+ # https://github.com/canonical/starbase/settings/tag_protection
7
+ - "[0-9]+.[0-9]+.[0-9]+"
8
+
9
+ permissions:
10
+ contents: write
11
+
12
+ jobs:
13
+ source-wheel:
14
+ runs-on: [self-hosted, jammy]
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v4
18
+ - name: Fetch tag annotations
19
+ run: |
20
+ # Note: we fetch the tags here instead of using actions/checkout's "fetch-tags"
21
+ # because of https://github.com/actions/checkout/issues/1467
22
+ git fetch --force --tags --depth 1
23
+ git describe --dirty --long --match '[0-9]*.[0-9]*.[0-9]*' --exclude '*[^0-9.]*'
24
+ - name: Setup Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.10"
28
+ check-latest: true
29
+ - name: Build packages
30
+ run: |
31
+ pip install build twine
32
+ python3 -m build
33
+ twine check dist/*
34
+ - name: Upload pypi packages artifact
35
+ uses: actions/upload-artifact@v4
36
+ with:
37
+ name: pypi-packages
38
+ path: dist/
39
+ pypi:
40
+ needs: ["source-wheel"]
41
+ runs-on: [self-hosted, jammy, amd64]
42
+ permissions:
43
+ # IMPORTANT: this permission is mandatory for trusted publishing
44
+ id-token: write
45
+ steps:
46
+ - name: Get packages
47
+ uses: actions/download-artifact@v4
48
+ with:
49
+ name: pypi-packages
50
+ path: dist/
51
+ - name: Publish to pypi
52
+ # Note: this action uses PyPI's support for Trusted Publishers
53
+ # It needs a configuration on the PyPI project - see:
54
+ # https://docs.pypi.org/trusted-publishers/adding-a-publisher/#github-actions
55
+ uses: pypa/gh-action-pypi-publish@release/v1
56
+ github-release:
57
+ needs: ["source-wheel"]
58
+ runs-on: [self-hosted, jammy]
59
+ steps:
60
+ - name: Get pypi artifacts
61
+ uses: actions/download-artifact@v4
62
+ with:
63
+ name: pypi-packages
64
+ - name: Release
65
+ uses: softprops/action-gh-release@v2
66
+ with:
67
+ # Generate release notes on the new GH release
68
+ generate_release_notes: true
69
+ # Add wheel and source tarball
70
+ files: |
71
+ *.whl
72
+ *.tar.gz
@@ -0,0 +1,149 @@
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
+ *.snap
29
+ MANIFEST
30
+
31
+ # PyInstaller
32
+ # Usually these files are written by a python script from a template
33
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py,cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ .results.*.xml
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+ docs/spelling/
76
+
77
+ # PyBuilder
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98
+ __pypackages__/
99
+
100
+ # Celery stuff
101
+ celerybeat-schedule
102
+ celerybeat.pid
103
+
104
+ # SageMath parsed files
105
+ *.sage.py
106
+
107
+ # Environments
108
+ .direnv
109
+ .env
110
+ .venv
111
+ env/
112
+ venv/
113
+ ENV/
114
+ env.bak/
115
+ venv.bak/
116
+
117
+ # Spyder project settings
118
+ .spyderproject
119
+ .spyproject
120
+
121
+ # Rope project settings
122
+ .ropeproject
123
+
124
+ # mkdocs documentation
125
+ /site
126
+
127
+ # mypy
128
+ .mypy_cache/
129
+ .dmypy.json
130
+ dmypy.json
131
+
132
+ # Pyre type checker
133
+ .pyre/
134
+
135
+ # Caches for various tools
136
+ /.*_cache/
137
+
138
+ # Test results
139
+ /results/
140
+ .test_output/
141
+
142
+ # direnv
143
+ .envrc
144
+
145
+ # Ignore version module generated by setuptools_scm
146
+ */_version.py
147
+
148
+ # Visual Studio Code
149
+ .vscode/
@@ -0,0 +1,28 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: "v5.0.0"
6
+ hooks:
7
+ - id: trailing-whitespace
8
+ - id: end-of-file-fixer
9
+ - id: check-yaml
10
+ - id: check-added-large-files
11
+ - id: check-merge-conflict
12
+ - id: check-toml
13
+ - id: fix-byte-order-marker
14
+ - id: mixed-line-ending
15
+ - repo: https://github.com/astral-sh/ruff-pre-commit
16
+ rev: "v0.11.13"
17
+ hooks:
18
+ # Run the linter
19
+ - id: ruff
20
+ args: [--fix, --exit-non-zero-on-fix]
21
+ # Run the formatter
22
+ - id: ruff-format
23
+ - repo: https://github.com/pre-commit/mirrors-prettier
24
+ rev: "" # Intentionally blank, despite the warning.
25
+ hooks:
26
+ - id: prettier
27
+ additional_dependencies:
28
+ - prettier@3.4.2
@@ -0,0 +1,220 @@
1
+ # Contributing
2
+
3
+ All contributors should become familiar with this guide. It outlines the expectations
4
+ and practices for participating in the project.
5
+
6
+ ## Review the project expectations
7
+
8
+ Before you start working on the project, there are three documents for you to digest.
9
+
10
+ ### Ubuntu Code of Conduct
11
+
12
+ Projects governed by Canonical expect good conduct and excellence from every member. The
13
+ specific principles are laid out in the [Ubuntu Code of
14
+ Conduct](https://ubuntu.com/community/ethos/code-of-conduct).
15
+
16
+ ### Canonical Contributor License Agreement
17
+
18
+ As a contributor, you retain your copyright and attribution rights, provided you sign
19
+ the [Canonical Contributor Licence Agreement](http://www.ubuntu.com/legal/contributors).
20
+ Before committing any code, review its terms. If you agree and sign it, your code can be
21
+ incorporated into the repository.
22
+
23
+ ### Open source license
24
+
25
+ This project is licensed under [GPL-3.0](LICENSE).
26
+
27
+ ## Report an issue or open a request
28
+
29
+ If you find a bug or feature gap in the project, look for it in the [project's GitHub
30
+ issues](https://github.com/canonical/sphinx-ext-template/issues) first. If you have
31
+ fresh input, add your voice to the issue.
32
+
33
+ If the bug or feature doesn't have an issue, we invite you to [open
34
+ one](https://github.com/canonical/sphinx-ext-template/issues/new/choose).
35
+
36
+ ## Set up for development
37
+
38
+ This project uses a forking, feature-based workflow. Most work occurs on people's local
39
+ systems and is heavily terminal-dependent. Remote testing and building is provided on
40
+ GitHub for continuous integration and delivery.
41
+
42
+ Start by [creating a personal
43
+ fork](https://github.com/canonical/sphinx-ext-template/fork) of the repository on
44
+ GitHub.
45
+
46
+ Next, on your host system, clone your fork and sync it with the upstream repository:
47
+
48
+ ```bash
49
+ git clone git@github.com:<username>/sphinx-ext-template --recurse-submodules
50
+ cd sphinx-ext-template
51
+ git remote add upstream git@github.com:canonical/sphinx-ext-template
52
+ git fetch upstream
53
+ ```
54
+
55
+ If you don't authenticate with SSH, clone with
56
+ [HTTPS](https://docs.github.com/en/get-started/git-basics/about-remote-repositories#cloning-with-https-urls)
57
+ instead:
58
+
59
+ ```bash
60
+ git clone https://github.com/<username>/sphinx-ext-template --recurse-submodules
61
+ cd sphinx-ext-template
62
+ git remote add upstream https://github.com/canonical/sphinx-ext-template
63
+ git fetch upstream
64
+ ```
65
+
66
+ Inside the project directory, set up the virtual development environment and install all
67
+ dependencies, linters, and testers:
68
+
69
+ ```bash
70
+ make install
71
+ make lint
72
+ make test
73
+ ```
74
+
75
+ If all linting and testing completes without errors, your local environment is ready.
76
+
77
+ ## Contribute a change
78
+
79
+ With the prerequisites out of the way, let's walk through how to make a contribution to
80
+ the project.
81
+
82
+ ### Research the topic
83
+
84
+ All significant work should be tied to an existing issue or ticket.
85
+
86
+ If you'd like to add a small feature or fix, check the project's GitHub issues to see if
87
+ others have reported it. If they have, look into the current status of the topic. If no
88
+ one else is working on it, add a comment stating that you'd like to take it on, and a
89
+ maintainer will assign it to you.
90
+
91
+ If you're ever in doubt about developments in the project, ask!
92
+
93
+ ### Create a development branch
94
+
95
+ Once you've settled on a topic to work on, it's time to set up a local branch.
96
+
97
+ Always start by syncing against the branch and the dependencies you're basing your
98
+ changes on.
99
+
100
+ ```bash
101
+ git checkout main
102
+ git pull upstream main
103
+ git checkout -b <new-branch-name>
104
+ make install
105
+ ```
106
+
107
+ The new branch name should be brief, at no more than 80 characters. Format your branch
108
+ name as `<ticket-id>-<description>`. For example, if you're working on GitHub issue
109
+ \#235, and it's about adding a string sanitizer, you'd name your branch
110
+ `issue-235-add-string-sanitizer-method`.
111
+
112
+ ````
113
+
114
+ ### Commit a change
115
+
116
+ Once you've made the changes to the code and you're ready to test it, start by
117
+ committing:
118
+
119
+ ```bash
120
+ git add -A
121
+ git commit
122
+ ````
123
+
124
+ Format the commit message according to the [Conventional
125
+ Commits](https://www.conventionalcommits.org/en/v1.0.0/) style. For the sanitizer
126
+ example, an appropriate commit title would be:
127
+
128
+ ```
129
+ feat: add text sanitizer
130
+ ```
131
+
132
+ If you need help determining the type of conventional commit for your change, look at
133
+ the history of the file in question with `git log --oneline <filename>` . When you're
134
+ done browsing, press `Q` to exit the interactive log.
135
+
136
+ > **Tip**
137
+ >
138
+ > With complex changes, you might get stuck choosing a conventional commit type.
139
+ >
140
+ > This may signal that a commit is doing more than one thing and should be broken into
141
+ > multiple smaller commits. A commit should not, for example, refactor code and fix a
142
+ > bug. That should be two separate commits.
143
+ >
144
+ > In other scenarios, multiple types could be appropriate because of the nature of the
145
+ > commit. This can happen with `test` and `docs`, which can be used as either types
146
+ > or scopes.
147
+ >
148
+ > Run down the following list and select the highest-ranked type that fits your change:
149
+ >
150
+ > - ci
151
+ > - build
152
+ > - feat
153
+ > - fix
154
+ > - perf
155
+ > - refactor
156
+ > - style
157
+ > - test
158
+ > - docs
159
+ > - chore
160
+
161
+ Committing triggers the [pre-commit](https://pre-commit.com/) hook, which runs the
162
+ automatic code formatter and the fast linters.
163
+
164
+ If the linters reformatted any of the files, the commit was cancelled. To make the
165
+ changes stick, restage the modified files with `git add -A` and commit again.
166
+
167
+ ### Test the change
168
+
169
+ All nontrivial code changes should be accompanied by a reasonable set of tests.
170
+
171
+ sphinx-ext-template's test suite includes both unit and integration tests. If you're not
172
+ sure which tests you should add, go with your best judgement – additional tests can be
173
+ added during the review process.
174
+
175
+ Once you've made your changes, run the test suite:
176
+
177
+ ```bash
178
+ make test
179
+ ```
180
+
181
+ When iterating and testing, it's a good practice to clean the local temporary files that
182
+ the tests generate:
183
+
184
+ ```bash
185
+ make clean
186
+ ```
187
+
188
+ In rare instances, tests can fail in unpredictable ways, regardless of the state of your
189
+ code. In such cases, it's best to delete your virtual environment and start over:
190
+
191
+ ```bash
192
+ rm -rf .venv
193
+ make clean
194
+ make install
195
+ ```
196
+
197
+ ### Push the branch and open a PR
198
+
199
+ Once your work is committed to your branch, push it to your fork:
200
+
201
+ ```bash
202
+ git push -u origin <branch-name>
203
+ ```
204
+
205
+ Finally, [open a PR](https://github.com/canonical/sphinx-ext-template/compare) for it on
206
+ GitHub. If your branch has one commit, GitHub will title the PR after it. If your branch
207
+ has more than one commit, name the PR after the most significant. Once open, reviewers
208
+ are assigned automatically to your work.
209
+
210
+ ### Follow up for the review
211
+
212
+ When a maintainer reviews your PR, they typically leave inline comments and suggestions
213
+ on the code.
214
+
215
+ If the comment is a request, accommodate it by pushing one or more additional commits to
216
+ the branch. It's simplest to add the commits locally and push, rather than in the GitHub
217
+ interface, as it leads to fewer potential conflicts with syncs.
218
+
219
+ Don't force-push changes to the branch. It destroys the history of the review and makes
220
+ it harder for maintainers to see code changes.