unicode-animatio 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 (34) hide show
  1. unicode_animatio-0.0.1/.github/release.yml +37 -0
  2. unicode_animatio-0.0.1/.github/workflows/quality.yml +121 -0
  3. unicode_animatio-0.0.1/.github/workflows/release.yml +58 -0
  4. unicode_animatio-0.0.1/.gitignore +33 -0
  5. unicode_animatio-0.0.1/.pre-commit-config.yaml +35 -0
  6. unicode_animatio-0.0.1/API_COMPATIBILITY.md +54 -0
  7. unicode_animatio-0.0.1/CODE_OF_CONDUCT.md +120 -0
  8. unicode_animatio-0.0.1/CONTRIBUTING.md +147 -0
  9. unicode_animatio-0.0.1/LICENSE +21 -0
  10. unicode_animatio-0.0.1/Makefile +61 -0
  11. unicode_animatio-0.0.1/PKG-INFO +236 -0
  12. unicode_animatio-0.0.1/README.md +204 -0
  13. unicode_animatio-0.0.1/RELEASING.md +77 -0
  14. unicode_animatio-0.0.1/docs/README.md +21 -0
  15. unicode_animatio-0.0.1/docs/getting-started.md +39 -0
  16. unicode_animatio-0.0.1/docs/source-tree-owner-map.md +58 -0
  17. unicode_animatio-0.0.1/examples/terminal_demo.py +97 -0
  18. unicode_animatio-0.0.1/pyproject.toml +61 -0
  19. unicode_animatio-0.0.1/scripts/release_check.py +73 -0
  20. unicode_animatio-0.0.1/scripts/validate_commit_message.py +105 -0
  21. unicode_animatio-0.0.1/src/unicode_animations/__init__.py +28 -0
  22. unicode_animatio-0.0.1/src/unicode_animations/__main__.py +5 -0
  23. unicode_animatio-0.0.1/src/unicode_animations/braille.py +673 -0
  24. unicode_animatio-0.0.1/src/unicode_animations/cli.py +108 -0
  25. unicode_animatio-0.0.1/src/unicode_animations/py.typed +0 -0
  26. unicode_animatio-0.0.1/src/unicode_animations/web.py +348 -0
  27. unicode_animatio-0.0.1/tests/conftest.py +7 -0
  28. unicode_animatio-0.0.1/tests/expected_spinners.json +305 -0
  29. unicode_animatio-0.0.1/tests/test_braille.py +105 -0
  30. unicode_animatio-0.0.1/tests/test_cli.py +33 -0
  31. unicode_animatio-0.0.1/tests/test_package.py +8 -0
  32. unicode_animatio-0.0.1/tests/test_package_layout.py +44 -0
  33. unicode_animatio-0.0.1/tests/test_package_metadata.py +30 -0
  34. unicode_animatio-0.0.1/tests/test_web.py +49 -0
@@ -0,0 +1,37 @@
1
+ changelog:
2
+ exclude:
3
+ labels:
4
+ - skip-release-notes
5
+ authors:
6
+ - github-actions
7
+ categories:
8
+ - title: Breaking Changes
9
+ labels:
10
+ - breaking-change
11
+ - semver-major
12
+ - title: Features
13
+ labels:
14
+ - feature
15
+ - enhancement
16
+ - semver-minor
17
+ - title: Fixes
18
+ labels:
19
+ - fix
20
+ - bug
21
+ - bugfix
22
+ - title: Docs
23
+ labels:
24
+ - docs
25
+ - documentation
26
+ - title: Maintenance
27
+ labels:
28
+ - chore
29
+ - refactor
30
+ - build
31
+ - ci
32
+ - test
33
+ - dependencies
34
+ - release
35
+ - title: Other Changes
36
+ labels:
37
+ - "*"
@@ -0,0 +1,121 @@
1
+ name: Quality
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main, dev]
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ quality:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.11"
23
+
24
+ - name: Install dev environment
25
+ run: make dev-install
26
+
27
+ - name: Validate pre-commit config
28
+ run: ./.venv/bin/python3.11 -m pre_commit validate-config
29
+
30
+ - name: Run pre-commit on changed files
31
+ env:
32
+ BEFORE_SHA: ${{ github.event.before }}
33
+ run: |
34
+ set -euo pipefail
35
+ if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
36
+ git fetch --no-tags origin "${GITHUB_BASE_REF}"
37
+ base_commit="$(git merge-base HEAD FETCH_HEAD)"
38
+ ./.venv/bin/python3.11 -m pre_commit run \
39
+ --from-ref "${base_commit}" \
40
+ --to-ref HEAD \
41
+ --show-diff-on-failure
42
+ exit 0
43
+ fi
44
+ if [[ -n "${BEFORE_SHA}" && "${BEFORE_SHA}" != "0000000000000000000000000000000000000000" ]]; then
45
+ ./.venv/bin/python3.11 -m pre_commit run \
46
+ --from-ref "${BEFORE_SHA}" \
47
+ --to-ref HEAD \
48
+ --show-diff-on-failure
49
+ exit 0
50
+ fi
51
+ files=(
52
+ .pre-commit-config.yaml
53
+ .github/release.yml
54
+ .github/workflows/release.yml
55
+ .github/workflows/quality.yml
56
+ CONTRIBUTING.md
57
+ docs/getting-started.md
58
+ Makefile
59
+ README.md
60
+ pyproject.toml
61
+ scripts/validate_commit_message.py
62
+ )
63
+ ./.venv/bin/python3.11 -m pre_commit run \
64
+ --files "${files[@]}" \
65
+ --show-diff-on-failure
66
+
67
+ - name: Validate pushed commit messages
68
+ env:
69
+ BEFORE_SHA: ${{ github.event.before }}
70
+ run: |
71
+ set -euo pipefail
72
+ commits=()
73
+ if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
74
+ if [[ "${GITHUB_HEAD_REF}" == "dev" && "${GITHUB_BASE_REF}" == "main" ]]; then
75
+ # Long-lived dev pushes already validate each new commit on push.
76
+ # Re-validating the full dev ancestry here would fail on older
77
+ # branch history that predates the current commit policy.
78
+ commits=(HEAD)
79
+ else
80
+ git fetch --no-tags --depth=1 origin "${GITHUB_BASE_REF}"
81
+ base_commit="$(git merge-base HEAD FETCH_HEAD)"
82
+ mapfile -t commits < <(git rev-list --reverse "${base_commit}..HEAD")
83
+ fi
84
+ elif [[ -n "${BEFORE_SHA}" && "${BEFORE_SHA}" != "0000000000000000000000000000000000000000" ]]; then
85
+ mapfile -t commits < <(git rev-list --reverse "${BEFORE_SHA}..HEAD")
86
+ fi
87
+ if [[ ${#commits[@]} -eq 0 ]]; then
88
+ commits=(HEAD)
89
+ fi
90
+ for commit in "${commits[@]}"; do
91
+ subject="$(git log -1 --format=%s "${commit}")"
92
+ echo "Checking ${commit}: ${subject}"
93
+ ./.venv/bin/python3.11 scripts/validate_commit_message.py --subject "${subject}"
94
+ done
95
+
96
+ - name: Run package check
97
+ run: make check
98
+
99
+ - name: Run release smoke
100
+ run: make release-check
101
+
102
+ compatibility:
103
+ runs-on: ubuntu-latest
104
+ strategy:
105
+ fail-fast: false
106
+ matrix:
107
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
108
+ steps:
109
+ - uses: actions/checkout@v4
110
+
111
+ - uses: actions/setup-python@v5
112
+ with:
113
+ python-version: ${{ matrix.python-version }}
114
+
115
+ - name: Install compatibility test dependencies
116
+ run: |
117
+ python -m pip install --upgrade pip
118
+ pip install -e ".[dev]"
119
+
120
+ - name: Run compatibility tests
121
+ run: pytest -q
@@ -0,0 +1,58 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ workflow_dispatch:
7
+ inputs:
8
+ target:
9
+ description: "Package index target"
10
+ required: true
11
+ default: "testpypi"
12
+ type: choice
13
+ options:
14
+ - testpypi
15
+ - pypi
16
+
17
+ permissions:
18
+ contents: read
19
+ id-token: write
20
+
21
+ jobs:
22
+ build-and-publish:
23
+ runs-on: ubuntu-latest
24
+ environment: ${{ github.event_name == 'workflow_dispatch' && inputs.target || (contains(github.ref_name, 'rc') && 'testpypi' || 'pypi') }}
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+
28
+ - uses: actions/setup-python@v5
29
+ with:
30
+ python-version: "3.11"
31
+
32
+ - name: Install dev environment
33
+ run: make dev-install
34
+
35
+ - name: Run hooks
36
+ run: make hooks-run
37
+
38
+ - name: Run package check
39
+ run: make check
40
+
41
+ - name: Run release check
42
+ run: make release-check
43
+
44
+ - name: Upload built distributions
45
+ uses: actions/upload-artifact@v4
46
+ with:
47
+ name: unicode-animatio-dist
48
+ path: dist/*
49
+
50
+ - name: Publish to TestPyPI
51
+ if: ${{ (github.event_name == 'workflow_dispatch' && inputs.target == 'testpypi') || (github.event_name == 'push' && contains(github.ref_name, 'rc')) }}
52
+ uses: pypa/gh-action-pypi-publish@release/v1
53
+ with:
54
+ repository-url: https://test.pypi.org/legacy/
55
+
56
+ - name: Publish to PyPI
57
+ if: ${{ (github.event_name == 'push' && !contains(github.ref_name, 'rc')) || (github.event_name == 'workflow_dispatch' && inputs.target == 'pypi') }}
58
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,33 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ env/
16
+
17
+ # Test / coverage
18
+ .pytest_cache/
19
+ .coverage
20
+ coverage.xml
21
+ htmlcov/
22
+
23
+ # Type checker / linter caches
24
+ .mypy_cache/
25
+ .ruff_cache/
26
+
27
+ # IDE / OS
28
+ .DS_Store
29
+ .vscode/
30
+ .idea/
31
+
32
+ # Sweep and review artifacts
33
+ workspace-tmp/
@@ -0,0 +1,35 @@
1
+ default_install_hook_types: [pre-commit, commit-msg]
2
+
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v6.0.0
6
+ hooks:
7
+ - id: trailing-whitespace
8
+ - id: end-of-file-fixer
9
+ - id: check-yaml
10
+ args: [--allow-multiple-documents]
11
+ - id: check-toml
12
+ - id: check-merge-conflict
13
+
14
+ - repo: https://github.com/rhysd/actionlint
15
+ rev: v1.7.10
16
+ hooks:
17
+ - id: actionlint
18
+
19
+ - repo: local
20
+ hooks:
21
+ - id: commit-message-policy
22
+ name: commit message policy
23
+ entry: ./.venv/bin/python3.11 scripts/validate_commit_message.py
24
+ language: system
25
+ stages: [commit-msg]
26
+ - id: ruff-check
27
+ name: ruff check --fix
28
+ entry: ./.venv/bin/python3.11 -m ruff check --fix
29
+ language: system
30
+ types_or: [python, pyi]
31
+ - id: ruff-format
32
+ name: ruff format
33
+ entry: ./.venv/bin/python3.11 -m ruff format
34
+ language: system
35
+ types_or: [python, pyi]
@@ -0,0 +1,54 @@
1
+ # unicode-animatio API Compatibility
2
+
3
+ Status: `beta`
4
+ Scope: public import roots and compatibility expectations for
5
+ `unicode-animatio`
6
+
7
+ Public naming note: the public distribution and CLI names use
8
+ `unicode-animatio`, while the Python import roots remain `unicode_animations`.
9
+
10
+ ## Stable import roots
11
+
12
+ The current public import roots are:
13
+
14
+ - `unicode_animations`
15
+ - `unicode_animations.cli`
16
+ - `unicode_animations.web`
17
+
18
+ ## Stable public names
19
+
20
+ The package currently treats these names as public:
21
+
22
+ - `Spinner`
23
+ - `BrailleSpinnerName`
24
+ - `BRAILLE_SPINNER_NAMES`
25
+ - `spinners`
26
+ - `make_grid`
27
+ - `grid_to_braille`
28
+ - `makeGrid`
29
+ - `gridToBraille`
30
+
31
+ ## CLI contract
32
+
33
+ The package currently treats these console scripts as public:
34
+
35
+ - `unicode-animatio`
36
+ - `unicode-animatio-web`
37
+
38
+ ## Compatibility policy
39
+
40
+ For the current beta surface:
41
+
42
+ - new public names may be added in minor releases
43
+ - existing public names should not be renamed or removed without a documented
44
+ compatibility note
45
+ - JS-style aliases remain part of the compatibility surface until this file
46
+ says otherwise
47
+
48
+ ## Non-contract internals
49
+
50
+ The package does not currently promise compatibility for:
51
+
52
+ - private helper functions prefixed with `_`
53
+ - the exact HTML/CSS markup of the local browser demo
54
+ - internal frame-generation helper structure in `braille.py`
@@ -0,0 +1,120 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as contributors and maintainers pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic
9
+ status, nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment include:
18
+
19
+ - Demonstrating empathy and kindness toward other people
20
+ - Being respectful of differing opinions, viewpoints, and experiences
21
+ - Giving and gracefully accepting constructive feedback
22
+ - Taking responsibility and apologizing to those affected by our mistakes
23
+ - Focusing on what is best for the overall community
24
+
25
+ Examples of unacceptable behavior include:
26
+
27
+ - The use of sexualized language or imagery, and sexual attention or advances
28
+ - Trolling, insulting or derogatory comments, and personal or political attacks
29
+ - Public or private harassment
30
+ - Publishing others' private information without their explicit permission
31
+ - Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Enforcement Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying and enforcing our standards
37
+ of acceptable behavior and will take appropriate and fair corrective action in
38
+ response to any behavior that they deem inappropriate, threatening, offensive,
39
+ or harmful.
40
+
41
+ Project maintainers have the right and responsibility to remove, edit, or
42
+ reject comments, commits, code, wiki edits, issues, and other contributions
43
+ that are not aligned to this Code of Conduct, and will communicate reasons for
44
+ moderation decisions when appropriate.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies within all project spaces and also applies when
49
+ an individual is officially representing the project in public spaces.
50
+ Examples of representing our project include using an official email address,
51
+ posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event.
53
+
54
+ ## Enforcement
55
+
56
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
57
+ reported by opening a private report to project maintainers through the
58
+ repository's communication channels. All complaints will be reviewed and
59
+ investigated promptly and fairly.
60
+
61
+ All maintainers are obligated to respect the privacy and security of the
62
+ reporter of any incident.
63
+
64
+ ## Enforcement Guidelines
65
+
66
+ Project maintainers will follow these Community Impact Guidelines in
67
+ determining consequences for any action they deem in violation of this Code of
68
+ Conduct:
69
+
70
+ ### 1. Correction
71
+
72
+ **Community Impact:** Use of inappropriate language or other behavior deemed
73
+ unprofessional or unwelcome in the community.
74
+
75
+ **Consequence:** A private, written warning from maintainers, providing
76
+ clarity around the nature of the violation and an explanation of why the
77
+ behavior was inappropriate. A public apology may be requested.
78
+
79
+ ### 2. Warning
80
+
81
+ **Community Impact:** A violation through a single incident or series of
82
+ actions.
83
+
84
+ **Consequence:** A warning with consequences for continued behavior. No
85
+ interaction with the people involved, including unsolicited interaction with
86
+ those enforcing the Code of Conduct, for a specified period of time. This
87
+ includes avoiding interactions in community spaces as well as external
88
+ channels like social media. Violating these terms may lead to a temporary or
89
+ permanent ban.
90
+
91
+ ### 3. Temporary Ban
92
+
93
+ **Community Impact:** A serious violation of community standards, including
94
+ sustained inappropriate behavior.
95
+
96
+ **Consequence:** A temporary ban from any sort of interaction or public
97
+ communication with the community for a specified period of time. No public or
98
+ private interaction with the people involved, including unsolicited
99
+ interaction with those enforcing the Code of Conduct, is allowed during this
100
+ period. Violating these terms may lead to a permanent ban.
101
+
102
+ ### 4. Permanent Ban
103
+
104
+ **Community Impact:** Demonstrating a pattern of violation of community
105
+ standards, including sustained inappropriate behavior, harassment of an
106
+ individual, or aggression toward or disparagement of classes of individuals.
107
+
108
+ **Consequence:** A permanent ban from any sort of public interaction within
109
+ the community.
110
+
111
+ ## Attribution
112
+
113
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
114
+ version 2.1, available at
115
+ https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
116
+
117
+ Community Impact Guidelines were inspired by
118
+ https://github.com/mozilla/diversity.
119
+
120
+ [homepage]: https://www.contributor-covenant.org
@@ -0,0 +1,147 @@
1
+ # Contributing to unicode-animatio
2
+
3
+ Thanks for your interest in improving `unicode-animatio`.
4
+
5
+ ## Read first
6
+
7
+ 1. [README.md](./README.md)
8
+ 2. [API_COMPATIBILITY.md](./API_COMPATIBILITY.md)
9
+ 3. [docs/README.md](./docs/README.md)
10
+ 4. [docs/getting-started.md](./docs/getting-started.md)
11
+ 5. [docs/source-tree-owner-map.md](./docs/source-tree-owner-map.md)
12
+ 6. [RELEASING.md](./RELEASING.md) when the work affects packaging or release
13
+ behavior
14
+
15
+ Treat the package README and API compatibility policy as the stable public
16
+ contract. `unicode-animatio` ships deterministic frame data, CLI helpers, and
17
+ simple browser preview support. It should stay lightweight and dependency-aware.
18
+
19
+ ## Development setup
20
+
21
+ Requires Python 3.11+ for the shared local quality loop.
22
+
23
+ ```bash
24
+ # 1. Clone and enter the repo
25
+ git clone https://github.com/openminion/unicode-animatio.git unicode-animatio
26
+ cd unicode-animatio
27
+
28
+ # 2. Create and activate a virtualenv
29
+ python3.11 -m venv .venv
30
+ source .venv/bin/activate
31
+
32
+ # 3. Install in editable mode with dev extras
33
+ make dev-install
34
+
35
+ # 4. Install local hooks, including commit-message enforcement
36
+ make hooks-install
37
+ ```
38
+
39
+ ## Running tests
40
+
41
+ ```bash
42
+ # Full package test suite
43
+ make test
44
+
45
+ # Full local quality gate
46
+ make check
47
+
48
+ # Release/install smoke
49
+ make release-check
50
+ ```
51
+
52
+ If you need a narrower loop while iterating, run `python3.11 -m pytest -q
53
+ tests/<target>` inside the activated virtualenv.
54
+
55
+ ## Running lint and formatting
56
+
57
+ ```bash
58
+ # Lint only
59
+ make lint
60
+
61
+ # Check formatting without rewriting files
62
+ make format-check
63
+
64
+ # Apply formatting and autofixes
65
+ make fix
66
+ ```
67
+
68
+ If pre-commit, `make hooks-run`, or GitHub Actions reports formatter changes,
69
+ run `make fix`, review the diff, rerun `make check`, and recommit before
70
+ pushing again.
71
+
72
+ ## Running the demos
73
+
74
+ Terminal demo (Python API):
75
+
76
+ ```bash
77
+ python examples/terminal_demo.py
78
+ ```
79
+
80
+ CLI demo:
81
+
82
+ ```bash
83
+ unicode-animatio --list
84
+ unicode-animatio helix
85
+ unicode-animatio --web
86
+ ```
87
+
88
+ ## Development basics
89
+
90
+ 1. Keep pull requests focused and small when possible.
91
+ 2. Include tests for behavior changes.
92
+ 3. Keep frame definitions deterministic and easy to inspect.
93
+ 4. Avoid growing the package into a stateful runtime or unrelated UI framework.
94
+ 5. Keep docs and examples copy/paste friendly.
95
+
96
+ Commit message guidance:
97
+
98
+ 1. Use commit messages in the form `<type>: <summary>` or
99
+ `<type>(<scope>): <summary>`.
100
+ 2. Approved current types are `feat`, `fix`, `docs`, `refactor`, `test`,
101
+ `chore`, `style`, and `build`.
102
+ 3. In this package, scope is optional but encouraged when it improves owner
103
+ clarity, for example `cli`, `web`, `braille`, `docs`, or `release`.
104
+ 4. Keep the summary specific to the landed change and avoid vague messages like
105
+ `update`.
106
+ 5. Prefer the most specific truthful type; do not use `chore` when `docs`,
107
+ `test`, `refactor`, or `build` is more accurate.
108
+ 6. Do not use local shorthand or planning labels as normal commit types.
109
+
110
+ The same policy runs locally through `make hooks-install` and again in GitHub
111
+ Actions on pull requests plus `dev`/`main` pushes.
112
+
113
+ Preferred PR shape:
114
+
115
+ `Improve browser preview packaging checks`
116
+
117
+ - add ...
118
+ - align ...
119
+ - document ...
120
+
121
+ Validation
122
+ - `<command>`
123
+ - `<command>`
124
+
125
+ ## Pull requests
126
+
127
+ 1. Be respectful and collaborative. Please follow the
128
+ [Code of Conduct](CODE_OF_CONDUCT.md).
129
+ 2. Make your change; add or update tests; run the relevant local validation.
130
+ 3. Open a PR with a clear summary. Use a short GitHub-native title, then flat
131
+ line-item bullets, then a plain `Validation` label with exact command
132
+ bullets.
133
+ 4. Keep PRs focused and reviewable.
134
+
135
+ ## Reporting issues
136
+
137
+ If you find a bug or have a feature request, please open an issue with:
138
+
139
+ 1. What you expected to happen
140
+ 2. What happened instead
141
+ 3. Steps to reproduce
142
+ 4. Python version and OS details
143
+
144
+ ## License
145
+
146
+ By contributing to this project, you agree that your contributions will be
147
+ licensed under the [MIT License](LICENSE).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 unicode-animatio contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,61 @@
1
+ REPO_ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
2
+ VENV := $(REPO_ROOT)/.venv
3
+ DEV_STAMP := $(VENV)/.baseline-tools-installed
4
+ PYTHON := $(VENV)/bin/python3.11
5
+ PIP := $(PYTHON) -m pip
6
+ PRE_COMMIT := $(PYTHON) -m pre_commit
7
+ PYTEST := $(PYTHON) -m pytest
8
+ RUFF := $(PYTHON) -m ruff
9
+
10
+ .PHONY: help venv dev-install hooks-install hooks-run fix format format-check lint test check release-check
11
+
12
+ help:
13
+ @printf '%s\n' \
14
+ 'Targets:' \
15
+ ' make dev-install Create/update .venv and install unicode-animatio with dev extras' \
16
+ ' make hooks-install Install pre-commit and commit-msg hooks into .git/hooks' \
17
+ ' make hooks-run Run pre-commit across the unicode-animatio repo' \
18
+ ' make fix Apply Ruff formatting and autofixes' \
19
+ ' make format Run Ruff formatter' \
20
+ ' make format-check Check formatting without changing files' \
21
+ ' make lint Run Ruff lint' \
22
+ ' make test Run package pytest suite' \
23
+ ' make check Run format-check, lint, and test' \
24
+ ' make release-check Run package release smoke'
25
+
26
+ venv:
27
+ @test -x "$(PYTHON)" || python3.11 -m venv "$(VENV)"
28
+
29
+ $(DEV_STAMP): pyproject.toml | venv
30
+ $(PIP) install --upgrade pip setuptools wheel
31
+ cd "$(REPO_ROOT)" && $(PIP) install -e ".[dev]"
32
+ @touch "$(DEV_STAMP)"
33
+
34
+ dev-install: $(DEV_STAMP)
35
+
36
+ hooks-install: $(DEV_STAMP)
37
+ $(PRE_COMMIT) install --install-hooks --hook-type pre-commit --hook-type commit-msg
38
+
39
+ hooks-run: $(DEV_STAMP)
40
+ $(PRE_COMMIT) run --all-files
41
+
42
+ fix: $(DEV_STAMP)
43
+ $(RUFF) format "$(REPO_ROOT)"
44
+ $(RUFF) check --fix "$(REPO_ROOT)"
45
+
46
+ format: $(DEV_STAMP)
47
+ $(RUFF) format "$(REPO_ROOT)"
48
+
49
+ format-check: $(DEV_STAMP)
50
+ $(RUFF) format --check "$(REPO_ROOT)"
51
+
52
+ lint: $(DEV_STAMP)
53
+ $(RUFF) check "$(REPO_ROOT)"
54
+
55
+ test: $(DEV_STAMP)
56
+ PYTHONPATH="$(REPO_ROOT)/src" $(PYTEST) -q "$(REPO_ROOT)/tests"
57
+
58
+ check: format-check lint test
59
+
60
+ release-check: $(DEV_STAMP)
61
+ cd "$(REPO_ROOT)" && $(PYTHON) scripts/release_check.py