Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codespell: config, workflow, pre-commit config and make it fix few typos #1219

Merged
merged 11 commits into from
Jan 23, 2024
Merged
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ repos:
- "packaging>=20"
- "platformdirs>=2.1"
- "tomli; python_version < '3.11'"
# Configuration for codespell is in pyproject.toml
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude: ^testdata
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) for keeping t

### Improved Documentation

- Add additonal example for --pip-args option, to docs/examples.md
- Add additional example for --pip-args option, to docs/examples.md

## [1.3.1](https://github.com/pypa/pipx/tree/1.3.1)

Expand Down
4 changes: 2 additions & 2 deletions docs/how-pipx-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
When installing a package and its binaries on linux (`pipx install package`) pipx will

- create directory `~/.local/share/pipx/venvs/PACKAGE`
- create or re-use a shared virtual environment that contains shared packaging library `pip` in
- create or reuse a shared virtual environment that contains shared packaging library `pip` in
`~/.local/share/pipx/shared/`
- ensure the library is updated to its latest version
- create a Virtual Environment in `~/.local/share/pipx/venvs/PACKAGE` that uses the shared pip mentioned above but
Expand All @@ -19,7 +19,7 @@ When installing a package and its binaries on linux (`pipx install package`) pip

When running a binary (`pipx run BINARY`), pipx will

- create or re-use a shared virtual environment that contains the shared packaging library `pip`
- create or reuse a shared virtual environment that contains the shared packaging library `pip`
- ensure the library is updated to its latest version
- create a temporary directory (or reuse a cached virtual environment for this package) with a name based on a hash of
the attributes that make the run reproducible. This includes things like the package name, spec, python version, and
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ lint.extend-select = [
lint.isort = {known-first-party = ["helpers", "package_info", "pipx"]}
lint.mccabe.max-complexity = 15

[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git,*.pdf,*.svg,.nox,testdata,.mypy_cache'
check-hidden = true
# case sensitive etc
ignore-regex = '\b(UE|path/doesnt/exist)\b'

[tool.pytest.ini_options]
markers = ["all_packages: test install with maximum number of packages"]

Expand Down
4 changes: 2 additions & 2 deletions src/pipx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def _add_run(subparsers: argparse._SubParsersAction, shared_parser: argparse.Arg
then run an app from it. The environment will be cached
and re-used for up to {constants.TEMP_VENV_EXPIRATION_THRESHOLD_DAYS} days. This
means subsequent calls to 'run' for the same package will be faster
since they can re-use the cached Virtual Environment.
since they can reuse the cached Virtual Environment.
In support of PEP 582 'run' will use apps found in a local __pypackages__
directory, if present. Please note that this behavior is experimental,
Expand All @@ -606,7 +606,7 @@ def _add_run(subparsers: argparse._SubParsersAction, shared_parser: argparse.Arg
p.add_argument(
"--no-cache",
action="store_true",
help="Do not re-use cached virtual environment if it exists",
help="Do not reuse cached virtual environment if it exists",
)
p.add_argument(
"app_with_args",
Expand Down