From 037e8ca50839a65de4e3e47de844e305979f8125 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 20 Feb 2024 13:31:43 -0500 Subject: [PATCH 1/7] Add github action to codespell main on push and PRs --- .github/workflows/codespell.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 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 000000000..dd0eb8e57 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# 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: Codespell + uses: codespell-project/actions-codespell@v2 From e32a19a98e535d5c276b46ca5db87e60fde0a090 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 20 Feb 2024 13:31:43 -0500 Subject: [PATCH 2/7] Add rudimentary codespell config --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 831adc62a..429d6da98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,3 +5,10 @@ exclude = ["^env/"] [tool.isort] profile = "black" # needed for black/isort compatibility skip = [] + +[tool.codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = '.git,*.svg,*.css' +check-hidden = true +# ignore-regex = '' +# ignore-words-list = '' From 55478488783ecf635344a0ff365e19ebf0bde2e2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 20 Feb 2024 13:31:43 -0500 Subject: [PATCH 3/7] Add pre-commit definition for codespell --- .pre-commit-config.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 21c0b591e..e94796608 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,3 +30,11 @@ repos: language: python types: [python] entry: flake8 + + - repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in pyproject.toml + rev: v2.2.6 + hooks: + - id: codespell + additional_dependencies: + - tomli From 98f4b43e67e8ebceedda51ca87a3d11d35c76bca Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 20 Feb 2024 13:37:23 -0500 Subject: [PATCH 4/7] Fix pyproject for black -- exclude must be a string regex, not array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise black does not work ❯ black shpc/client/__init__.py Invalid config keys detected: 'profile' (in /home/yoh/proj/misc/singularity-hpc/pyproject.toml) Usage: black [OPTIONS] SRC ... Try 'black -h' for help. Error: Config key exclude must be a string ❯ black --version black, 24.2.0 (compiled: yes) Python (CPython) 3.11.8 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 429d6da98..014ea1f5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] profile = "black" -exclude = ["^env/"] +exclude = "^env/" [tool.isort] profile = "black" # needed for black/isort compatibility From 54dc38bb01b9ca395d4a5db5c753809e7fba1173 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 20 Feb 2024 13:39:20 -0500 Subject: [PATCH 5/7] [DATALAD RUNCMD] run codespell throughout fixing typo automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- .github/CODE_OF_CONDUCT.md | 2 +- CHANGELOG.md | 2 +- docs/getting_started/developer-guide.rst | 2 +- docs/getting_started/installation.rst | 2 +- docs/getting_started/user-guide.rst | 4 ++-- example/README.md | 2 +- paper/paper.md | 2 +- shpc/client/__init__.py | 2 +- shpc/client/help.py | 2 +- shpc/client/shell.py | 2 +- shpc/main/modules/views.py | 2 +- shpc/main/registry/filesystem.py | 2 +- shpc/main/settings.py | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index daf4a2945..c69da0002 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -6,7 +6,7 @@ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal +level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards diff --git a/CHANGELOG.md b/CHANGELOG.md index dde68f5d6..6265aa82b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,7 +97,7 @@ The versions coincide with releases on pip. Only major versions will be released - split documentation into user and developer guide - added automated spell checking with crate-ci/typos - support for container features - - shpc get -e to show path to an envrironment file + - shpc get -e to show path to an environment file - added support for env section to render to bound environment file - added support for container features like gpu - allowing for a `container:tag` convention to be used for commands. diff --git a/docs/getting_started/developer-guide.rst b/docs/getting_started/developer-guide.rst index 40c7a7bb9..e44686f89 100644 --- a/docs/getting_started/developer-guide.rst +++ b/docs/getting_started/developer-guide.rst @@ -475,7 +475,7 @@ Templating for both wrapper script types ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Note that you are free to use "snippets" and "bases" either as an inclusion or "extends" meaning you can -easily re-use code. For example, if we have the following registered directories under ``shpc/main/wrappers/templates`` +easily reuse code. For example, if we have the following registered directories under ``shpc/main/wrappers/templates`` for definition of bases and templates: .. code-block:: console diff --git a/docs/getting_started/installation.rst b/docs/getting_started/installation.rst index cf4ec2870..50ba334f4 100644 --- a/docs/getting_started/installation.rst +++ b/docs/getting_started/installation.rst @@ -5,7 +5,7 @@ Installation ============ Singularity Registry HPC (shpc) can be installed from pypi, or from source. -In all cases, a module technology is required such as `lmod (install intstructions) `_ +In all cases, a module technology is required such as `lmod (install instructions) `_ or `environment modules (install instructions) `_. Having module software installed means that the ``module`` command should be on your path. Once you are ready to install shpc along your module software, it's recommended that you create a virtual environment, if you have not already diff --git a/docs/getting_started/user-guide.rst b/docs/getting_started/user-guide.rst index 95de9a36d..42e52f869 100644 --- a/docs/getting_started/user-guide.rst +++ b/docs/getting_started/user-guide.rst @@ -415,7 +415,7 @@ any changes. It could be the case that you want to start with a remote registry, but keep it locally with your own changes or secrets. This is essentially turning a remote registry into a filesystem -(local) one. The easiest thing to do here is to clone it to your filesyste, and then add to shpc as a filesystem +(local) one. The easiest thing to do here is to clone it to your filesystem, and then add to shpc as a filesystem registry. .. code-block:: console @@ -1234,7 +1234,7 @@ This feature is supported for shpc versions 0.1.15 and up. Namespace --------- -Let's say that you are exclusively using continers in the namespace ghcr.io/autamus. +Let's say that you are exclusively using containers in the namespace ghcr.io/autamus. .. code-block:: console diff --git a/example/README.md b/example/README.md index 7073b0710..adef21af3 100644 --- a/example/README.md +++ b/example/README.md @@ -6,7 +6,7 @@ This set of examples includes the following: The intention of this script is to instantiate a client, and then match containers you have in some root from [Galaxy Project Depot](https://depot.galaxyproject.org/singularity/) -on your local filesytem to install to an shpc registry (as modules). The script +on your local filesystem to install to an shpc registry (as modules). The script tries to be efficient and instantiate one remote registry that has all the containers. See the script header for usage examples. diff --git a/paper/paper.md b/paper/paper.md index f2b83eb9e..51499a1c2 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -15,7 +15,7 @@ authors: affiliations: - name: Lawrence Livermore National Lab, Livermore, CA, USA index: 1 - - name: University of Arizona Research Computing, Tuscon, AZ, USA + - name: University of Arizona Research Computing, Tucson, AZ, USA index: 2 date: 17 April 2021 bibliography: paper.bib diff --git a/shpc/client/__init__.py b/shpc/client/__init__.py index bd7bd2871..9759e2fad 100644 --- a/shpc/client/__init__.py +++ b/shpc/client/__init__.py @@ -173,7 +173,7 @@ def get_parser(): action="store_true", ) - # Add a container direcly + # Add a container directly add = subparsers.add_parser( "add", formatter_class=argparse.RawTextHelpFormatter, diff --git a/shpc/client/help.py b/shpc/client/help.py index b8364e476..308ed10b2 100644 --- a/shpc/client/help.py +++ b/shpc/client/help.py @@ -10,7 +10,7 @@ > client Out[1]: [shpc-client] - # Shell into a client with a different interpeter + # Shell into a client with a different interpreter $ shpc shell -i python $ shpc shell -i ipython $ shpc shell -i bpython""" diff --git a/shpc/client/shell.py b/shpc/client/shell.py index 132bd4e7e..f3f0d7f51 100644 --- a/shpc/client/shell.py +++ b/shpc/client/shell.py @@ -25,7 +25,7 @@ def main(args, parser, extra, subparser): except ImportError: pass - # Otherwise present order of liklihood to have on system + # Otherwise present order of likelihood to have on system for shell in shells: try: return lookup[shell](args) diff --git a/shpc/main/modules/views.py b/shpc/main/modules/views.py index 5527ca691..025b931a5 100644 --- a/shpc/main/modules/views.py +++ b/shpc/main/modules/views.py @@ -465,7 +465,7 @@ def remove_module(self, module_dir, has_version=False): updated = [] change = False for module in self._config["view"]["modules"]: - # This will match an entire dirname (if all delted) or a specific version + # This will match an entire dirname (if all deleted) or a specific version if module_uid not in module: updated.append(module) else: diff --git a/shpc/main/registry/filesystem.py b/shpc/main/registry/filesystem.py index f0824f1cd..bb68e0fc9 100644 --- a/shpc/main/registry/filesystem.py +++ b/shpc/main/registry/filesystem.py @@ -15,7 +15,7 @@ class FilesystemResult(Result): """ A filesystem result provides courtesy functions for interacting with - a container yaml recipe on the filesytem. + a container yaml recipe on the filesystem. """ def __init__(self, module, container_yaml): diff --git a/shpc/main/settings.py b/shpc/main/settings.py index 7049bfc30..f31c5b068 100644 --- a/shpc/main/settings.py +++ b/shpc/main/settings.py @@ -125,7 +125,7 @@ def load(self, settings_file=None): """ Load the settings file into the settings object """ - # Get the preferred settings flie + # Get the preferred settings file self.settings_file = self.get_settings_file(settings_file) # Exit quickly if the settings file does not exist From 1a41feda1982a2a5de67c0fe803d776bb1113e6e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 20 Feb 2024 13:40:08 -0500 Subject: [PATCH 6/7] [DATALAD RUNCMD] Do interactive fixing of typos === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- docs/getting_started/user-guide.rst | 2 +- shpc/main/__init__.py | 2 +- shpc/main/modules/base.py | 2 +- shpc/settings.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/getting_started/user-guide.rst b/docs/getting_started/user-guide.rst index 42e52f869..6f990a7b8 100644 --- a/docs/getting_started/user-guide.rst +++ b/docs/getting_started/user-guide.rst @@ -207,7 +207,7 @@ variable replacement. A summary table of variables is included below, and then f - Format string for module commands exec,shell,run (not aliases) can include ``{{ registry }}``, ``{{ repository }}``, ``{{ tool }}`` and ``{{ version }}`` - ``'{{ tool }}'`` * - bindpaths - - string with comma separated list of paths to binds. If set, expored to SINGULARITY_BINDPATH + - string with comma separated list of paths to binds. If set, exported to SINGULARITY_BINDPATH - null * - singularity_shell - exported to SINGULARITY_SHELL diff --git a/shpc/main/__init__.py b/shpc/main/__init__.py index 3262abe59..2feadefa7 100644 --- a/shpc/main/__init__.py +++ b/shpc/main/__init__.py @@ -55,7 +55,7 @@ def get_client(quiet=False, **kwargs): Client.container = DockerContainer() - # The containe should have access to settings too + # The container should have access to settings too if hasattr(Client, "container"): Client.container.settings = settings diff --git a/shpc/main/modules/base.py b/shpc/main/modules/base.py index fa26ba987..a329b231f 100644 --- a/shpc/main/modules/base.py +++ b/shpc/main/modules/base.py @@ -231,7 +231,7 @@ def add(self, image, module_name=None, **kwargs): if image.startswith("docker"): module_name = image.replace("docker://", "") - # If we still dont' have a module name and not docker, no go + # If we still don't have a module name and not docker, no go if not module_name: logger.exit("A module name is required to add an image.") module_name = self.add_namespace(module_name) diff --git a/shpc/settings.yml b/shpc/settings.yml index d74743824..a05aac058 100644 --- a/shpc/settings.yml +++ b/shpc/settings.yml @@ -57,7 +57,7 @@ default_view: singularity_module: podman_module: -# string with comma separated list of paths to binds. If set, expored to SINGULARITY_BINDPATH +# string with comma separated list of paths to binds. If set, exported to SINGULARITY_BINDPATH bindpaths: # for container technologies that can specify a tty input (e.g., -t) From 62fd25b0fc269e3edb5cf2aa1ab45b3f13abe516 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 20 Feb 2024 13:45:35 -0500 Subject: [PATCH 7/7] TEMP: added a typo to test CI, do not merge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 10936013c..31050b868 100644 --- a/README.md +++ b/README.md @@ -77,3 +77,4 @@ There are other tools that you might be interested in! ## License This code is licensed under the MPL 2.0 [LICENSE](LICENSE). +explicit typo to test detection on CI: expored