From 68467689903bea2f798e500e804061ffdd5001bd Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 08:35:46 +0200 Subject: [PATCH 01/17] ci(docs): Use PUBLISH conditions --- .github/workflows/docs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 22b9fca2..1be7428e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -79,13 +79,16 @@ jobs: run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv - name: Install dependencies [w/ docs] + if: env.PUBLISH == 'true' run: poetry install --extras "docs lint" - name: Build documentation + if: env.PUBLISH == 'true' run: | pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd - name: Push documentation to S3 + if: env.PUBLISH == 'true' uses: jakejarvis/s3-sync-action@v0.5.1 with: args: --acl public-read --follow-symlinks --delete @@ -97,6 +100,7 @@ jobs: SOURCE_DIR: "docs/_build/html" # optional: defaults to entire repository - name: Purge cache on Cloudflare + if: env.PUBLISH == 'true' uses: jakejarvis/cloudflare-purge-action@v0.3.0 env: CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} From 8f7b548691f6005d4a53993e4032812eed933e43 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 08:41:56 +0200 Subject: [PATCH 02/17] ci(python): Bump CI to use setup-python@v3/4 caching --- .github/workflows/docs.yml | 53 +++++++++---------------------------- .github/workflows/tests.yml | 50 +++++++--------------------------- 2 files changed, 23 insertions(+), 80 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1be7428e..1ce20095 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,54 +34,27 @@ jobs: if: steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true' run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Get full Python version - id: full-python-version - shell: bash - run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") - - name: Install poetry - run: | - curl -O -sSL https://install.python-poetry.org/install-poetry.py - python install-poetry.py -y --version 1.1.14 - echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV - rm install-poetry.py - - - name: Add ~/.local/bin to PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Get poetry cache paths from config - run: | - echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV - echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV - - - name: Configure poetry - shell: bash - run: poetry config virtualenvs.in-project true + if: env.PUBLISH == 'true' + run: pipx install "poetry==1.1.14" - - name: Set up cache - uses: actions/cache@v3 - id: cache + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + if: env.PUBLISH == 'true' with: - path: | - .venv - ${{ env.poetry_cache_dir }} - ${{ env.poetry_virtualenvs_path }} - key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} - - - name: Ensure cache is healthy - if: steps.cache.outputs.cache-hit == 'true' - shell: bash - run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv + python-version: ${{ matrix.python-version }} + cache: 'poetry' - name: Install dependencies [w/ docs] if: env.PUBLISH == 'true' run: poetry install --extras "docs lint" + - name: Print python versions + if: env.PUBLISH == 'true' + run: | + python -V + poetry run python -V + - name: Build documentation if: env.PUBLISH == 'true' run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bd163d27..d0cd74c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,53 +13,23 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Get full Python version - id: full-python-version - shell: bash - run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") - - name: Install poetry - run: | - curl -O -sSL https://install.python-poetry.org/install-poetry.py - python install-poetry.py -y --version 1.1.14 - echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV - rm install-poetry.py + run: pipx install "poetry==1.1.14" - - name: Add ~/.local/bin to PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Get poetry cache paths from config - run: | - echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV - echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV - - - name: Configure poetry - shell: bash - run: poetry config virtualenvs.in-project true - - - name: Set up cache - uses: actions/cache@v3 - id: cache + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - path: | - .venv - ${{ env.poetry_cache_dir }} - ${{ env.poetry_virtualenvs_path }} - key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} - - - name: Ensure cache is healthy - if: steps.cache.outputs.cache-hit == 'true' - shell: bash - run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv + python-version: ${{ matrix.python-version }} + cache: 'poetry' - name: Install dependencies run: poetry install -E "docs test coverage lint format" + - name: Print python versions + run: | + python -V + poetry run python -V + - name: Lint with flake8 run: poetry run flake8 From 6816b181b5f78c6c427af893575544f10efa4e2e Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 08:56:42 +0200 Subject: [PATCH 03/17] ci(pytest): Add options --- setup.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.cfg b/setup.cfg index 9280fbea..56e7065b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,3 +18,6 @@ known_pytest = pytest,py known_first_party = cihai,unihan_etl sections = FUTURE,STDLIB,PYTEST,THIRDPARTY,FIRSTPARTY,LOCALFOLDER line_length = 88 + +[tool:pytest] +addopts = --tb=short --no-header --showlocals From 687e9a2b5ab42c3d06166c03c52b83ecf30d9fd8 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 08:57:13 +0200 Subject: [PATCH 04/17] ci(pytest): Add doctest options --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 56e7065b..660028c6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,4 +20,5 @@ sections = FUTURE,STDLIB,PYTEST,THIRDPARTY,FIRSTPARTY,LOCALFOLDER line_length = 88 [tool:pytest] -addopts = --tb=short --no-header --showlocals +addopts = --tb=short --no-header --showlocals --doctest-modules +doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE From af5f08014569b25bcedde26e2799eeab37fd5d8a Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 09:21:44 +0200 Subject: [PATCH 05/17] ci(pytest): Add testpaths to avoid hanging up on virtualenv dir --- setup.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.cfg b/setup.cfg index 660028c6..4c49f2b5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,3 +22,7 @@ line_length = 88 [tool:pytest] addopts = --tb=short --no-header --showlocals --doctest-modules doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE +testpaths = + cihai + tests + docs From fed102fb9bf584cd4a3bd52d84c4580469af6dfe Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 09:26:36 +0200 Subject: [PATCH 06/17] docs(conf): Fix paths so pytest can handle the file --- docs/conf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 773359c8..f26aab08 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,21 +2,22 @@ import inspect import os import sys +import typing as t from os.path import dirname, relpath from pathlib import Path import cihai # Get the project root dir, which is the parent dir of this -cwd = Path.cwd() +cwd = Path(__file__).parent project_root = cwd.parent sys.path.insert(0, str(project_root)) sys.path.insert(0, str(cwd / "_ext")) # package data -about = {} -with open("../cihai/__about__.py") as fp: +about: t.Dict[str, str] = {} +with open(project_root / "cihai" / "__about__.py") as fp: exec(fp.read(), about) extensions = [ From 7bace4488a20d04ad57d7338c40ce8fcbfc55e78 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 09:32:37 +0200 Subject: [PATCH 07/17] tests(doctests): Skip some doctests that won't work --- cihai/conversion.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cihai/conversion.py b/cihai/conversion.py index ed182aec..70ac96e0 100644 --- a/cihai/conversion.py +++ b/cihai/conversion.py @@ -142,7 +142,7 @@ def ucn_to_unicode(ucn): def euc_to_unicode(hexstr): - """ + r""" Return EUC-CN (GB2312) hex to a Python unicode. Parameters @@ -158,16 +158,16 @@ def euc_to_unicode(hexstr): -------- >>> u'\u4e00'.encode('gb2312').decode('utf-8') - u'\u04bb' + '\u04bb' - >>> (b'\\x' + b'd2' + b'\\x' + b'bb').replace('\\x', '') \\ + >>> (b'\\x' + b'd2' + b'\\x' + b'bb').replace('\\x', '') \ # doctest: +SKIP ... .decode('hex').decode('utf-8') u'\u04bb' Note: bytes don't have a ``.replace``: - >>> gb_enc = gb_enc.replace('\\x', '').decode('hex') - >>> gb_enc.decode('string_escape') # Won't work with Python 3.x. + >>> gb_enc = gb_enc.replace('\\x', '').decode('hex') # doctest: +SKIP + >>> gb_enc.decode('string_escape') # Won't work with Python 3.x. # doctest: +SKIP """ hi = hexstr[0:2] lo = hexstr[2:4] From fc3c1cdf2d7d9d94d095557ea09431bd9fc8ab96 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 10:16:12 +0200 Subject: [PATCH 08/17] ci(tests): Add basic mypy type checking --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d0cd74c7..5321d401 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,6 +33,9 @@ jobs: - name: Lint with flake8 run: poetry run flake8 + - name: Lint with mypy + run: poetry run mypy . + - name: Test with pytest run: poetry run py.test --cov=./ --cov-report=xml From 572b9049f237768e3997f23a049e05a0c0070521 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 10:18:04 +0200 Subject: [PATCH 09/17] build(deps): Add sqlalchemy-stubs Alternative to types-SQLAlchemy. This version has extra support for mypy in a plugin form. See also: - https://github.com/dropbox/sqlalchemy-stubs - https://pypi.org/project/types-SQLAlchemy/ --- poetry.lock | 18 +++++++++++++++++- pyproject.toml | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index 0e55424b..ab864c7d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -862,6 +862,18 @@ postgresql_psycopg2binary = ["psycopg2-binary"] postgresql_psycopg2cffi = ["psycopg2cffi"] pymysql = ["pymysql (<1)", "pymysql"] +[[package]] +name = "sqlalchemy-stubs" +version = "0.4" +description = "SQLAlchemy stubs and mypy plugin" +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +mypy = ">=0.790" +typing-extensions = ">=3.7.4" + [[package]] name = "tomli" version = "2.0.1" @@ -970,7 +982,7 @@ test = [] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "5ca6c69c7b2d649538615f94dea1f9318928ed719d32f00eda649c306a777035" +content-hash = "ab1162503e66f720b5d3a34c1341ebf55ec404ad0b64745f218c6a74ecbd0e32" [metadata.files] alabaster = [ @@ -1291,6 +1303,10 @@ sqlalchemy = [ {file = "SQLAlchemy-1.3.24-cp39-cp39-win_amd64.whl", hash = "sha256:09083c2487ca3c0865dc588e07aeaa25416da3d95f7482c07e92f47e080aa17b"}, {file = "SQLAlchemy-1.3.24.tar.gz", hash = "sha256:ebbb777cbf9312359b897bf81ba00dae0f5cb69fba2a18265dcc18a6f5ef7519"}, ] +sqlalchemy-stubs = [ + {file = "sqlalchemy-stubs-0.4.tar.gz", hash = "sha256:c665d6dd4482ef642f01027fa06c3d5e91befabb219dc71fc2a09e7d7695f7ae"}, + {file = "sqlalchemy_stubs-0.4-py3-none-any.whl", hash = "sha256:5eec7aa110adf9b957b631799a72fef396b23ff99fe296df726645d01e312aa5"}, +] tomli = [] tornado = [ {file = "tornado-6.2-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:20f638fd8cc85f3cbae3c732326e96addff0a15e22d80f049e00121651e82e72"}, diff --git a/pyproject.toml b/pyproject.toml index 42236a56..22abcbed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,7 @@ isort = "*" ### Lint ### flake8 = "*" mypy = "*" +sqlalchemy-stubs = "^0.4" [tool.poetry.extras] "cli" = ["cihai-cli"] @@ -110,7 +111,7 @@ docs = [ test = ["pytest", "pytest-rerunfailures", "pytest-watcher"] coverage = ["codecov", "coverage", "pytest-cov"] format = ["black", "isort"] -lint = ["flake8", "mypy"] +lint = ["flake8", "mypy", "sqlalchemy-stubs"] [build-system] requires = ["poetry_core>=1.0.0"] From f542d6a506d97f2370eabb02fbb1417ba74b76b8 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 10:19:04 +0200 Subject: [PATCH 10/17] ci(mypy): Add sqlalchemy-stubs --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 22abcbed..63e76cc7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,6 +113,11 @@ coverage = ["codecov", "coverage", "pytest-cov"] format = ["black", "isort"] lint = ["flake8", "mypy", "sqlalchemy-stubs"] +[tool.mypy] +plugins = [ + "sqlmypy" +] + [build-system] requires = ["poetry_core>=1.0.0"] build-backend = "poetry.core.masonry.api" From fc53fb679532f87ed2aae2ad4fc7c67e464fa99a Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 10:26:30 +0200 Subject: [PATCH 11/17] build(deps): Add types-appdirs --- poetry.lock | 14 +++++++++++++- pyproject.toml | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index ab864c7d..6f3c93f6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -898,6 +898,14 @@ category = "dev" optional = false python-versions = ">=3.6" +[[package]] +name = "types-appdirs" +version = "1.4.3" +description = "Typing stubs for appdirs" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "typing-extensions" version = "4.3.0" @@ -982,7 +990,7 @@ test = [] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "ab1162503e66f720b5d3a34c1341ebf55ec404ad0b64745f218c6a74ecbd0e32" +content-hash = "4ad7fdc52ebd8580629feb82cc9a2a1bdce1de6a04dae5c1908a284b4f7427f6" [metadata.files] alabaster = [ @@ -1322,6 +1330,10 @@ tornado = [ {file = "tornado-6.2.tar.gz", hash = "sha256:9b630419bde84ec666bfd7ea0a4cb2a8a651c2d5cccdbdd1972a0c859dfc3c13"}, ] typed-ast = [] +types-appdirs = [ + {file = "types-appdirs-1.4.3.tar.gz", hash = "sha256:387bb4048b43c26ffdb9497f4629145c71fc309b12f040edd0bb95b603d95792"}, + {file = "types_appdirs-1.4.3-py3-none-any.whl", hash = "sha256:5668e717e2278cce002139fa008d6f17ec4754b1430005185d1d7f30139bee39"}, +] typing-extensions = [] unicodecsv = [ {file = "unicodecsv-0.14.1.tar.gz", hash = "sha256:018c08037d48649a0412063ff4eda26eaa81eff1546dbffa51fa5293276ff7fc"}, diff --git a/pyproject.toml b/pyproject.toml index 63e76cc7..ffc43873 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,6 +91,7 @@ isort = "*" flake8 = "*" mypy = "*" sqlalchemy-stubs = "^0.4" +types-appdirs = "^1.4.3" [tool.poetry.extras] "cli" = ["cihai-cli"] @@ -111,7 +112,7 @@ docs = [ test = ["pytest", "pytest-rerunfailures", "pytest-watcher"] coverage = ["codecov", "coverage", "pytest-cov"] format = ["black", "isort"] -lint = ["flake8", "mypy", "sqlalchemy-stubs"] +lint = ["flake8", "mypy", "sqlalchemy-stubs", "types-appdirs"] [tool.mypy] plugins = [ From 1ab161a18cab050e06f21b1dec1aeec91586966f Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 10:28:02 +0200 Subject: [PATCH 12/17] build(deps): Add types-colorama --- poetry.lock | 14 +++++++++++++- pyproject.toml | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6f3c93f6..1324d41e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -906,6 +906,14 @@ category = "dev" optional = false python-versions = "*" +[[package]] +name = "types-colorama" +version = "0.4.15" +description = "Typing stubs for colorama" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "typing-extensions" version = "4.3.0" @@ -990,7 +998,7 @@ test = [] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "4ad7fdc52ebd8580629feb82cc9a2a1bdce1de6a04dae5c1908a284b4f7427f6" +content-hash = "5669cec7cade9c11cc3f65faf143310f75f5a6f138c0949812fac09e7ccbe768" [metadata.files] alabaster = [ @@ -1334,6 +1342,10 @@ types-appdirs = [ {file = "types-appdirs-1.4.3.tar.gz", hash = "sha256:387bb4048b43c26ffdb9497f4629145c71fc309b12f040edd0bb95b603d95792"}, {file = "types_appdirs-1.4.3-py3-none-any.whl", hash = "sha256:5668e717e2278cce002139fa008d6f17ec4754b1430005185d1d7f30139bee39"}, ] +types-colorama = [ + {file = "types-colorama-0.4.15.tar.gz", hash = "sha256:fd128b1e32f3fecec5f09df4366d21498ee86ea31fcf8b4e8f1ade6d0bbf9832"}, + {file = "types_colorama-0.4.15-py3-none-any.whl", hash = "sha256:9cdc88dcde9e8ebafb2fdfaf5cee260452f93e5c57eb5d8b2a7f65b836d4e5d0"}, +] typing-extensions = [] unicodecsv = [ {file = "unicodecsv-0.14.1.tar.gz", hash = "sha256:018c08037d48649a0412063ff4eda26eaa81eff1546dbffa51fa5293276ff7fc"}, diff --git a/pyproject.toml b/pyproject.toml index ffc43873..8d243526 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,6 +92,7 @@ flake8 = "*" mypy = "*" sqlalchemy-stubs = "^0.4" types-appdirs = "^1.4.3" +types-colorama = "^0.4.15" [tool.poetry.extras] "cli" = ["cihai-cli"] @@ -112,7 +113,7 @@ docs = [ test = ["pytest", "pytest-rerunfailures", "pytest-watcher"] coverage = ["codecov", "coverage", "pytest-cov"] format = ["black", "isort"] -lint = ["flake8", "mypy", "sqlalchemy-stubs", "types-appdirs"] +lint = ["flake8", "mypy", "sqlalchemy-stubs", "types-appdirs", "types-colorama"] [tool.mypy] plugins = [ From 811bdb7e480f955084036f8d43ad78fca32e5f95 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 10:28:59 +0200 Subject: [PATCH 13/17] ci(mypy): Ignore untyped packages --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8d243526..feaf47b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,6 +120,13 @@ plugins = [ "sqlmypy" ] +[[tool.mypy.overrides]] +module = [ + "unihan_etl.*", + "kaptan" +] +ignore_missing_imports = true + [build-system] requires = ["poetry_core>=1.0.0"] build-backend = "poetry.core.masonry.api" From 1fab00893f739e3719e14660f03e276417bdd2dd Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 10:29:37 +0200 Subject: [PATCH 14/17] chore(docs[conf]): Type annotations --- docs/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f26aab08..d6dac274 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,7 +59,8 @@ html_css_files = ["css/custom.css"] html_favicon = "_static/favicon.ico" html_theme = "furo" -html_theme_options = { +html_theme_path: t.List[str] = [] +html_theme_options: t.Dict[str, t.Union[str, t.List[t.Dict[str, str]]]] = { "light_logo": "img/cihai.svg", "dark_logo": "img/cihai.svg", "footer_icons": [ @@ -75,7 +76,6 @@ }, ], } -html_theme_path = [] html_sidebars = { "**": [ "sidebar/scroll-start.html", From d87af4c1c095bc979fc93a3e080ed690fa7a9c06 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 11:41:08 +0200 Subject: [PATCH 15/17] docs(CHANGES): Note latest infrastructure updates --- CHANGES | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index 938bc88f..9f40d47d 100644 --- a/CHANGES +++ b/CHANGES @@ -11,10 +11,24 @@ ### Development +Infrastructure updates for static type checking and doctest examples. + - Update poetry to 1.1 - CI: Use poetry 1.1.12 and `install-poetry.py` installer (#296 + #317) - Relock poetry.lock at 1.1 (w/ 1.1.7's fix) - Add `.pre-commit-config.yaml` (#317) +- Initial [doctests] support added, via #323 + + [doctests]: https://docs.python.org/3/library/doctest.html + +- Initial [mypy] validation, via #323 + + [mypy]: https://github.com/python/mypy + +- CI (tests, docs): Improve caching of python dependencies via + `action/setup-python`'s v3/4's new poetry caching, via #323 + +- CI (docs): Skip if no `PUBLISH` condition triggered, via #323 ## cihai 0.12.0 (2021-06-16) From 579b6521e7af5671103c922e3cb0d539291be60a Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 11:41:15 +0200 Subject: [PATCH 16/17] ci: Remove pre-commit (users should do these things themselves) --- .pre-commit-config.yaml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index db0347ee..00000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,15 +0,0 @@ -repos: -- repo: https://github.com/psf/black - rev: 22.3.0 - hooks: - - id: black - language_version: python3.10 -- repo: https://github.com/pycqa/isort - rev: 5.10.1 - hooks: - - id: isort - name: isort (python) -- repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 - hooks: - - id: flake8 From d36cd4553be40b7dc8b10f2f3da2fcd1eea3a8f8 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 16 Aug 2022 11:41:51 +0200 Subject: [PATCH 17/17] docs(CHANGES): Note removal of .pre-commit-config.yaml --- CHANGES | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES b/CHANGES index 9f40d47d..eb0962f5 100644 --- a/CHANGES +++ b/CHANGES @@ -16,7 +16,6 @@ Infrastructure updates for static type checking and doctest examples. - Update poetry to 1.1 - CI: Use poetry 1.1.12 and `install-poetry.py` installer (#296 + #317) - Relock poetry.lock at 1.1 (w/ 1.1.7's fix) -- Add `.pre-commit-config.yaml` (#317) - Initial [doctests] support added, via #323 [doctests]: https://docs.python.org/3/library/doctest.html