-
-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #694 from amoffat/develop
2.0.5 release
- Loading branch information
Showing
41 changed files
with
3,590 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ __pycache__/ | |
/.venv/ | ||
/build | ||
/dist | ||
/docs/build | ||
/TODO.md | ||
/htmlcov/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.10" | ||
jobs: | ||
post_create_environment: | ||
- pip install poetry | ||
- poetry config virtualenvs.create false | ||
post_install: | ||
- poetry install | ||
- pip install -e . | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/source/conf.py | ||
# Optional but recommended, declare the Python requirements required | ||
# to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
python: | ||
install: | ||
- requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Doc builder", | ||
"type": "shell", | ||
"command": "source ${workspaceFolder}/.venv/bin/activate && find source/ | entr -s 'make clean && make html'", | ||
"options": { | ||
"cwd": "${workspaceFolder}/docs" | ||
}, | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "build" | ||
}, | ||
"isBackground": true, | ||
"presentation": { | ||
"echo": true, | ||
"reveal": "always", | ||
"focus": true, | ||
"panel": "dedicated", | ||
"showReuseMessage": false, | ||
"clear": true, | ||
"close": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= -a -W | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
toml==0.10.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
|
||
from pathlib import Path | ||
|
||
import toml | ||
|
||
_THIS_DIR = Path(__file__).parent | ||
_REPO = _THIS_DIR.parent.parent | ||
_PYPROJECT = _REPO / "pyproject.toml" | ||
|
||
pyproject = toml.load(_PYPROJECT) | ||
nitpicky = True | ||
|
||
nitpick_ignore = [ | ||
("py:class", "Token"), | ||
("py:class", "'Token'"), | ||
] | ||
|
||
nitpick_ignore_regex = [ | ||
("py:class", r".*lark.*"), | ||
] | ||
|
||
version = pyproject["tool"]["poetry"]["version"] | ||
release = version | ||
|
||
# -- Project information | ||
|
||
project = "sh" | ||
copyright = "2023, Andrew Moffat" | ||
author = "Andrew Moffat" | ||
|
||
# -- General configuration | ||
|
||
extensions = [ | ||
"sphinx.ext.duration", | ||
"sphinx.ext.doctest", | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.autosummary", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.todo", | ||
] | ||
|
||
intersphinx_mapping = { | ||
"python": ("https://docs.python.org/3/", None), | ||
"sphinx": ("https://www.sphinx-doc.org/en/master/", None), | ||
"lark": ("https://lark-parser.readthedocs.io/en/latest/", None), | ||
"jinja2": ("https://jinja.palletsprojects.com/en/latest/", None), | ||
} | ||
intersphinx_disabled_domains = ["std"] | ||
|
||
templates_path = ["_templates"] | ||
|
||
# -- Options for HTML output | ||
|
||
html_theme = "sphinx_rtd_theme" | ||
|
||
# -- Options for EPUB output | ||
epub_show_urls = "footnote" | ||
|
||
autodoc_typehints = "both" | ||
|
||
add_module_names = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Here's an example of using :ref:`done` to create a multiprocess pool, where | ||
``sh.your_parallel_command`` is executed concurrently at no more than 10 at a | ||
time: | ||
|
||
.. code-block:: python | ||
import sh | ||
from threading import Semaphore | ||
pool = Semaphore(10) | ||
def done(cmd, success, exit_code): | ||
pool.release() | ||
def do_thing(arg): | ||
pool.acquire() | ||
return sh.your_parallel_command(arg, _bg=True, _done=done) | ||
procs = [] | ||
for arg in range(100): | ||
procs.append(do_thing(arg)) | ||
# essentially a join | ||
[p.wait() for p in procs] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.