echo-words 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 (40) hide show
  1. echo_words-0.0.1/.coveragerc +17 -0
  2. echo_words-0.0.1/.github/workflows/ci.yml +132 -0
  3. echo_words-0.0.1/.github/workflows/docs.yml +63 -0
  4. echo_words-0.0.1/.github/workflows/pip_publish.yml +91 -0
  5. echo_words-0.0.1/.github/workflows/static.yml +34 -0
  6. echo_words-0.0.1/.gitignore +15 -0
  7. echo_words-0.0.1/.pre-commit-config.yaml +74 -0
  8. echo_words-0.0.1/AGENTS.md +26 -0
  9. echo_words-0.0.1/CLAUDE.md +1 -0
  10. echo_words-0.0.1/LICENSE +20 -0
  11. echo_words-0.0.1/PKG-INFO +81 -0
  12. echo_words-0.0.1/README.md +44 -0
  13. echo_words-0.0.1/activate.sh +61 -0
  14. echo_words-0.0.1/build.sh +21 -0
  15. echo_words-0.0.1/docs/common/images/about.jpg +0 -0
  16. echo_words-0.0.1/docs/common/reference.md +4 -0
  17. echo_words-0.0.1/docs/includes/install_pipx_macos.sh +2 -0
  18. echo_words-0.0.1/docs/mkdocs.yml +45 -0
  19. echo_words-0.0.1/docs/src/en/index.md +16 -0
  20. echo_words-0.0.1/docs/src/en/installation.md +11 -0
  21. echo_words-0.0.1/docs/src/ru/index.md +11 -0
  22. echo_words-0.0.1/docs/src/ru/installation.md +11 -0
  23. echo_words-0.0.1/invoke.yml +5 -0
  24. echo_words-0.0.1/pyproject.toml +60 -0
  25. echo_words-0.0.1/pytest.ini +2 -0
  26. echo_words-0.0.1/scripts/__init__.py +0 -0
  27. echo_words-0.0.1/scripts/verup.sh +93 -0
  28. echo_words-0.0.1/scripts/verup_action.sh +88 -0
  29. echo_words-0.0.1/spec/decision-chat-interface.md +123 -0
  30. echo_words-0.0.1/spec/decision-spaced-repetition.md +275 -0
  31. echo_words-0.0.1/spec/decision-tts.md +116 -0
  32. echo_words-0.0.1/spec/functional-description.md +341 -0
  33. echo_words-0.0.1/spec/implementation-plan.md +1151 -0
  34. echo_words-0.0.1/spec/tickets/llmbroker-direct-streaming-client.md +111 -0
  35. echo_words-0.0.1/src/echo_words/__about__.py +1 -0
  36. echo_words-0.0.1/src/echo_words/__init__.py +9 -0
  37. echo_words-0.0.1/src/echo_words/main.py +33 -0
  38. echo_words-0.0.1/tasks.py +122 -0
  39. echo_words-0.0.1/tests/test_echo_words.py +15 -0
  40. echo_words-0.0.1/uv.lock +876 -0
@@ -0,0 +1,17 @@
1
+ [run]
2
+ relative_files = true
3
+ omit =
4
+ */tests/*
5
+ */*_check.py
6
+ */__init__.py
7
+ */conftest.py
8
+ */.tox/*
9
+ */.venv/*
10
+ */.eggs/*
11
+ */docs/*
12
+ */build/*
13
+ */dist/*
14
+ */.git/*
15
+ */.github/*
16
+ */.vscode/*
17
+ */.pytest_cache/*
@@ -0,0 +1,132 @@
1
+
2
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
3
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
4
+ #
5
+ name: CI
6
+
7
+ env:
8
+ PRIMARY_PYTHON_VERSION: '3.13'
9
+ PRIMARY_PLATFORM: 'ubuntu-latest'
10
+ PYTEST_CMD: >-
11
+ python -m pytest
12
+ --junitxml=pytest.xml
13
+ --cov-report=term-missing:skip-covered
14
+ --cov=src
15
+ tests/
16
+
17
+ on:
18
+ push:
19
+ branches: [ master, main ]
20
+ pull_request:
21
+ branches: [ master, main ]
22
+
23
+ permissions:
24
+ pull-requests: write
25
+ contents: write
26
+
27
+ jobs:
28
+ # Test compatibility with the matrix of Python versions and platforms
29
+ matrix-build:
30
+ strategy:
31
+ matrix:
32
+ python-version: [3.12, 3.13]
33
+ platform: [ubuntu-latest, macos-latest, windows-latest]
34
+ runs-on: ${{ matrix.platform }}
35
+
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: Set up Python ${{ matrix.python-version }}
40
+ uses: actions/setup-python@v5
41
+ with:
42
+ python-version: ${{ matrix.python-version }}
43
+
44
+
45
+ - name: Install uv environment
46
+ uses: andgineer/uv-venv@v3
47
+
48
+ - name: Install dependencies
49
+ run: uv sync --frozen --all-extras
50
+
51
+ - name: Test with pytest
52
+ run: ${{ env.PYTEST_CMD }}
53
+
54
+ # Build with publishing Allure report, coverage report
55
+ primary-build:
56
+ runs-on: ubuntu-latest
57
+ concurrency:
58
+ group: github-pages
59
+ cancel-in-progress: false
60
+
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+
64
+ - name: Set up Python ${{ env.PRIMARY_PYTHON_VERSION }}
65
+ uses: actions/setup-python@v5
66
+ with:
67
+ python-version: ${{ env.PRIMARY_PYTHON_VERSION }}
68
+
69
+
70
+ - name: Install uv environment
71
+ uses: andgineer/uv-venv@v3
72
+
73
+ - name: Install dependencies
74
+ run: uv sync --frozen --all-extras
75
+
76
+ - name: Test with pytest and Allure report
77
+ run: "${{ env.PYTEST_CMD }} --alluredir=./allure-results"
78
+
79
+ - name: Load Allure test report history
80
+ uses: actions/checkout@v4
81
+ if: always()
82
+ continue-on-error: true
83
+ with:
84
+ ref: gh-pages
85
+ path: gh-pages-dir
86
+
87
+ - name: Generate Allure test report
88
+ uses: andgineer/allure-report@v3.6
89
+ id: allure-report
90
+ if: always()
91
+ with:
92
+ allure-results: allure-results
93
+ website: gh-pages-dir
94
+ reports-site-path: builds/tests
95
+
96
+ - name: Publish Allure test report
97
+ uses: peaceiris/actions-gh-pages@v3
98
+ if: ${{ always() && (steps.allure-report.outcome == 'success') }}
99
+ with:
100
+ github_token: ${{ secrets.GITHUB_TOKEN }}
101
+ publish_branch: gh-pages
102
+ publish_dir: ${{ steps.allure-report.outputs.reports-site }}
103
+ destination_dir: ${{ steps.allure-report.outputs.reports-site-path }}
104
+
105
+ - name: Coverage comment
106
+ id: coverage_comment
107
+ if: always()
108
+ uses: py-cov-action/python-coverage-comment-action@v3
109
+ with:
110
+ GITHUB_TOKEN: ${{ github.token }}
111
+ MINIMUM_GREEN: 85
112
+ MINIMUM_ORANGE: 70
113
+
114
+ - name: Store Pull Request comment to be posted
115
+ uses: actions/upload-artifact@v4
116
+ if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
117
+ with:
118
+ name: python-coverage-comment-action
119
+ path: python-coverage-comment-action.txt
120
+
121
+ - name: Upload coverage data to coveralls.io
122
+ if: always()
123
+ continue-on-error: true
124
+ uses: coverallsapp/github-action@v2
125
+
126
+ - name: Upload Coverage to Codecov
127
+ if: always()
128
+ continue-on-error: true
129
+ uses: codecov/codecov-action@v4.0.1
130
+ with:
131
+ fail_ci_if_error: true
132
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,63 @@
1
+
2
+ # build docs from docstrings and markdown-file in folder docs
3
+ # publish them as github pages
4
+ #
5
+ #note for myself
6
+ #
7
+ # Do not forget to set git branch `gh-pages` as source for github pages.
8
+ # This branch auto-updated by `mkdocs gh-deploy`
9
+ #
10
+ name: docs
11
+ on:
12
+ push:
13
+ branches:
14
+ - main
15
+ - master
16
+
17
+ permissions:
18
+ contents: write
19
+
20
+ jobs:
21
+ deploy:
22
+ env:
23
+ PRIMARY_PYTHON_VERSION: '3.13'
24
+ runs-on: ubuntu-latest
25
+ concurrency:
26
+ group: github-pages
27
+ cancel-in-progress: false
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+
31
+ - name: Checkout gh-pages to backup Allure test reports
32
+ uses: actions/checkout@v4
33
+ with:
34
+ ref: gh-pages
35
+ path: gh-pages
36
+ continue-on-error: true
37
+
38
+ - uses: actions/setup-python@v5
39
+ with:
40
+ python-version: ${{ env.PRIMARY_PYTHON_VERSION }}
41
+
42
+
43
+ - name: Install uv environment
44
+ uses: andgineer/uv-venv@v3
45
+
46
+ - name: Install dependencies
47
+ run: |
48
+ uv sync --frozen --all-extras
49
+ uv pip install ghp-import
50
+
51
+
52
+ - name: Build documentation
53
+ run: inv build-docs
54
+
55
+ - name: Restore Allure test reports into build output
56
+ run: |
57
+ if [ -d gh-pages/builds ]; then
58
+ cp -r gh-pages/builds build/docs/site/builds
59
+ fi
60
+
61
+ - name: Deploy to GitHub Pages
62
+ run: |
63
+ ghp-import --no-jekyll --push --force build/docs/site
@@ -0,0 +1,91 @@
1
+
2
+ # This workflows will upload a Python Package using build system from pyproject.toml - when version
3
+ # tag is pushed and CI workflow is successful.
4
+ #
5
+ # To push the tag use `inv ver-release/feature/bag`.
6
+ #
7
+ # Put you pypi credentials (PYPI_USERNAME, PYPI_PASSWORD) into the github repository secrets
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ workflow_run:
13
+ workflows: ["CI"]
14
+ types: [completed]
15
+ branches:
16
+ - master
17
+ - main
18
+
19
+ permissions:
20
+ contents: write
21
+
22
+ jobs:
23
+ check_tag:
24
+ runs-on: ubuntu-latest
25
+ outputs:
26
+ has_tag: ${{ steps.check_tag.outputs.has_tag }}
27
+ version_tag: ${{ steps.check_tag.outputs.version_tag }}
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 0
32
+
33
+ - name: Check for version tag
34
+ id: check_tag
35
+ run: |
36
+ # Only accept semver tags like v1.2.3
37
+ TAG=$(git tag --points-at HEAD | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' || true)
38
+ if [ -n "$TAG" ]; then
39
+ echo "has_tag=true" >> $GITHUB_OUTPUT
40
+ # Strip leading 'v' for use in the workflow
41
+ echo "version_tag=${TAG#v}" >> $GITHUB_OUTPUT
42
+ else
43
+ echo "has_tag=false" >> $GITHUB_OUTPUT
44
+ fi
45
+
46
+ publish:
47
+ needs: check_tag
48
+ # Skip entire job unless a valid semver tag was found
49
+ if: needs.check_tag.outputs.has_tag == 'true'
50
+ env:
51
+ RELEASE_VERSION: ${{ needs.check_tag.outputs.version_tag }}
52
+ PRIMARY_PYTHON_VERSION: '3.13'
53
+ runs-on: ubuntu-latest
54
+
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+ with:
58
+ fetch-depth: 0
59
+
60
+ - name: Set up Python
61
+ uses: actions/setup-python@v5
62
+ with:
63
+ python-version: ${{ env.PRIMARY_PYTHON_VERSION }}
64
+
65
+
66
+ - name: Install uv environment
67
+ uses: andgineer/uv-venv@v3
68
+
69
+ - name: Install dependencies
70
+ run: uv sync --frozen --all-extras
71
+
72
+ - name: Build package
73
+ run: uv build
74
+
75
+ - name: Publish to PyPI
76
+ uses: pypa/gh-action-pypi-publish@release/v1
77
+ with:
78
+ user: ${{ secrets.PYPI_USERNAME }}
79
+ password: ${{ secrets.PYPI_PASSWORD }}
80
+ packages-dir: dist
81
+
82
+ - name: Create Release
83
+ id: create_release
84
+ uses: softprops/action-gh-release@v2
85
+ with:
86
+ name: Release ${{ env.RELEASE_VERSION }}
87
+ tag_name: ${{ env.RELEASE_VERSION }}
88
+
89
+ body: https://pypi.org/project/echo-words/${{ env.RELEASE_VERSION }}/
90
+ draft: false
91
+ prerelease: false
@@ -0,0 +1,34 @@
1
+
2
+ # build docs from docstrings and markdown-file in folder docs
3
+ # publish them as github pages
4
+ #
5
+ #note for myself
6
+ #
7
+ # Do not forget to set git branch `gh-pages` as source for github pages.
8
+ # This branch auto-updated by `mkdocs gh-deploy`
9
+ #
10
+ name: static source code checks
11
+ on:
12
+ push:
13
+ branches: [ master, main ]
14
+ pull_request:
15
+ branches: [ master, main ]
16
+
17
+ jobs:
18
+ static:
19
+ env:
20
+ PRIMARY_PYTHON_VERSION: '3.13'
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - uses: actions/setup-python@v5
25
+ with:
26
+ python-version: ${{ env.PRIMARY_PYTHON_VERSION }}
27
+
28
+
29
+ - name: Install uv environment
30
+ uses: andgineer/uv-venv@v3
31
+
32
+ - name: Install dependencies
33
+ run: uv sync --frozen --all-extras
34
+ - run: pre-commit run --verbose --all-files
@@ -0,0 +1,15 @@
1
+ .DS_Store
2
+ .idea/
3
+ .venv/
4
+ build/
5
+ dist/
6
+ **/__pycache__
7
+ **/.pytest_cache
8
+ **/*.egg-info
9
+ pytest.xml
10
+ .coverage
11
+ .dmypy.json
12
+ pytest-coverage.txt
13
+ *.py-e
14
+ **/.setup-scripts/
15
+ allure-results/
@@ -0,0 +1,74 @@
1
+ exclude: |
2
+ (?x)(
3
+ .venv/|
4
+ tasks.py|
5
+ resources/
6
+ )
7
+ repos:
8
+ - repo: https://github.com/pre-commit/pre-commit-hooks
9
+ rev: v6.0.0
10
+ hooks:
11
+ - id: check-yaml
12
+ - id: end-of-file-fixer
13
+ exclude_types: [ python ]
14
+ - id: trailing-whitespace
15
+ exclude_types: [ python ]
16
+ - repo: https://github.com/astral-sh/ruff-pre-commit
17
+ rev: v0.16.0
18
+ hooks:
19
+ - id: ruff
20
+ exclude: ^tests/
21
+ args: [
22
+ --fix,
23
+ --line-length=100,
24
+ --select=PL, # All Pylint rules
25
+ --select=A001, # Shadowing Python builtins
26
+ --select=ARG, # Unused function arguments
27
+ --select=B, # Bugbear rules (B002,B006,etc)
28
+ --select=BLE, # Blind except
29
+ --select=C, # Complexity
30
+ --select=COM, # Comma placement
31
+ --select=E, # pycodestyle errors
32
+ --select=F, # Pyflakes
33
+ --select=G, # Logging format
34
+ --select=I, # Import ordering
35
+ --select=ISC, # Implicit string concatenation
36
+ --select=N, # Naming
37
+ --select=PIE, # Misc rules
38
+ --select=Q, # Quotes
39
+ --select=RET, # Return statement
40
+ --select=S, # Security
41
+ --select=SIM, # Code simplification
42
+ --select=SLF, # Private member access
43
+ --select=TID, # Tidy imports
44
+ --select=TRY, # Exception handling
45
+ --select=UP, # Upgrade syntax
46
+ --select=W, # Warnings
47
+ '--ignore=B019,S101,G004,TRY003,TRY300,TRY301,TRY400' # Ignore docstring and `assert` detection
48
+ ]
49
+ - id: ruff
50
+ name: ruff-format-tests
51
+ files: ^tests/
52
+ args: [
53
+ --fix-only,
54
+ --line-length=100
55
+ ]
56
+ - id: ruff-format
57
+ args: [
58
+ --line-length=100
59
+ ]
60
+
61
+
62
+
63
+ - repo: https://github.com/facebook/pyrefly-pre-commit
64
+ rev: 1.2.0.dev2
65
+ hooks:
66
+ - id: pyrefly-check
67
+ name: pyrefly check
68
+ language: system
69
+ args: [
70
+ # "--ignore=missing-import",
71
+ # "--ignore=missing-source-for-stubs",
72
+ "--project-excludes=tests",
73
+ "--python-interpreter-path=.venv/bin/python"
74
+ ]
@@ -0,0 +1,26 @@
1
+ # wordgram — agent instructions
2
+
3
+ ## Where the specification lives
4
+
5
+ - `spec/functional-description.md` — WHAT to build. The source of
6
+ truth: on any conflict with other documents, it wins.
7
+ - `spec/implementation-plan.md` — HOW to build it: milestones M0–M8.
8
+ Work is driven by its "Execution protocol" section — one milestone
9
+ per session, strictly in order.
10
+ - `spec/decision-*.md` — background for settled decisions (chat
11
+ interface, spaced repetition, TTS). Do not re-open them.
12
+
13
+ ## Hard rules
14
+
15
+ - Python 3.12+, `src` layout, hatchling packaging — do not restructure
16
+ the packaging.
17
+ - Dependencies via `uv`; run `uv lock` when adding any (CI uses
18
+ `--frozen`).
19
+ - Every new module ships its tests in the same commit. A milestone is
20
+ done only when `uv run pytest` and `ruff check` (line-length 99) are
21
+ green.
22
+ - No real network, Telegram, Anki sync, or LLM/agent calls in tests —
23
+ fake or mock every boundary. The M0 harness in `experiments/` is the
24
+ sanctioned exception and stays out of CI.
25
+ - English-only comments and docs. All imports at module top level (the
26
+ one sanctioned exception is marked in the plan, M6).
@@ -0,0 +1 @@
1
+ Project rules and the pointer to the specification: @AGENTS.md
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2026 Andrey Sorokin (andrey@sorokin.engineer)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the “Software”), to deal in
5
+ the Software without restriction, including without limitation the rights to use,
6
+ copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ Software, and to permit persons to whom the Software is furnished to do so,
8
+ subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
14
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: echo-words
3
+ Version: 0.0.1
4
+ Summary: Turns words into rich linguistic insights and automatically adds them to your spaced repetition system.
5
+ Project-URL: Homepage, https://andgineer.github.io/echo-words/
6
+ Project-URL: Documentation, https://andgineer.github.io/echo-words/
7
+ Author-email: Andrey Sorokin <andrey@sorokin.engineer>
8
+ License: Copyright (c) 2026 Andrey Sorokin (andrey@sorokin.engineer)
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
11
+ this software and associated documentation files (the “Software”), to deal in
12
+ the Software without restriction, including without limitation the rights to use,
13
+ copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
14
+ Software, and to permit persons to whom the Software is furnished to do so,
15
+ subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
21
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27
+ OTHER DEALINGS IN THE SOFTWARE.
28
+ License-File: LICENSE
29
+ Keywords: one,two
30
+ Classifier: License :: OSI Approved :: MIT License
31
+ Classifier: Operating System :: OS Independent
32
+ Classifier: Programming Language :: Python :: 3
33
+ Requires-Python: >=3.12
34
+ Requires-Dist: click>=8.2.0
35
+ Requires-Dist: rich-click>=1.8.8
36
+ Description-Content-Type: text/markdown
37
+
38
+ [![Build Status](https://github.com/andgineer/echo-words/workflows/CI/badge.svg)](https://github.com/andgineer/echo-words/actions)
39
+ [![Coverage](https://raw.githubusercontent.com/andgineer/echo-words/python-coverage-comment-action-data/badge.svg)](https://htmlpreview.github.io/?https://github.com/andgineer/echo-words/blob/python-coverage-comment-action-data/htmlcov/index.html)
40
+ # echo-words
41
+
42
+ Turns words into rich linguistic insights and automatically adds them to your spaced repetition system.
43
+
44
+ # Documentation
45
+
46
+ [Echo Words](https://andgineer.github.io/echo-words/)
47
+
48
+
49
+
50
+ # Developers
51
+
52
+ Do not forget to run `. ./activate.sh`.
53
+
54
+ For work it need [uv](https://github.com/astral-sh/uv) installed.
55
+
56
+ Use [pre-commit](https://pre-commit.com/#install) hooks for code quality:
57
+
58
+ pre-commit install
59
+
60
+ ## Allure test report
61
+
62
+ * [Allure report](https://andgineer.github.io/echo-words/builds/tests/)
63
+
64
+ # Scripts
65
+ Install [invoke](https://docs.pyinvoke.org/en/stable/) preferably with [uv tool](https://docs.astral.sh/uv/):
66
+
67
+ uv tool install invoke
68
+
69
+ For a list of available scripts run:
70
+
71
+ invoke --list
72
+
73
+ For more information about a script run:
74
+
75
+ invoke <script> --help
76
+
77
+ ## Coverage report
78
+ * [Codecov](https://app.codecov.io/gh/andgineer/echo-words/tree/main/src%2Fecho_words)
79
+ * [Coveralls](https://coveralls.io/github/andgineer/echo-words)
80
+
81
+ > Created with cookiecutter using [template](https://github.com/andgineer/cookiecutter-python-package)
@@ -0,0 +1,44 @@
1
+ [![Build Status](https://github.com/andgineer/echo-words/workflows/CI/badge.svg)](https://github.com/andgineer/echo-words/actions)
2
+ [![Coverage](https://raw.githubusercontent.com/andgineer/echo-words/python-coverage-comment-action-data/badge.svg)](https://htmlpreview.github.io/?https://github.com/andgineer/echo-words/blob/python-coverage-comment-action-data/htmlcov/index.html)
3
+ # echo-words
4
+
5
+ Turns words into rich linguistic insights and automatically adds them to your spaced repetition system.
6
+
7
+ # Documentation
8
+
9
+ [Echo Words](https://andgineer.github.io/echo-words/)
10
+
11
+
12
+
13
+ # Developers
14
+
15
+ Do not forget to run `. ./activate.sh`.
16
+
17
+ For work it need [uv](https://github.com/astral-sh/uv) installed.
18
+
19
+ Use [pre-commit](https://pre-commit.com/#install) hooks for code quality:
20
+
21
+ pre-commit install
22
+
23
+ ## Allure test report
24
+
25
+ * [Allure report](https://andgineer.github.io/echo-words/builds/tests/)
26
+
27
+ # Scripts
28
+ Install [invoke](https://docs.pyinvoke.org/en/stable/) preferably with [uv tool](https://docs.astral.sh/uv/):
29
+
30
+ uv tool install invoke
31
+
32
+ For a list of available scripts run:
33
+
34
+ invoke --list
35
+
36
+ For more information about a script run:
37
+
38
+ invoke <script> --help
39
+
40
+ ## Coverage report
41
+ * [Codecov](https://app.codecov.io/gh/andgineer/echo-words/tree/main/src%2Fecho_words)
42
+ * [Coveralls](https://coveralls.io/github/andgineer/echo-words)
43
+
44
+ > Created with cookiecutter using [template](https://github.com/andgineer/cookiecutter-python-package)
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # "Set-ups or/and activates development environment"
4
+ #
5
+
6
+ VENV_FOLDER=".venv"
7
+
8
+ PRIMARY_PYTHON_VERSION="3.13" # sync with .github/workflows/docs.yml&static.yml
9
+
10
+ RED='\033[1;31m'
11
+ GREEN='\033[1;32m'
12
+ CYAN='\033[1;36m'
13
+ NC='\033[0m' # No Color
14
+
15
+ if ! (return 0 2>/dev/null) ; then
16
+ # If return is used in the top-level scope of a non-sourced script,
17
+ # an error message is emitted, and the exit code is set to 1
18
+ echo
19
+ echo -e $RED"This script should be sourced like"$NC
20
+ echo " . ./activate.sh"
21
+ echo
22
+ exit 1
23
+ fi
24
+
25
+
26
+ if [[ ! -d ${VENV_FOLDER} ]] ; then
27
+ unset CONDA_PREFIX # if conda is installed, it will mess with the virtual env
28
+
29
+ echo -e $CYAN"Creating virtual environment for python in ${VENV_FOLDER}"$NC
30
+ START_TIME=$(date +%s)
31
+
32
+ # Check if the required Python version is installed
33
+ if ! command -v python${PRIMARY_PYTHON_VERSION} &> /dev/null; then
34
+ echo -e $RED"Error: Python ${PRIMARY_PYTHON_VERSION} is not installed."$NC
35
+ echo -e $YELLOW"Please install Python ${PRIMARY_PYTHON_VERSION} before proceeding."$NC
36
+ echo -e $YELLOW"You can download it from https://www.python.org/downloads/"$NC
37
+ return 1
38
+ fi
39
+
40
+ if command -v uv &> /dev/null; then
41
+ if uv venv ${VENV_FOLDER} --python=python${PRIMARY_PYTHON_VERSION}; then
42
+
43
+ . ${VENV_FOLDER}/bin/activate
44
+ uv sync --frozen --all-extras
45
+ END_TIME=$(date +%s)
46
+ echo "Environment created in $((END_TIME - $START_TIME)) seconds"
47
+ else
48
+ echo -e $RED"Error creating virtual environment. Please check the output above for more details."$NC
49
+ return 1
50
+ fi
51
+ else
52
+
53
+ echo -e $RED"Error: Astral's UV is not installed."$NC
54
+ echo -e $YELLOW"Please install UV from https://github.com/astral-sh/uv before proceeding."$NC
55
+
56
+ return 1
57
+ fi
58
+ else
59
+ echo -e $CYAN"Activating virtual environment ..."$NC
60
+ . ${VENV_FOLDER}/bin/activate
61
+ fi
@@ -0,0 +1,21 @@
1
+ #! /usr/bin/env bash
2
+ # Builds dev version of the container(s)
3
+ # Pass all args to docker compose
4
+ #
5
+ # Examples:
6
+ # build.sh --no-cache
7
+
8
+ cleanup() {
9
+ # Function to clean up the .setup-scripts folder
10
+ rm -rf .setup-scripts
11
+ }
12
+
13
+ # Trap signals and execute the cleanup function
14
+ trap cleanup EXIT INT TERM ERR
15
+ cp -r ../../docker-scripts .setup-scripts
16
+ ./compose.sh \
17
+ build \
18
+ "$@"
19
+
20
+ # Cleanup the .setup-scripts folder (redundant, but ensures cleanup)
21
+ cleanup