Skip to content

Commit fb81872

Browse files
authored
Fix typos (#512)
Found via `codespell -S *.svg -L fo,nd,filp,te,iif,4rd` and `typos --hidden --format brief`
1 parent d3522c7 commit fb81872

15 files changed

+29
-29
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ You can also skip providers you do not have accounts for by commenting them out
9797

9898
### Test rigs
9999

100-
Since we want behavior parity across providers, nearly all of the tests are written in a provider-agnositc way. Each test is passed a test rig as a fixture, and the rig provides the correct way for generating cloudpaths for testing. The test rigs are defined in [`conftest.py`](tests/conftest.py).
100+
Since we want behavior parity across providers, nearly all of the tests are written in a provider-agnostic way. Each test is passed a test rig as a fixture, and the rig provides the correct way for generating cloudpaths for testing. The test rigs are defined in [`conftest.py`](tests/conftest.py).
101101

102102
**Almost none of the tests instantiate `CloudPath` or a `*Client` class directly.**
103103

@@ -196,7 +196,7 @@ Here's a checklist from the PR template to make sure that you did all the requir
196196

197197
If you are not a maintainer, a maintainer will have to approve your PR to run the test suite in GitHub Actions. No need to ping a maintainer, it will be seen as part of our regular review.
198198

199-
Even once the tests run, two jobs will fail. This is expected. The failures are: (1) The live tests, and (2) the install tests. Both of these require access to the live backends, which are not available to outside contributors. If everything else passes, you can ignore these failiures. A mainter will take the following steps:
199+
Even once the tests run, two jobs will fail. This is expected. The failures are: (1) The live tests, and (2) the install tests. Both of these require access to the live backends, which are not available to outside contributors. If everything else passes, you can ignore these failures. A mainter will take the following steps:
200200

201201
- Create a branch off the main repo for your PR's changes
202202
- Merge your PR into that new branch
@@ -210,7 +210,7 @@ For example, see a [repo-local branch running the live tests in this PR](https:/
210210

211211
### Adding dependencies
212212

213-
We want `cloudpathlib` to be as lightweight as possible. Our strong preference is to not take any external dependencies for the library outside of the official software development kit (SDK) for the cloud provider. If you want to add a dependency, please open an issue to discuss it first. Library depencies are tracked in `pyproject.toml`.
213+
We want `cloudpathlib` to be as lightweight as possible. Our strong preference is to not take any external dependencies for the library outside of the official software development kit (SDK) for the cloud provider. If you want to add a dependency, please open an issue to discuss it first. Library dependencies are tracked in `pyproject.toml`.
214214

215215
Dependencies that are only needed for building documentation, development, linting, formatting, or testing can be added to `requirements-dev.txt`, and are not subject to the same scrutiny.
216216

@@ -307,7 +307,7 @@ To see how it is used in PR, you can [see an example here](https://github.com/dr
307307

308308
### Exceptions
309309

310-
Different backends may raise different exception classses when something goes wrong. To make it easy for users to catch exceptions that are agnostic of the backend, we generally will catch and raise a specific exception from [`exceptions.py`](cloudpathlib/exceptions.py) for any exception that we understand. You can add new exceptions to this file if any are needed for new features.
310+
Different backends may raise different exception classes when something goes wrong. To make it easy for users to catch exceptions that are agnostic of the backend, we generally will catch and raise a specific exception from [`exceptions.py`](cloudpathlib/exceptions.py) for any exception that we understand. You can add new exceptions to this file if any are needed for new features.
311311

312312

313313

HISTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Includes all changes from v0.18.0.
113113

114114
- API change: Add `ignore` parameter to `CloudPath.copytree` in order to match `shutil` API. ([Issue #145](https://github.com/drivendataorg/cloudpathlib/issues/145), [PR #272](https://github.com/drivendataorg/cloudpathlib/pull/272))
115115
- Use the V2 version for listing objects `list_objects_v2` in `S3Client`. ([Issue #155](https://github.com/drivendataorg/cloudpathlib/issues/155), [PR #302](https://github.com/drivendataorg/cloudpathlib/pull/302))
116-
- Add abilty to use `.exists` to check for a raw bucket/container (no additional path components). ([Issue #291](https://github.com/drivendataorg/cloudpathlib/issues/291), [PR #302](https://github.com/drivendataorg/cloudpathlib/pull/302))
116+
- Add ability to use `.exists` to check for a raw bucket/container (no additional path components). ([Issue #291](https://github.com/drivendataorg/cloudpathlib/issues/291), [PR #302](https://github.com/drivendataorg/cloudpathlib/pull/302))
117117
- Prevent data loss when renaming by skipping files that would be renamed to the same thing. ([Issue #277](https://github.com/drivendataorg/cloudpathlib/issues/277), [PR #278](https://github.com/drivendataorg/cloudpathlib/pull/278))
118118
- Speed up common `glob`/`rglob` patterns. ([Issue #274](https://github.com/drivendataorg/cloudpathlib/issues/274), [PR #276](https://github.com/drivendataorg/cloudpathlib/pull/276))
119119

cloudpathlib/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(
4444
if isinstance(file_cache_mode, str):
4545
file_cache_mode = FileCacheMode(file_cache_mode)
4646

47-
# if not explcitly passed to client, get from env var
47+
# if not explicitly passed to client, get from env var
4848
if file_cache_mode is None:
4949
file_cache_mode = FileCacheMode.from_environment()
5050

cloudpathlib/s3/s3client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def _remove(self, cloud_path: S3Path, missing_ok: bool = True) -> None:
322322
)
323323

324324
elif file_or_dir == "dir":
325-
# try to delete as a direcotry instead
325+
# try to delete as a directory instead
326326
bucket = self.s3.Bucket(cloud_path.bucket)
327327

328328
prefix = cloud_path.key

docs/docs/authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ As noted above, you can also call `.set_as_default_client()` on the client objec
125125

126126
## Other S3 `ExtraArgs` in `boto3`
127127

128-
The S3 SDK, `boto3` supports a set of `ExtraArgs` for uploads, downloads, and listing operations. When you instatiate a client, you can pass the `extra_args` keyword argument with any of those extra args that you want to set. We will pass these on to the upload, download, and list methods insofar as those methods support the specific args.
128+
The S3 SDK, `boto3` supports a set of `ExtraArgs` for uploads, downloads, and listing operations. When you instantiate a client, you can pass the `extra_args` keyword argument with any of those extra args that you want to set. We will pass these on to the upload, download, and list methods insofar as those methods support the specific args.
129129

130130
The args supported for uploads are the same as `boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS`, see the [`boto3` documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/customizations/s3.html#boto3.s3.transfer.S3Transfer) for the latest, but as of the time of writing, these are:
131131

docs/docs/caching.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"\n",
3333
"The cache logic also support writing to cloud files seamlessly in addition to reading. We do this by tracking when a `CloudPath` is opened and on the close of that file, we will upload the new version to the cloud if it has changed.\n",
3434
"\n",
35-
"**Warning** we don't upload files that weren't opened for write by `cloudpathlib`. For example, if you edit a file in the cache manually in a text edior, `cloudpathlib` won't know to update that file on the cloud. If you want to write to a file in the cloud, you should use the `open` or `write` methods, for example:\n",
35+
"**Warning** we don't upload files that weren't opened for write by `cloudpathlib`. For example, if you edit a file in the cache manually in a text editor, `cloudpathlib` won't know to update that file on the cloud. If you want to write to a file in the cloud, you should use the `open` or `write` methods, for example:\n",
3636
"\n",
3737
"```python\n",
3838
"with my_cloud_path.open(\"w\") as f:\n",
@@ -269,7 +269,7 @@
269269
"\n",
270270
"However, sometimes I don't want to have to re-download files I know won't change. For example, in the LADI dataset, I may want to use the images in a Jupyter notebook and every time I restart the notebook I want to always have the downloaded files. I don't want to ever re-download since I know the LADI images won't be changing on S3. I want these to be there, even if I restart my whole machine.\n",
271271
"\n",
272-
"We can do this just by using a `Client` that does all the downloading/uploading to a specfic folder on our local machine. We set the cache folder by passing `local_cache_dir` to the `Client` when instantiating. You can also set a default for all clients by setting the `CLOUDPATHLIB_LOCAL_CACHE_DIR` to a path. (This is only recommended with (1) an absolute path, so you know where the cache is no matter where your code is running, and (2) if you only use the default client for one cloud provider and don't instantiate multiple. In this case, the clients will use the same cache dir and could overwrite each other's content. Setting `CLOUDPATHLIB_LOCAL_CACHE_DIR` to an empty string will be treated as it not being set.)"
272+
"We can do this just by using a `Client` that does all the downloading/uploading to a specific folder on our local machine. We set the cache folder by passing `local_cache_dir` to the `Client` when instantiating. You can also set a default for all clients by setting the `CLOUDPATHLIB_LOCAL_CACHE_DIR` to a path. (This is only recommended with (1) an absolute path, so you know where the cache is no matter where your code is running, and (2) if you only use the default client for one cloud provider and don't instantiate multiple. In this case, the clients will use the same cache dir and could overwrite each other's content. Setting `CLOUDPATHLIB_LOCAL_CACHE_DIR` to an empty string will be treated as it not being set.)"
273273
]
274274
},
275275
{
@@ -433,7 +433,7 @@
433433
" - `*Client.clear_cache()` - All files downloaded by this specific client instance will be removed from the cache. If you didn't create a client instance yourself, you can get the one that is used by a cloudpath with `CloudPath.client` or get the default one for a particular provider with `get_default_client`, for example by calling `S3Client.get_default_client().clear_cache()`.\n",
434434
" - By deleting the cached file itself or the containing directory using any normal method. To see where on a disk the cache is, you can use `CloudPath.fspath` for an individual file or use `*Client._local_cache_dir` for the client's cache. You can then use any method you like to delete these local files.\n",
435435
"\n",
436-
"However, for most cases, you shouldn't need to manage the file cache manually. By setting the automatic cache clearing beahvior to the most appropriate one for your use case below, you can have the cache automatically cleared.\n"
436+
"However, for most cases, you shouldn't need to manage the file cache manually. By setting the automatic cache clearing behavior to the most appropriate one for your use case below, you can have the cache automatically cleared.\n"
437437
]
438438
},
439439
{
@@ -647,7 +647,7 @@
647647
"source": [
648648
"### File cache mode: `\"persistent\"`\n",
649649
"\n",
650-
"If `local_cache_dir` is specificed, but `file_cache_mode` is not, then the mode is set to `\"persistent\"` automatically. Conversely, if you set the mode to `\"persistent\"` explicitly, you must also pass `local_cache_dir` or the `Client` will raise `InvalidConfigurationException`.\n",
650+
"If `local_cache_dir` is specified, but `file_cache_mode` is not, then the mode is set to `\"persistent\"` automatically. Conversely, if you set the mode to `\"persistent\"` explicitly, you must also pass `local_cache_dir` or the `Client` will raise `InvalidConfigurationException`.\n",
651651
"\n",
652652
"Local cache file exists after file is closed for reading.\n",
653653
"\n",

docs/docs/script/caching.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#
2525
# The cache logic also support writing to cloud files seamlessly in addition to reading. We do this by tracking when a `CloudPath` is opened and on the close of that file, we will upload the new version to the cloud if it has changed.
2626
#
27-
# **Warning** we don't upload files that weren't opened for write by `cloudpathlib`. For example, if you edit a file in the cache manually in a text edior, `cloudpathlib` won't know to update that file on the cloud. If you want to write to a file in the cloud, you should use the `open` or `write` methods, for example:
27+
# **Warning** we don't upload files that weren't opened for write by `cloudpathlib`. For example, if you edit a file in the cache manually in a text editor, `cloudpathlib` won't know to update that file on the cloud. If you want to write to a file in the cloud, you should use the `open` or `write` methods, for example:
2828
#
2929
# ```python
3030
# with my_cloud_path.open("w") as f:
@@ -85,7 +85,7 @@
8585
#
8686
# However, sometimes I don't want to have to re-download files I know won't change. For example, in the LADI dataset, I may want to use the images in a Jupyter notebook and every time I restart the notebook I want to always have the downloaded files. I don't want to ever re-download since I know the LADI images won't be changing on S3. I want these to be there, even if I restart my whole machine.
8787
#
88-
# We can do this just by using a `Client` that does all the downloading/uploading to a specfic folder on our local machine. We set the cache folder by passing `local_cache_dir` to the `Client` when instantiating. You can also set a default for all clients by setting the `CLOUDPATHLIB_LOCAL_CACHE_DIR` to a path. (This is only recommended with (1) an absolute path, so you know where the cache is no matter where your code is running, and (2) if you only use the default client for one cloud provider and don't instantiate multiple. In this case, the clients will use the same cache dir and could overwrite each other's content. Setting `CLOUDPATHLIB_LOCAL_CACHE_DIR` to an empty string will be treated as it not being set.)
88+
# We can do this just by using a `Client` that does all the downloading/uploading to a specific folder on our local machine. We set the cache folder by passing `local_cache_dir` to the `Client` when instantiating. You can also set a default for all clients by setting the `CLOUDPATHLIB_LOCAL_CACHE_DIR` to a path. (This is only recommended with (1) an absolute path, so you know where the cache is no matter where your code is running, and (2) if you only use the default client for one cloud provider and don't instantiate multiple. In this case, the clients will use the same cache dir and could overwrite each other's content. Setting `CLOUDPATHLIB_LOCAL_CACHE_DIR` to an empty string will be treated as it not being set.)
8989

9090
from cloudpathlib import S3Client
9191

@@ -159,7 +159,7 @@
159159
# - `*Client.clear_cache()` - All files downloaded by this specific client instance will be removed from the cache. If you didn't create a client instance yourself, you can get the one that is used by a cloudpath with `CloudPath.client` or get the default one for a particular provider with `get_default_client`, for example by calling `S3Client.get_default_client().clear_cache()`.
160160
# - By deleting the cached file itself or the containing directory using any normal method. To see where on a disk the cache is, you can use `CloudPath.fspath` for an individual file or use `*Client._local_cache_dir` for the client's cache. You can then use any method you like to delete these local files.
161161
#
162-
# However, for most cases, you shouldn't need to manage the file cache manually. By setting the automatic cache clearing beahvior to the most appropriate one for your use case below, you can have the cache automatically cleared.
162+
# However, for most cases, you shouldn't need to manage the file cache manually. By setting the automatic cache clearing behavior to the most appropriate one for your use case below, you can have the cache automatically cleared.
163163
#
164164

165165
#
@@ -280,7 +280,7 @@
280280

281281
# ### File cache mode: `"persistent"`
282282
#
283-
# If `local_cache_dir` is specificed, but `file_cache_mode` is not, then the mode is set to `"persistent"` automatically. Conversely, if you set the mode to `"persistent"` explicitly, you must also pass `local_cache_dir` or the `Client` will raise `InvalidConfigurationException`.
283+
# If `local_cache_dir` is specified, but `file_cache_mode` is not, then the mode is set to `"persistent"` automatically. Conversely, if you set the mode to `"persistent"` explicitly, you must also pass `local_cache_dir` or the `Client` will raise `InvalidConfigurationException`.
284284
#
285285
# Local cache file exists after file is closed for reading.
286286
#

tests/mock_clients/mock_adls_gen2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class MockedDataLakeServiceClient:
1111
def __init__(self, test_dir, adls):
12-
# root is parent of the test specific directort
12+
# root is parent of the test specific directory
1313
self.root = test_dir.parent
1414
self.test_dir = test_dir
1515
self.adls = adls

tests/mock_clients/mock_s3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
TEST_ASSETS = Path(__file__).parent.parent / "assets"
1313
DEFAULT_S3_BUCKET_NAME = "bucket"
1414

15-
# Since we don't contol exactly when the filesystem finishes writing a file
15+
# Since we don't control exactly when the filesystem finishes writing a file
1616
# and the test files are super small, we can end up with race conditions in
1717
# the tests where the updated file is modified before the source file,
1818
# which breaks our caching logic

tests/performance/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
logger.remove()
2121
logger.add(lambda msg: tqdm.write(msg, end=""), colorize=True)
2222

23-
# get environement variables
23+
# get environment variables
2424
load_dotenv(find_dotenv())
2525

2626
# enumerate cloudpathlib implementations
@@ -97,7 +97,7 @@ def _format_row(r):
9797
return table
9898

9999

100-
@cli.command(short_help="Runs peformance test suite against a specific backend and bucket.")
100+
@cli.command(short_help="Runs performance test suite against a specific backend and bucket.")
101101
def run(
102102
backend: CloudEnum,
103103
bucket: Optional[str] = None,

tests/test_caching.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def test_loc_dir(rig: CloudProviderTestRig, tmpdir):
202202
file_cache_mode=FileCacheMode.persistent, **rig.required_client_kwargs
203203
)
204204

205-
# automatically set to persitent if not specified
205+
# automatically set to persistent if not specified
206206
client = rig.client_class(local_cache_dir=tmpdir, **rig.required_client_kwargs)
207207
assert client.file_cache_mode == FileCacheMode.persistent
208208

@@ -458,7 +458,7 @@ def test_manual_cache_clearing(rig: CloudProviderTestRig):
458458
assert cp._local.exists()
459459
assert cp.client._local_cache_dir.exists()
460460

461-
# clears the file itself, but not the containg folder
461+
# clears the file itself, but not the containing folder
462462
cp.clear_cache()
463463

464464
assert not cp._local.exists()

tests/test_cloudpath_file_io.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ def test_is_dir_is_file(rig, tmp_path):
342342
assert not test_case.is_dir()
343343

344344
# does not exist (same behavior as pathlib.Path that does not exist)
345-
non_existant = rig.create_cloud_path("dir_0/not_a_file")
346-
assert not non_existant.is_file()
347-
assert not non_existant.is_dir()
345+
non_existent = rig.create_cloud_path("dir_0/not_a_file")
346+
assert not non_existent.is_file()
347+
assert not non_existent.is_dir()
348348

349349

350350
def test_file_read_writes(rig, tmp_path):

tests/test_cloudpath_manipulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def test_parser(rig):
202202
with pytest.raises(NotImplementedError):
203203
rig.create_cloud_path("a/b/c").parser
204204
else:
205-
# always posixpath since our dispath goes to PurePosixPath
205+
# always posixpath since our dispatch goes to PurePosixPath
206206
assert rig.create_cloud_path("a/b/c").parser == posixpath
207207

208208

tests/test_gs_specific.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def _calculate_b64_wrapped_md5_hash(contents: str) -> str:
7171
b64string = b64encode(contents_md5_bytes).decode()
7272
return b64string
7373

74-
# if USE_LIVE_CLOUD this doesnt have any effect
74+
# if USE_LIVE_CLOUD this doesn't have any effect
7575
expected_hash = _calculate_b64_wrapped_md5_hash(contents)
7676
monkeypatch.setenv("MOCK_EXPECTED_MD5_HASH", expected_hash)
7777

0 commit comments

Comments
 (0)