Skip to content

Commit 40c112a

Browse files
authored
Merge pull request #12628 from ichard26/codespell
2 parents 46a342b + 38fd2bb commit 40c112a

17 files changed

+33
-16
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ repos:
5454
types: [file]
5555
exclude: NEWS.rst # The errors flagged in NEWS.rst are old.
5656

57+
- repo: https://github.com/codespell-project/codespell
58+
rev: v2.2.6
59+
hooks:
60+
- id: codespell
61+
exclude: AUTHORS.txt|tests/data
62+
args: ["--ignore-words", tools/codespell-ignore.txt]
63+
5764
- repo: local
5865
hooks:
5966
- id: news-fragment-filenames

NEWS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ Improved Documentation
304304

305305
- Cross-reference the ``--python`` flag from the ``--prefix`` flag,
306306
and mention limitations of ``--prefix`` regarding script installation. (`#11775 <https://github.com/pypa/pip/issues/11775>`_)
307-
- Add SECURITY.md to make the policy offical. (`#11809 <https://github.com/pypa/pip/issues/11809>`_)
307+
- Add SECURITY.md to make the policy official. (`#11809 <https://github.com/pypa/pip/issues/11809>`_)
308308
- Add username to Git over SSH example. (`#11838 <https://github.com/pypa/pip/issues/11838>`_)
309309
- Quote extras in the pip install docs to guard shells with default glob
310310
qualifiers, like zsh. (`#11842 <https://github.com/pypa/pip/issues/11842>`_)

docs/html/ux-research-design/research-results/improving-pips-documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ We also:
3636
1. Asked for volunteers to participate in a diary study, documenting their experience solving pip problems. Unfortunately this was not completed due to lack of interest from the community.
3737
2. Asked for user feedback on the pip documentation site:
3838
![screenshot of user feedback mechanism on pip docs](https://i.imgur.com/WJVjl8N.png)
39-
Unfortunatly, we did not gather any useful feedback via this effort
39+
Unfortunately, we did not gather any useful feedback via this effort
4040
3. [Installed analytics on the pip docs](https://github.com/pypa/pip/pull/9146). We are waiting for this to be merged and start providing useful data.
4141

4242
## Results

docs/html/ux-research-design/research-results/personas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Making software was as defined earlier as "are you working on something reusable
180180
181181
> "I have written software, sometimes for business and personal reasons. At one point I worked on a django website project, that was being used by 1000s of people. I don't think any of my live projects are based.
182182
183-
> "Most of it is for sysadmin, automation. I lke to use python instead of shell scripting. I manage a server with wordpress sites. I wrote a script to update these sites, mailman list and sql DB management, and for different utilities." **- Participant 240313542**
183+
> "Most of it is for sysadmin, automation. I [like] to use python instead of shell scripting. I manage a server with wordpress sites. I wrote a script to update these sites, mailman list and sql DB management, and for different utilities." **- Participant 240313542**
184184
185185
> "I use Python for creating things - like outputs for data scientist, software engineer. I make software to look at patterns, and analyse stuff. I think I'm a maker because someone else is using - they are colleagues. Usually its non-technical colleagues. I produce outputs - make data understandable. They use the results, or a package it behind a flask app. Or analyse graphs." **- Participant 240426799**
186186

docs/html/ux-research-design/research-results/pip-upgrade-conflict.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ From the 407 responses that answered "why" a particular solution was best, the f
6464
Based on the results of this research, the pip UX team has made the following recommendations to the development team:
6565

6666
- While the current behaviour exists, [warn the user when conflicts are introduced](https://github.com/pypa/pip/issues/7744#issuecomment-717573440)
67-
- [Change the current behaviour](https://github.com/pypa/pip/issues/9094), so that pip takes into account packages that are already installed when upgrading other packages. Show the user a warning when pip anticipates a depdenency conflict (as per option 4)
67+
- [Change the current behaviour](https://github.com/pypa/pip/issues/9094), so that pip takes into account packages that are already installed when upgrading other packages. Show the user a warning when pip anticipates a dependency conflict (as per option 4)
6868
- Explore [the possibility of adding additional flags to the upgrade command](https://github.com/pypa/pip/issues/9095), to give users more control

docs/html/ux-research-design/research-results/prioritizing-features.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ Results varied by the amount of Python experience the user had.
8585

8686
![Screenshot of Warn about broken dependencies](https://i.imgur.com/uNv2tnG.png)
8787

88-
#### Upgrade packages to the lastest version
88+
#### Upgrade packages to the latest version
8989

90-
![Screenshot of Upgrade packages to the lastest version](https://i.imgur.com/pQgCLBO.png)
90+
![Screenshot of Upgrade packages to the latest version](https://i.imgur.com/pQgCLBO.png)
9191

9292
#### Install packages from an alternative package index, or indexes
9393

docs/html/ux-research-design/research-results/users-and-security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Participants who spent a lot of their time writing Python code - either for comm
6262

6363
They thought about where the software would be used, who would use it, and possible attack surfaces.
6464

65-
> "On the basic point, I have to think about attack surfaces. If I am writing the thing (software), I have to give a crap. I have to answer the emails! In the code I push to[ pypi.org](http://pypi.org/) I think about it doubley. What could people do with this code? Whether I do a good job, that's different! I am aware of it when publishing it or making it publically available. Whether I do a good job, that's different! I am aware of it when publishing it or making it publically available. I rely on community resources - Python security related, I follow security people blogs, Twitter. I use Hypothesis for fuzz-testing. I also rely on having security policies in place and a reporting mechanism. I steer clear of crypto, I rely on other peoples. There's a certain amount of knowledge in the Python community, I am actively involved in it. If something happens, I will hear about it. I use Twitter, if something happens, in the morning it can take me awhile to figure out what's happened. I have a lot of trust in the ecosystem to be self healing. As long as you don't stray too far-off the reservation (into using odd or uncommon or new packages), it's a better sense of security." **- Participant (data scientist turned Python developer)**
65+
> "On the basic point, I have to think about attack surfaces. If I am writing the thing (software), I have to give a crap. I have to answer the emails! In the code I push to[ pypi.org](http://pypi.org/) I think about it doubley. What could people do with this code? Whether I do a good job, that's different! I am aware of it when publishing it or making it [publicly] available. Whether I do a good job, that's different! I am aware of it when publishing it or making it [publicly] available. I rely on community resources - Python security related, I follow security people blogs, Twitter. I use Hypothesis for fuzz-testing. I also rely on having security policies in place and a reporting mechanism. I steer clear of crypto, I rely on other peoples. There's a certain amount of knowledge in the Python community, I am actively involved in it. If something happens, I will hear about it. I use Twitter, if something happens, in the morning it can take me awhile to figure out what's happened. I have a lot of trust in the ecosystem to be self healing. As long as you don't stray too far-off the reservation (into using odd or uncommon or new packages), it's a better sense of security." **- Participant (data scientist turned Python developer)**
6666

6767
> Yes, because I'm liable for that. If the problem is my code, and I deliver something and they get attacked. I'm screwed. **- Participant (professional Python developer and trainer)**
6868
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add codespell pre-commit hook to catch common misspellings.

src/pip/_internal/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _get_cache_path_parts(self, link: Link) -> List[str]:
4444
"""Get parts of part that must be os.path.joined with cache_dir"""
4545

4646
# We want to generate an url to use as our cache key, we don't want to
47-
# just re-use the URL because it might have other items in the fragment
47+
# just reuse the URL because it might have other items in the fragment
4848
# and we don't care about those.
4949
key_parts = {"url": link.url_without_fragment}
5050
if link.hash_name is not None and link.hash is not None:

src/pip/_internal/resolution/resolvelib/candidates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def _warn_invalid_extras(
519519
def _calculate_valid_requested_extras(self) -> FrozenSet[str]:
520520
"""Get a list of valid extras requested by this candidate.
521521
522-
The user (or upstream dependant) may have specified extras that the
522+
The user (or upstream dependent) may have specified extras that the
523523
candidate doesn't support. Any unsupported extras are dropped, and each
524524
cause a warning to be logged here.
525525
"""

src/pip/_internal/utils/_jaraco_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def join_continuation(lines):
8888
['foobarbaz']
8989
9090
Not sure why, but...
91-
The character preceeding the backslash is also elided.
91+
The character preceding the backslash is also elided.
9292
9393
>>> list(join_continuation(['goo\\', 'dly']))
9494
['godly']

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def virtualenv_template(
495495
dist_info, venv.site / dist_info.name, dirs_exist_ok=True, symlinks=True
496496
)
497497
# Create placeholder ``easy-install.pth``, as several tests depend on its
498-
# existance. TODO: Ensure ``tests.lib.TestPipResult.files_updated`` correctly
498+
# existence. TODO: Ensure ``tests.lib.TestPipResult.files_updated`` correctly
499499
# detects changed files.
500500
venv.site.joinpath("easy-install.pth").touch()
501501

tests/functional/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_no_network_imports(command: str, tmp_path: Path) -> None:
6969
This helps to reduce the startup time of these commands.
7070
7171
Note: This won't catch lazy network imports, but it'll catch top-level
72-
network imports which were accidently added (which is the most likely way
72+
network imports which were accidentally added (which is the most likely way
7373
to regress anyway).
7474
"""
7575
file = tmp_path / f"imported_modules_for_{command}.txt"

tests/functional/test_install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ def test_install_builds_wheels(script: PipTestEnvironment, data: TestData) -> No
17311731
assert "Building wheel for wheelb" in str(res), str(res)
17321732
assert "Failed to build wheelbroken" in str(res), str(res)
17331733
# Wheels are built for local directories, but not cached.
1734-
assert "Building wheel for requir" in str(res), str(res)
1734+
assert "Building wheel for require" in str(res), str(res)
17351735
# into the cache
17361736
assert wheels != [], str(res)
17371737
assert wheels == [
@@ -1754,7 +1754,7 @@ def test_install_no_binary_builds_wheels(
17541754
)
17551755
# Wheels are built for all requirements
17561756
assert "Building wheel for wheelb" in str(res), str(res)
1757-
assert "Building wheel for requir" in str(res), str(res)
1757+
assert "Building wheel for require" in str(res), str(res)
17581758
assert "Building wheel for upper" in str(res), str(res)
17591759
# Wheelbroken failed to build
17601760
assert "Failed to build wheelbroken" in str(res), str(res)

tests/functional/test_new_resolver_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_new_resolver_install_user_satisfied_by_global_site(
2727
script: PipTestEnvironment,
2828
) -> None:
2929
"""
30-
An install a matching version to user site should re-use a global site
30+
An install a matching version to user site should reuse a global site
3131
installation if it satisfies.
3232
"""
3333
create_basic_wheel_for_package(script, "base", "1.0.0")

tests/unit/test_collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ def test_collect_sources__non_existing_path() -> None:
911911
index_url="ignored-by-no-index",
912912
extra_index_urls=[],
913913
no_index=True,
914-
find_links=[os.path.join("this", "doesnt", "exist")],
914+
find_links=[os.path.join("this", "does", "not", "exist")],
915915
),
916916
)
917917
sources = collector.collect_sources(

tools/codespell-ignore.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# An actual English word
2+
lousily
3+
followings
4+
# A contributor first name
5+
wil
6+
# Codebase variable or class names
7+
uptodate
8+
afile
9+
failer

0 commit comments

Comments
 (0)