diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..40d0f306 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,15 @@ +# This Action looks for typos in the codebase using codespell +# and provide users with intuitive GitHub Annotations. +# https://github.com/codespell-project/codespell#readme +name: codespell +on: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + codespell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 diff --git a/README-gdb.md b/README-gdb.md index c1bacca1..f21ce246 100644 --- a/README-gdb.md +++ b/README-gdb.md @@ -33,7 +33,7 @@ Enable `python-gdb.py` ---------------------- `python-gdb.py` is a GDB script to make it easier to inspect the state of a -Python process from whitin GDB. It is documented +Python process from within GDB. It is documented [in the CPython's dev guide](https://devguide.python.org/gdb/). The script add a series of GBD commands such as: diff --git a/docs/changelog.rst b/docs/changelog.rst index e2915b98..0b6bcab7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,7 +4,7 @@ Changelog Version 0.9 (April 25th, 2023) ------------------------------ -This release adds numerous major features and indicates the end of HPy's *alhpa* +This release adds numerous major features and indicates the end of HPy's *alpha* phase. We've migrated several key packages to HPy (for a list, see our website https://hpyproject.org) and we are now confident that HPy is mature enough for being used as serious extension API. We also plan that the next major release @@ -56,7 +56,7 @@ HPy :ref:`porting-guide:calling protocol` convention. This is: the arguments are passed in a C array and the keyword argument names are provided as a Python tuple. Before this release, the only way to create a callable type was to set the special method ``__call__``. - However, this has several disadvantages. In particlar, poor performance on + However, this has several disadvantages. In particular, poor performance on CPython (and maybe other implementations) and it was not possible to have specialized call function implementations per object (see :c:func:`HPy_SetCallFunction`) @@ -117,7 +117,7 @@ Documentation * Added :doc:`quickstart` guide * Extended :doc:`api-reference/index` * Added :doc:`api-reference/function-index` -* Added possiblity to generate examples from tests with argument ``--dump-dir`` +* Added possibility to generate examples from tests with argument ``--dump-dir`` (see :ref:`api:hpy unit tests`) * Added initial :doc:`contributing/index` docs @@ -206,7 +206,7 @@ Debug mode: Misc Changes: - Removed unnecessary prefix ``"m_"`` from fields of ``HPyModuleDef`` (incompatible change) - - For HPy implementors: new pytest mark for HPy tests assuming synchronous GC + - For HPy implementers: new pytest mark for HPy tests assuming synchronous GC Version 0.0.3 (September 22nd, 2021) ------------------------------------ diff --git a/docs/overview.rst b/docs/overview.rst index e4c9e30b..cc4b3253 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -222,7 +222,7 @@ Benefits for the Python ecosystem The HPy project offers some benefits to the python ecosystem, both to Python users and to library developers. - - C extensions can achieve much better speed on alternative implementions, + - C extensions can achieve much better speed on alternative implementations, including PyPy and GraalPy: according to early :ref:`benchmarks`, an extension written in HPy can be ~3x faster than the equivalent extension written using ``Python.h``. diff --git a/hpy/devel/include/hpy.h b/hpy/devel/include/hpy.h index 17509d5c..1f44dd49 100644 --- a/hpy/devel/include/hpy.h +++ b/hpy/devel/include/hpy.h @@ -135,7 +135,7 @@ extern "C" { * * * In Universal-ABI mode, they always resolve to an indirect call * through ``HPyContext *``, i.e. ``ctx->ctx_Add(...)``, which on CPython - * dispaches to ``ctx_Add``. + * dispatches to ``ctx_Add``. */ #define HPyAPI_FUNC _HPy_UNUSED static inline diff --git a/pyproject.toml b/pyproject.toml index a3194aec..5914a474 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ [build-system] requires = [ "setuptools>=64.0", "setuptools-scm[toml]>=6.0", "wheel>=0.34.2",] build-backend = "setuptools.build_meta" + +[tool.codespell] +ignore-words-list = "acount,crate,fo,ois,ot,seh" diff --git a/test/debug/test_charptr.py b/test/debug/test_charptr.py index 7df8d8f2..62b402e3 100644 --- a/test/debug/test_charptr.py +++ b/test/debug/test_charptr.py @@ -188,7 +188,7 @@ def test_charptr_correct_usage(compiler): @EXPORT(f) @INIT """) - assert mod.f('I wont be leaked!') == 'I wont be leaked!'; + assert mod.f('I will not be leaked!') == 'I will not be leaked!'; def test_charptr_limit_stress_test(compiler): diff --git a/test/debug/test_context_reuse.py b/test/debug/test_context_reuse.py index e3a57d31..58c83b82 100644 --- a/test/debug/test_context_reuse.py +++ b/test/debug/test_context_reuse.py @@ -31,7 +31,7 @@ def test_reuse_context_from_global_variable(compiler, python_subprocess): return HPy_Dup(ctx, ctx->h_None); } HPy_Close(ctx, t); - fprintf(stdout, "Heavy Marmelade\\n"); + fprintf(stdout, "Heavy Marmalade\\n"); fflush(stdout); // Here we wrongly use "keep" instead of "ctx" return HPy_Dup(keep, ctx->h_None); @@ -65,13 +65,13 @@ def test_reuse_context_from_global_variable(compiler, python_subprocess): result = python_subprocess.run(mod, code) assert result.returncode != 0 assert b"Error: Wrong HPy Context!" in result.stderr - assert result.stdout == b"Heavy Marmelade\n" + assert result.stdout == b"Heavy Marmalade\n" code = "mod.f(); mod.bounce(lambda: mod.g())" result = python_subprocess.run(mod, code) assert result.returncode != 0 assert b"Error: Wrong HPy Context!" in result.stderr - assert result.stdout == b"Bouncing...\nHeavy Marmelade\n" + assert result.stdout == b"Bouncing...\nHeavy Marmalade\n" # checks the situation when the context cache runs out, # and we start reusing cached contexts @@ -91,7 +91,7 @@ def test_reuse_context_from_global_variable(compiler, python_subprocess): HPY_DEBUG_CTX_CACHE_SIZE = 16 for size in range(HPY_DEBUG_CTX_CACHE_SIZE-1, HPY_DEBUG_CTX_CACHE_SIZE+2): result = python_subprocess.run(mod, code.format(size)) - assert result.stdout == (b"Bouncing...\n" * size) + b"Heavy Marmelade\n" + assert result.stdout == (b"Bouncing...\n" * size) + b"Heavy Marmalade\n" if result.returncode != 0: assert b"Error: Wrong HPy Context!" in result.stderr @@ -99,4 +99,4 @@ def test_reuse_context_from_global_variable(compiler, python_subprocess): result = python_subprocess.run(mod, code) assert result.returncode != 0 assert b"Error: Wrong HPy Context!" in result.stderr - assert result.stdout == b"Bouncing differently...\n" + b"Heavy Marmelade\n" + assert result.stdout == b"Bouncing differently...\n" + b"Heavy Marmalade\n"