From c770cfc8d4c73d9a7597fb29b26a805aa6a0f0e7 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 23 Sep 2025 16:31:56 -0400 Subject: [PATCH 1/6] Add github action to codespell main on push and PRs Signed-off-by: Yaroslav Halchenko --- .github/workflows/codespell.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..b231667 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within pyproject.toml +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From bbc262dbd333a6738302dff4af0c4e022113c78d Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 23 Sep 2025 16:31:56 -0400 Subject: [PATCH 2/6] Add rudimentary codespell config Signed-off-by: Yaroslav Halchenko --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8fa6a18..711fe6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,3 +11,10 @@ mypy_path = ["oras", "examples"] [tool.pytest.ini_options] markers = ["with_auth: mark for tests requiring authenticated registry access (or not)"] + +[tool.codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = '.git*,*.css' +check-hidden = true +# ignore-regex = '' +ignore-words-list = 'pakages' From 04bfb2ac22e41521df366b0463c56af0aa8f5865 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 23 Sep 2025 16:31:58 -0400 Subject: [PATCH 3/6] Add pre-commit definition for codespell Signed-off-by: Yaroslav Halchenko --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 350f580..5eeef76 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,3 +22,8 @@ repos: rev: 6.1.0 hooks: - id: flake8 + - repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in .pre-commit-config.yaml + rev: v2.4.1 + hooks: + - id: codespell From 473d38d4d6cfb838779046a015f0e80b8b6dc096 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 23 Sep 2025 16:32:41 -0400 Subject: [PATCH 4/6] [DATALAD RUNCMD] chore: run codespell throughout fixing a few typos interactively === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 4 ./oras/tests/test_oras.py", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ Signed-off-by: Yaroslav Halchenko --- oras/tests/test_oras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oras/tests/test_oras.py b/oras/tests/test_oras.py index 85f9e4c..0de1ef2 100644 --- a/oras/tests/test_oras.py +++ b/oras/tests/test_oras.py @@ -95,7 +95,7 @@ def test_basic_push_pul_via_sha_ref(tmp_path, registry, credentials, target): @pytest.mark.with_auth(False) def test_get_delete_tags(tmp_path, registry, credentials, target): """ - Test creationg, getting, and deleting tags. + Test creating, getting, and deleting tags. """ client = oras.client.OrasClient(hostname=registry, insecure=True) artifact = os.path.join(here, "artifact.txt") From 8a15c8949313c078a55dc54150b60efe21de402c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 24 Sep 2025 08:21:05 -0400 Subject: [PATCH 5/6] [DATALAD RUNCMD] chore: run codespell throughout fixing a few new typos automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ Signed-off-by: Yaroslav Halchenko --- docs/getting_started/developer-guide.md | 2 +- docs/getting_started/user-guide.md | 2 +- oras/container.py | 2 +- oras/utils/fileio.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/getting_started/developer-guide.md b/docs/getting_started/developer-guide.md index 30ea68f..73f4ef0 100644 --- a/docs/getting_started/developer-guide.md +++ b/docs/getting_started/developer-guide.md @@ -124,7 +124,7 @@ $ pip install -e . # Now docs dependencies cd docs -pip install -r requrements.txt +pip install -r requirements.txt # Build the docs into _build/html make html diff --git a/docs/getting_started/user-guide.md b/docs/getting_started/user-guide.md index bf2765b..f27fa8b 100644 --- a/docs/getting_started/user-guide.md +++ b/docs/getting_started/user-guide.md @@ -11,7 +11,7 @@ or jump to our [developer guide](developer-guide.md) to learn about running test or contributing to the project. If you want to create your own client, you likely want to: - 1. Start a local registry (described below), or have access to an ORAS [supported registry](https://oras.land/implementors/#docker-distribution) + 1. Start a local registry (described below), or have access to an ORAS [supported registry](https://oras.land/implementers/#docker-distribution) 2. Decide on the context for your code (e.g., it's easy to start with Python functions in a single file and move to a client setup if appropriate for your tool) 3. Subclass the `oras.provider.Registry` for your custom class (examples below!) 4. Add custom functions to push, pull, or create manifests / layers diff --git a/oras/container.py b/oras/container.py index 81f117d..213a73f 100644 --- a/oras/container.py +++ b/oras/container.py @@ -30,7 +30,7 @@ def __init__(self, name: str, registry: Optional[str] = None): """ self.registry = registry or oras.defaults.registry.index_name - # Registry is the name takes precendence + # Registry is the name takes precedence self.parse(name) @property diff --git a/oras/utils/fileio.py b/oras/utils/fileio.py index 294f11e..079bbd2 100644 --- a/oras/utils/fileio.py +++ b/oras/utils/fileio.py @@ -255,7 +255,7 @@ def write_file( """ Write content to a filename - :param filename: filname to write + :param filename: filename to write :type filename: str :param content: content to write :type content: str From d3e60a02a39c46b8c3e712f89d8362f1d279ef3d Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 24 Sep 2025 08:26:00 -0400 Subject: [PATCH 6/6] Replace a URL to supported registries altogether to avoid 404 Signed-off-by: Yaroslav Halchenko --- docs/getting_started/user-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/user-guide.md b/docs/getting_started/user-guide.md index f27fa8b..6cd3b0b 100644 --- a/docs/getting_started/user-guide.md +++ b/docs/getting_started/user-guide.md @@ -11,7 +11,7 @@ or jump to our [developer guide](developer-guide.md) to learn about running test or contributing to the project. If you want to create your own client, you likely want to: - 1. Start a local registry (described below), or have access to an ORAS [supported registry](https://oras.land/implementers/#docker-distribution) + 1. Start a local registry (described below), or have access to an ORAS [supported registry](https://oras.land/docs/compatible_oci_registries) 2. Decide on the context for your code (e.g., it's easy to start with Python functions in a single file and move to a client setup if appropriate for your tool) 3. Subclass the `oras.provider.Registry` for your custom class (examples below!) 4. Add custom functions to push, pull, or create manifests / layers