This page describes common problems that may happen when setting up or running the project.
The goal is to help you slow down, read the error, and check the most likely cause.
When something fails, start with:
git status
uv --version
uv sync
uv run ruff check .
uv run ruff format --check .
uv run rumdl check .
uv run mkdocs build --strict
uv run pytest --cov=text_toolkit --cov-report=term-missing
uv run mypyDo not change many things at once.
Read the first error message carefully.
Fix one problem, then run the checks again.
You run:
uv --versionand the terminal says that uv is not found.
uv is not installed, or the terminal does not see it in PATH.
Install uv.
macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Then restart the terminal and check again:
uv --versionuv reports that the requested Python version is not installed.
The project uses .python-version, but that Python version is not available locally yet.
Run:
uv python installThen sync the environment:
uv syncYou expected a .venv/ directory, but it does not exist.
The project environment has not been synchronized yet.
Run:
uv syncExpected result:
.venv/
The .venv/ directory is local.
Do not commit it to Git.
Running tests fails with an import error, for example:
ModuleNotFoundError: No module named 'text_toolkit'
The project uses a src/ layout, but it was not installed into the environment.
Check that pyproject.toml contains a build system:
[build-system]
requires = ["uv_build>=0.12.19,<0.13"]
build-backend = "uv_build"Then run:
uv sync
uv run pytestThe sync output should show that text-toolkit was built and installed from the
local project.
You run:
uv run pytestand pytest is not available.
Development dependencies were not installed or pytest is missing from the development dependency group.
Check that pyproject.toml contains something similar to:
[dependency-groups]
dev = [
"pytest>=9.0.3",
"ruff>=0.15.12",
]Then run:
uv sync
uv run pytestIf pytest is missing, add it:
uv add --group dev pytestCommit both:
pyproject.toml
uv.lock
You run:
uv run ruff check .and Ruff is not available.
Ruff is not installed as a development dependency.
Add Ruff:
uv add --group dev ruffThen run:
uv run ruff check .
uv run ruff format --check .Commit both:
pyproject.toml
uv.lock
This command fails:
uv run ruff format --check .Some files are not formatted according to Ruff.
Run:
uv run ruff format .Then check again:
uv run ruff check .
uv run ruff format --check .
uv run rumdl check .
uv run mkdocs build --strict
uv run pytest --cov=text_toolkit --cov-report=term-missing
uv run mypyThis command fails:
uv run ruff check .Ruff found a linting issue.
Examples:
- unused import,
- unsorted imports,
- undefined name,
- outdated syntax,
- suspicious pattern.
Read the Ruff message.
If Ruff offers an automatic fix, you can try:
uv run ruff check . --fixThen run all checks again:
uv run ruff check .
uv run ruff format --check .
uv run rumdl check .
uv run mkdocs build --strict
uv run pytest --cov=text_toolkit --cov-report=term-missing
uv run mypyDo not blindly apply fixes without reviewing the diff.
Check:
git diffThis command is unavailable or reports a type error:
uv run mypy- the local environment is out of sync,
- mypy is missing from the development dependency group,
- code does not match its type annotations.
Sync the environment first:
uv sync
uv run mypyWhen adding mypy to a different project, record it as a development dependency:
uv add --group dev mypyFor a type error, read the file path, line number, and error code. Fix the code or its annotation instead of adding a broad ignore without understanding the problem.
This command fails:
uv run pytestThe code behavior does not match the expected behavior in tests.
Read the failing test name first.
Then read the assertion error.
Useful command:
uv run pytest -vIf needed, run one test file:
uv run pytest tests/test_text_stats.pyFix the code or the test, depending on what is actually wrong.
Then run:
uv run ruff check .
uv run ruff format --check .
uv run rumdl check .
uv run mkdocs build --strict
uv run pytest --cov=text_toolkit --cov-report=term-missing
uv run mypyTests may pass without coverage, but this command fails:
uv run pytest --cov=text_toolkit --cov-report=term-missing- pytest-cov is missing from the development dependency group,
- the local environment is out of sync,
- the package name passed to
--covis incorrect, - coverage configuration is invalid.
Sync dependencies and retry:
uv sync
uv run pytest --cov=text_toolkit --cov-report=term-missingCheck that pyproject.toml contains pytest-cov and the [tool.coverage.run]
section. A lower percentage by itself does not fail this project because no
fail_under threshold is configured.
This command reports one or more rule violations:
uv run rumdl check .- a heading level was skipped,
- a list or code fence is missing surrounding blank lines,
- a fenced code block has no language identifier,
- Markdown structure or style is inconsistent,
- a deliberate project pattern needs a narrow exception.
Read the rule identifier and inspect the reported line. Fix the structure when it is genuinely inconsistent.
For automatically fixable issues, you may run:
uv run rumdl check --fix .
git diffReview every automatic change. Configure an exception only when the existing Markdown is intentional and the reason can be explained.
The strict documentation build exits with an error:
uv run mkdocs build --strict- a page is missing from
mkdocs.yml, - a navigation target does not exist,
- a document link or heading anchor is incorrect,
- MkDocs emitted a warning that strict mode treats as an error.
Read the first warning, correct the referenced page or navigation entry, and run the strict build again.
For visual review, start the local server:
uv run mkdocs serveIf port 8000 is already in use, choose another address:
uv run mkdocs serve --dev-addr 127.0.0.1:8001The Documentation workflow builds the site but cannot deploy it.
- Pages is not configured to use GitHub Actions as its source,
- the deploy job is missing
pages: writeorid-token: write, - the build job did not upload the
github-pagesartifact, - an environment protection rule is waiting for approval,
- GitHub Pages or Actions is temporarily unavailable.
Open Settings → Pages and confirm that Source is GitHub Actions.
Then inspect the first useful error in the failed Deploy documentation job.
Do not commit site/ or create a gh-pages branch to work around this workflow.
Fix the configuration in a new pull request and rerun the deployment after it
reaches main.
If the workflow passed but the site still shows old content, open the deployment URL reported by the job and confirm that the expected commit triggered the run.
Git stops a commit because a hook failed or modified a file.
- a file contains trailing whitespace or invalid YAML or TOML,
- unresolved merge conflict markers remain,
- Ruff found or fixed a Python issue,
- a hook changed a file that must be staged again.
Review both the hook output and the resulting diff:
git diff
uv run pre-commit run --all-filesIf a hook fixed a file, stage the reviewed change and try the commit again. Do not bypass the hook merely because it changed a file.
If pre-commit itself is missing, sync the development environment:
uv sync
uv run pre-commit installCI fails during:
uv sync --locked --group devpyproject.toml changed, but uv.lock was not updated.
CI uses uv sync --locked --group dev because it should verify the committed
project state and explicitly install the development tools, not silently update
files.
Run locally:
uv syncor:
uv lockThen commit:
pyproject.toml
uv.lock
Run checks again:
uv run ruff check .
uv run ruff format --check .
uv run rumdl check .
uv run mkdocs build --strict
uv run pytest --cov=text_toolkit --cov-report=term-missing
uv run mypyThe pull request contains many files from:
.venv/
The virtual environment was added to Git accidentally.
Make sure .gitignore contains:
.venv/Remove .venv/ from Git tracking:
git rm -r --cached .venvThen commit the cleanup:
git add .gitignore
git commit -m "chore: stop tracking virtual environment"The local .venv/ directory can still exist on your machine.
It should just not be tracked by Git.
The pull request contains files such as:
__pycache__/
.pytest_cache/
.ruff_cache/
.mypy_cache/
Generated cache files were added to Git accidentally.
Make sure .gitignore contains:
__pycache__/
.pytest_cache/
.ruff_cache/
.mypy_cache/Remove cached files from Git tracking if needed:
git rm -r --cached __pycache__ .pytest_cache .ruff_cache .mypy_cacheSome directories may not exist. That is fine.
Then commit the cleanup.
You run:
git statusand see modified or untracked files.
You changed files locally, generated files appeared, or formatting changed files.
Review the changes:
git diffFor staged changes:
git diff --stagedIf the changes are correct, commit them.
If a generated file appears, add it to .gitignore or remove it from Git tracking.
Do not commit files you do not understand.
Your branch is outdated compared to main.
Other pull requests were merged after you created your branch.
Update main:
git switch main
git pullThen update your branch.
For a beginner-friendly workflow, the simplest option is often to create a fresh branch from the updated main and reapply a small change.
If the branch contains more work, use Git carefully and ask for help before rewriting history.
The pull request shows files that are not related to the change.
Files were edited accidentally, generated files were committed, or the branch was used for more than one task.
Check:
git status
git diffRemove unrelated changes before committing.
If unrelated changes are already committed, consider making a new clean branch and copying only the intended changes.
Small pull requests are easier to fix.
Local checks pass, but GitHub Actions fails.
- uncommitted local changes,
- missing
uv.lockupdate, - different Python version,
- platform-specific behavior,
- stale branch,
- CI configuration issue.
Start with:
git status
uv sync
uv run ruff check .
uv run ruff format --check .
uv run rumdl check .
uv run mkdocs build --strict
uv run pytest --cov=text_toolkit --cov-report=term-missing
uv run mypyThen check whether these files were committed if they changed:
pyproject.toml
uv.lock
.github/workflows/ci.yml
If CI still fails, open the failed GitHub Actions run and read the first failing step.
The project worked before, but after:
git pulllocal checks fail.
New changes modified dependencies, tool configuration, tests, or source code.
Run:
uv sync
uv run ruff check .
uv run ruff format --check .
uv run rumdl check .
uv run mkdocs build --strict
uv run pytest --cov=text_toolkit --cov-report=term-missing
uv run mypyIf dependencies changed, uv sync is the important first step.
A Markdown file looks fine locally, but strange on GitHub.
- broken code fence,
- missing blank line,
- wrong indentation,
- nested code blocks,
- malformed list,
- broken link.
Review the rendered Markdown in the pull request.
Also inspect the raw diff.
Common things to check:
- every code fence starts and ends with triple backticks,
- lists have blank lines before code blocks,
- links use correct relative paths,
- headings are in the right order.
A README link returns 404 or points to the wrong file.
The file path is wrong, the file was renamed, or the link uses the wrong relative path.
For files inside docs/, use paths like:
[Glossary](docs/glossary.md)For links from one file inside docs/ to another file inside docs/, use:
[Glossary](glossary.md)Check links after opening the pull request.
A command works in one shell but not another.
Some commands are shell-specific.
For example:
mkdir -p src/example_project tests
touch src/example_project/__init__.pyworks in Bash, but PowerShell may need:
New-Item -ItemType Directory -Force src/example_project
New-Item -ItemType Directory -Force tests
New-Item -ItemType File -Force src/example_project/__init__.pyUse the command version for your shell.
This guide often shows both Bash and PowerShell examples when file creation commands differ.
Use this sequence:
git status
uv sync
uv run ruff check .
uv run ruff format --check .
uv run rumdl check .
uv run mkdocs build --strict
uv run pytest --cov=text_toolkit --cov-report=term-missing
uv run mypyThen:
- read the first error,
- fix one thing,
- run the checks again,
- review the diff,
- commit only related changes.
Most setup problems are caused by one of these:
- environment not synced,
- missing dependency,
- stale lockfile,
- wrong branch,
- generated files committed by mistake,
- local changes not committed,
- command run from the wrong directory.
Start with the simple checks before changing configuration.