From d3a76686c79cb11f8e236adb36dd081cd830c15e Mon Sep 17 00:00:00 2001 From: Daniel Rodriguez Date: Sun, 24 Sep 2023 00:33:57 -0500 Subject: [PATCH] Use src layout and fix tests (#169) --- .github/workflows/docs.yml | 52 ++-- .github/workflows/test.yml | 39 ++- Taskfile.yml | 7 +- js/vite.config.js | 1 + pyproject.toml | 113 ++++----- requirements-dev.lock | 56 +++++ requirements.lock | 3 + requirements/all.txt | 2 - requirements/linting.in | 5 - requirements/linting.txt | 51 ---- requirements/pyproject.txt | 236 ------------------ .../mkdocs_jupyter}/__about__.py | 0 .../mkdocs_jupyter}/__init__.py | 0 .../mkdocs_jupyter}/config.py | 0 .../mkdocs_jupyter}/convert.py | 0 .../mkdocs_jupyter}/nbconvert2.py | 0 .../mkdocs_jupyter}/plugin.py | 0 .../mkdocs_jupyter}/preprocessors.py | 0 .../templates/mkdocs_html/assets/.gitignore | 0 .../mkdocs_html/assets/clipboard.umd.js | 0 .../templates/mkdocs_html/conf.json | 0 .../templates/mkdocs_html/notebook.html.j2 | 0 .../templates/mkdocs_md/conf.json | 0 .../templates/mkdocs_md/md-no-codecell.md.j2 | 0 .../mkdocs_jupyter}/tests/__init__.py | 0 .../tests/mkdocs/base-with-nbs-failure.yml | 0 .../tests/mkdocs/base-with-nbs-pys.yml | 0 .../tests/mkdocs/base-with-nbs.yml | 0 .../tests/mkdocs/base-with-pys.yml | 0 .../tests/mkdocs/base-without-nbs.yml | 0 .../tests/mkdocs/docs/demo-script.py | 0 .../tests/mkdocs/docs/demo.ipynb | 0 .../tests/mkdocs/docs/extras/README.md | 0 .../tests/mkdocs/docs/extras/default.css | 0 .../tests/mkdocs/docs/extras/material.css | 0 .../tests/mkdocs/docs/extras/styles.css | 0 .../tests/mkdocs/docs/extras/styles.py | 0 .../tests/mkdocs/docs/fail.ipynb | 0 .../tests/mkdocs/docs/img/jupyter.png | Bin .../tests/mkdocs/docs/index.md | 0 .../tests/mkdocs/docs/ruby.ipynb | 0 .../docs/variational-inference-script.py | 0 .../mkdocs/docs/variational-inference.ipynb | 0 .../tests/mkdocs/material-execute-ignore.yml | 0 .../tests/mkdocs/material-with-nbs-pys.yml | 0 .../tests/mkdocs/material-with-nbs.yml | 0 .../tests/mkdocs/material-with-pys.yml | 0 .../tests/mkdocs/overrides/main.html | 0 .../mkdocs_jupyter}/tests/test_base_usage.py | 0 .../mkdocs_jupyter}/tests/test_pkg.py | 7 +- .../mkdocs_jupyter}/utils.py | 0 51 files changed, 152 insertions(+), 420 deletions(-) delete mode 100644 requirements/all.txt delete mode 100644 requirements/linting.in delete mode 100644 requirements/linting.txt delete mode 100644 requirements/pyproject.txt rename {mkdocs_jupyter => src/mkdocs_jupyter}/__about__.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/__init__.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/config.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/convert.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/nbconvert2.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/plugin.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/preprocessors.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/templates/mkdocs_html/assets/.gitignore (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/templates/mkdocs_html/assets/clipboard.umd.js (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/templates/mkdocs_html/conf.json (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/templates/mkdocs_html/notebook.html.j2 (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/templates/mkdocs_md/conf.json (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/templates/mkdocs_md/md-no-codecell.md.j2 (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/__init__.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/base-with-nbs-failure.yml (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/base-with-nbs-pys.yml (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/base-with-nbs.yml (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/base-with-pys.yml (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/base-without-nbs.yml (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/demo-script.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/demo.ipynb (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/extras/README.md (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/extras/default.css (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/extras/material.css (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/extras/styles.css (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/extras/styles.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/fail.ipynb (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/img/jupyter.png (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/index.md (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/ruby.ipynb (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/variational-inference-script.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/docs/variational-inference.ipynb (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/material-execute-ignore.yml (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/material-with-nbs-pys.yml (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/material-with-nbs.yml (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/material-with-pys.yml (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/mkdocs/overrides/main.html (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/test_base_usage.py (100%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/tests/test_pkg.py (73%) rename {mkdocs_jupyter => src/mkdocs_jupyter}/utils.py (100%) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c2cff83..95f5a9b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -33,30 +33,23 @@ jobs: # ------------------------------------------------------------------------ # Set up JS - - name: Set up Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - name: Set up pnpm + uses: pnpm/action-setup@v2 with: - node-version: ${{ matrix.node-version }} + version: 8 - - name: Load cached node_modules - id: cached-node_modules - uses: actions/cache@v3 + - name: Set up Node.js + uses: actions/setup-node@v3 with: - path: js/node_modules - key: > - node_modules - ${{ runner.os }} - node-${{ matrix.node-version }} - ${{ hashFiles('js/package*.json') }} + node-version: ${{ matrix.node-version }} - name: Install JS deps - if: steps.cached-node_modules.outputs.cache-hit != 'true' run: | - task js-install + task js:install - name: Build JS run: | - task js-build + task js:build # ------------------------------------------------------------------------ # Setup Python @@ -66,32 +59,29 @@ jobs: with: python-version: ${{ matrix.python-version }} - # - uses: actions/cache@v3 - # id: cached-python-env - # with: - # path: ${{ env.pythonLocation }} - # key: > - # python - # ${{ runner.os }} - # python-${{ matrix.python-version }} - # ${{ hashFiles('pyproject.toml') }} - # ${{ hashFiles('requirements/*') }} + - uses: actions/cache@v3 + id: cached-python-env + with: + path: ${{ env.pythonLocation }} + key: > + docs + ${{ runner.os }} + python-${{ matrix.python-version }} + ${{ hashFiles('pyproject.toml') }} + ${{ hashFiles('requirements/*') }} - name: Install dependencies # if: steps.cached-python-env.outputs.cache-hit != 'true' - run: | - pip install -r requirements/pyproject.txt + run: pip install -r requirements-dev.lock - name: Install Hatch - run: | - pip install --upgrade hatch + run: pip install --upgrade hatch # ------------------------------------------------------------------------ # Test - name: Build package - run: | - task build + run: hatch build - name: Install package run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22ca06d..7cc11dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: # os: [ubuntu-latest, windows-latest, macos-latest] - python-version: [3.8, 3.9, "3.10", 3.11] + python-version: [3.9, "3.10", 3.11] node-version: [18] runs-on: ubuntu-latest @@ -36,30 +36,23 @@ jobs: # ------------------------------------------------------------------------ # JS - - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - name: Set up pnpm + uses: pnpm/action-setup@v2 with: - node-version: ${{ matrix.node-version }} + version: 8 - - name: Load cached node_modules - id: cached-node_modules - uses: actions/cache@v3 + - name: Set up Node.js + uses: actions/setup-node@v3 with: - path: js/node_modules - key: > - node_modules - ${{ runner.os }} - node-${{ matrix.node-version }} - ${{ hashFiles('js/package*.json') }} + node-version: ${{ matrix.node-version }} - name: Install JS deps - if: steps.cached-node_modules.outputs.cache-hit != 'true' run: | - task js-install + task js:install - name: Build JS run: | - task js-build + task js:build # ------------------------------------------------------------------------ # Python @@ -74,20 +67,18 @@ jobs: with: path: ${{ env.pythonLocation }} key: > - python2 + python ${{ runner.os }} python-${{ matrix.python-version }} ${{ hashFiles('pyproject.toml') }} - ${{ hashFiles('requirements/*') }} + ${{ hashFiles('requirements*') }} - name: Install dependencies if: steps.cached-python-env.outputs.cache-hit != 'true' - run: | - pip install -r requirements/pyproject.txt + run: pip install -r requirements-dev.lock - name: Install Hatch - run: | - pip install --upgrade hatch + run: pip install --upgrade hatch - name: Print Python info run: | @@ -101,7 +92,7 @@ jobs: # Test - name: Build package - run: task build + run: hatch build - name: Install package run: | @@ -110,7 +101,7 @@ jobs: - name: Run tests run: | - task test:all + pytest . task report - name: Codecov diff --git a/Taskfile.yml b/Taskfile.yml index 1cf2c02..6778b0f 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,8 +1,5 @@ version: "3" -env: - PYTEST_K: "" - tasks: build: cmds: @@ -25,11 +22,11 @@ tasks: test: cmds: - - pytest -k "{{.PYTEST_K}}" + - rye run pytest -k "{{.name}}" test:all: cmds: - - pytest . + - rye run pytest . report: cmds: diff --git a/js/vite.config.js b/js/vite.config.js index a9ecbce..0514ea7 100644 --- a/js/vite.config.js +++ b/js/vite.config.js @@ -6,6 +6,7 @@ export default defineConfig({ outDir: path.join( __dirname, "..", + "src", "mkdocs_jupyter", "templates", "mkdocs_html" diff --git a/pyproject.toml b/pyproject.toml index 4417f04..dbcc277 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,15 +2,13 @@ name = "mkdocs-jupyter" description = "Use Jupyter in mkdocs websites" readme = "README.md" -requires-python = ">=3.7" -license = "Apache-2.0" +requires-python = ">=3.9" +license = { "text" = "Apache-2.0" } keywords = ["mkdocs", "jupyter", "jupyterlab", "notebooks", "documentation"] authors = [{ name = "Daniel Rodriguez", email = "daniel@danielfrg.com" }] classifiers = [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -27,52 +25,44 @@ dependencies = [ ] dynamic = ["version"] -[project.urls] -Documentation = "https://github.com/danielfrg/mkdocs-jupyter#readme" -Issues = "https://github.com/danielfrg/mkdocs-jupyter/issues" -Source = "https://github.com/danielfrg/mkdocs-jupyter" - -[project.entry-points."mkdocs.plugins"] -mkdocs-jupyter = "mkdocs_jupyter.plugin:Plugin" - -[project.optional-dependencies] -test = ["coverage[toml]", "pymdown-extensions", "pytest", "pytest-cov"] - -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[tool.hatch.build] -artifacts = ["mkdocs_jupyter/**"] -exclude = [".github", "docs"] - -[tool.hatch.version] -path = "mkdocs_jupyter/__about__.py" - -[tool.hatch.envs.default] -dependencies = [ +[tool.rye] +managed = true +dev-dependencies = [ + # Testing + "coverage[toml]", + "pymdown-extensions", + "pytest", + "pytest-cov", # Linting "black", "flake8", "isort", "pip-tools", "ruff", - # Development + # Utils "jupyterlab", ] -[tool.hatch.envs.default.scripts] -cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=adsctl --cov=tests {args}" -no-cov = "cov --no-cov {args}" +[project.entry-points."mkdocs.plugins"] +mkdocs-jupyter = "mkdocs_jupyter.plugin:Plugin" + +[tool.hatch.build] +artifacts = ["mkdocs_jupyter/**"] +exclude = [".github", "docs"] -[[tool.hatch.envs.test.matrix]] -python = ["37", "38", "39", "310", "311"] +[tool.hatch.version] +path = "src/mkdocs_jupyter/__about__.py" + +[tool.hatch.metadata] +allow-direct-references = true [tool.pytest.ini_options] -testpaths = ["mkdocs_jupyter/tests"] +testpaths = ["tests"] addopts = [ "-s", "-vv", + "--strict-config", + "--strict-markers", "--ignore=dist", "--ignore=site-packages", # "--strict-markers", @@ -80,42 +70,41 @@ addopts = [ "--cov-report=term", "--cov-config=pyproject.toml", ] +markers = [ + "pkg: marks tests as Packaging tests", + "adsapi: mark test that require connection to the API", +] xfail_strict = true +filterwarnings = ["ignore::DeprecationWarning"] [tool.coverage.run] branch = true parallel = true -omit = ["adsctl/__about__.py"] +omit = ["tests/*"] [tool.coverage.report] -show_missing = true -ignore_errors = false - -exclude_lines = [ - "no cov", - "if __name__ == .__main__.:", - "if TYPE_CHECKING:", - "pragma: no cover", - "raise NotImplementedError", +exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"] + +[tool.ruff] +select = [ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "F", # pyflakes + # "I", # isort + "B", # flake8-bugbear ] -omit = ["mkdocs_jupyter/tests/*"] - -[tool.coverage.paths] -source = ["mkdocs_jupyter", ".venv/lib/python*/site-packages/mkdocs_jupyter"] - -[tool.black] -line_length = 79 -skip_string_normalization = true [tool.isort] -ensure_newline_before_comments = true -line_length = 79 -multi_line_output = 3 -include_trailing_comma = true profile = "black" -[tool.pydocstyle] -add_ignore = ["D100", "D101", "D102", "D103", "D104", "D105"] -convention = "numpy" -inherit = false -match_dir = "mkdocs_jupyter" +[tool.mypy] +strict = true + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project.urls] +Documentation = "https://github.com/danielfrg/mkdocs-jupyter#readme" +Issues = "https://github.com/danielfrg/mkdocs-jupyter/issues" +Source = "https://github.com/danielfrg/mkdocs-jupyter" diff --git a/requirements-dev.lock b/requirements-dev.lock index 9f48cbc..8f244d1 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -7,37 +7,63 @@ # all-features: false -e file:. +anyio==4.0.0 appnope==0.1.3 +argon2-cffi==23.1.0 +argon2-cffi-bindings==21.2.0 +arrow==1.2.3 asttokens==2.2.1 +async-lru==2.0.4 attrs==23.1.0 +babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 +black==23.9.1 bleach==6.0.0 +build==1.0.3 certifi==2023.5.7 +cffi==1.15.1 charset-normalizer==3.1.0 click==8.1.3 colorama==0.4.6 comm==0.1.3 +coverage==7.3.1 debugpy==1.6.7 decorator==5.1.1 defusedxml==0.7.1 +exceptiongroup==1.1.3 executing==1.2.0 fastjsonschema==2.17.1 +flake8==6.1.0 +fqdn==1.5.1 ghp-import==2.1.0 idna==3.4 +importlib-metadata==6.8.0 +iniconfig==2.0.0 ipykernel==6.24.0 ipython==8.14.0 +isoduration==20.11.0 +isort==5.12.0 jedi==0.18.2 jinja2==3.1.2 +json5==0.9.14 +jsonpointer==2.4 jsonschema==4.17.3 jupyter-client==8.3.0 jupyter-core==5.3.1 +jupyter-events==0.6.3 +jupyter-lsp==2.2.0 +jupyter-server==2.7.3 +jupyter-server-terminals==0.4.4 +jupyterlab==4.0.6 jupyterlab-pygments==0.2.2 +jupyterlab-server==2.24.0 jupytext==1.14.7 markdown==3.3.7 markdown-it-py==3.0.0 markupsafe==2.1.3 matplotlib-inline==0.1.6 +mccabe==0.7.0 mdit-py-plugins==0.4.0 mdurl==0.1.2 mergedeep==1.3.4 @@ -45,37 +71,67 @@ mistune==3.0.1 mkdocs==1.4.3 mkdocs-material==9.1.18 mkdocs-material-extensions==1.1.1 +mypy-extensions==1.0.0 nbclient==0.8.0 nbconvert==7.6.0 nbformat==5.9.0 nest-asyncio==1.5.6 +notebook-shim==0.2.3 +overrides==7.4.0 packaging==23.1 pandocfilters==1.5.0 parso==0.8.3 +pathspec==0.11.2 pexpect==4.8.0 pickleshare==0.7.5 +pip-tools==7.3.0 platformdirs==3.8.0 +pluggy==1.3.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.38 psutil==5.9.5 ptyprocess==0.7.0 pure-eval==0.2.2 +pycodestyle==2.11.0 +pycparser==2.21 +pyflakes==3.1.0 pygments==2.15.1 pymdown-extensions==10.0.1 +pyproject-hooks==1.0.0 pyrsistent==0.19.3 +pytest==7.4.2 +pytest-cov==4.1.0 python-dateutil==2.8.2 +python-json-logger==2.0.7 pyyaml==6.0 pyyaml-env-tag==0.1 pyzmq==25.1.0 regex==2023.6.3 requests==2.31.0 +rfc3339-validator==0.1.4 +rfc3986-validator==0.1.1 +ruff==0.0.291 +send2trash==1.8.2 six==1.16.0 +sniffio==1.3.0 soupsieve==2.4.1 stack-data==0.6.2 +terminado==0.17.1 tinycss2==1.2.1 toml==0.10.2 +tomli==2.0.1 tornado==6.3.2 traitlets==5.9.0 +typing-extensions==4.8.0 +uri-template==1.3.0 urllib3==2.0.3 watchdog==3.0.0 wcwidth==0.2.6 +webcolors==1.13 webencodings==0.5.1 +websocket-client==1.6.3 +wheel==0.41.2 +zipp==3.17.0 +# The following packages are considered to be unsafe in a requirements file: +pip==23.2.1 +setuptools==68.2.2 diff --git a/requirements.lock b/requirements.lock index 9f48cbc..211a00a 100644 --- a/requirements.lock +++ b/requirements.lock @@ -25,6 +25,7 @@ executing==1.2.0 fastjsonschema==2.17.1 ghp-import==2.1.0 idna==3.4 +importlib-metadata==6.8.0 ipykernel==6.24.0 ipython==8.14.0 jedi==0.18.2 @@ -75,7 +76,9 @@ tinycss2==1.2.1 toml==0.10.2 tornado==6.3.2 traitlets==5.9.0 +typing-extensions==4.8.0 urllib3==2.0.3 watchdog==3.0.0 wcwidth==0.2.6 webencodings==0.5.1 +zipp==3.17.0 diff --git a/requirements/all.txt b/requirements/all.txt deleted file mode 100644 index 86dcff2..0000000 --- a/requirements/all.txt +++ /dev/null @@ -1,2 +0,0 @@ --r ./pyproject.txt --r ./linting.txt diff --git a/requirements/linting.in b/requirements/linting.in deleted file mode 100644 index 48974c4..0000000 --- a/requirements/linting.in +++ /dev/null @@ -1,5 +0,0 @@ -black -flake8 -isort -pip-tools -ruff diff --git a/requirements/linting.txt b/requirements/linting.txt deleted file mode 100644 index ddf8392..0000000 --- a/requirements/linting.txt +++ /dev/null @@ -1,51 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --output-file=requirements/linting.txt --resolver=backtracking requirements/linting.in -# -black==23.1.0 - # via -r requirements/linting.in -build==0.10.0 - # via pip-tools -click==8.1.3 - # via - # black - # pip-tools -flake8==6.0.0 - # via -r requirements/linting.in -isort==5.12.0 - # via -r requirements/linting.in -mccabe==0.7.0 - # via flake8 -mypy-extensions==1.0.0 - # via black -packaging==23.0 - # via - # black - # build -pathspec==0.11.1 - # via black -pip-tools==6.12.3 - # via -r requirements/linting.in -platformdirs==3.2.0 - # via black -pycodestyle==2.10.0 - # via flake8 -pyflakes==3.0.1 - # via flake8 -pyproject-hooks==1.0.0 - # via build -ruff==0.0.259 - # via -r requirements/linting.in -tomli==2.0.1 - # via - # black - # build - # pyproject-hooks -wheel==0.40.0 - # via pip-tools - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools diff --git a/requirements/pyproject.txt b/requirements/pyproject.txt deleted file mode 100644 index 6331a71..0000000 --- a/requirements/pyproject.txt +++ /dev/null @@ -1,236 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --extra=test --output-file=requirements/pyproject.txt --resolver=backtracking pyproject.toml -# -appnope==0.1.3 - # via - # ipykernel - # ipython -asttokens==2.2.1 - # via stack-data -attrs==22.2.0 - # via - # jsonschema - # pytest -backcall==0.2.0 - # via ipython -beautifulsoup4==4.12.0 - # via nbconvert -bleach==6.0.0 - # via nbconvert -certifi==2023.7.22 - # via requests -charset-normalizer==3.1.0 - # via requests -click==8.1.3 - # via mkdocs -colorama==0.4.6 - # via mkdocs-material -comm==0.1.3 - # via ipykernel -coverage[toml]==7.2.2 - # via - # mkdocs-jupyter (pyproject.toml) - # pytest-cov -debugpy==1.6.6 - # via ipykernel -decorator==5.1.1 - # via ipython -defusedxml==0.7.1 - # via nbconvert -entrypoints==0.4 - # via jupyter-client -executing==1.2.0 - # via stack-data -fastjsonschema==2.16.3 - # via nbformat -ghp-import==2.1.0 - # via mkdocs -idna==3.4 - # via requests -iniconfig==2.0.0 - # via pytest -ipykernel==6.22.0 - # via mkdocs-jupyter (pyproject.toml) -ipython==8.11.0 - # via ipykernel -jedi==0.18.2 - # via ipython -jinja2==3.0.3 - # via - # mkdocs - # mkdocs-material - # nbconvert -jsonschema==4.17.3 - # via nbformat -jupyter-client==7.4.1 - # via - # ipykernel - # nbclient -jupyter-core==5.3.0 - # via - # ipykernel - # jupyter-client - # nbclient - # nbconvert - # nbformat -jupyterlab-pygments==0.2.2 - # via nbconvert -jupytext==1.14.5 - # via mkdocs-jupyter (pyproject.toml) -markdown==3.3.7 - # via - # mkdocs - # mkdocs-material - # pymdown-extensions -markdown-it-py==2.2.0 - # via - # jupytext - # mdit-py-plugins -markupsafe==2.1.2 - # via - # jinja2 - # nbconvert -matplotlib-inline==0.1.6 - # via - # ipykernel - # ipython -mdit-py-plugins==0.3.5 - # via jupytext -mdurl==0.1.2 - # via markdown-it-py -mergedeep==1.3.4 - # via mkdocs -mistune==2.0.5 - # via nbconvert -mkdocs==1.4.2 - # via - # mkdocs-jupyter (pyproject.toml) - # mkdocs-material -mkdocs-material==9.1.4 - # via mkdocs-jupyter (pyproject.toml) -mkdocs-material-extensions==1.1.1 - # via mkdocs-material -nbclient==0.7.2 - # via nbconvert -nbconvert==7.2.10 - # via mkdocs-jupyter (pyproject.toml) -nbformat==5.8.0 - # via - # jupytext - # nbclient - # nbconvert -nest-asyncio==1.5.6 - # via - # ipykernel - # jupyter-client -packaging==23.0 - # via - # ipykernel - # mkdocs - # nbconvert - # pytest -pandocfilters==1.5.0 - # via nbconvert -parso==0.8.3 - # via jedi -pexpect==4.8.0 - # via ipython -pickleshare==0.7.5 - # via ipython -platformdirs==3.2.0 - # via jupyter-core -pluggy==1.0.0 - # via pytest -prompt-toolkit==3.0.38 - # via ipython -psutil==5.9.4 - # via ipykernel -ptyprocess==0.7.0 - # via pexpect -pure-eval==0.2.2 - # via stack-data -py==1.11.0 - # via pytest -pygments==2.15.0 - # via - # ipython - # mkdocs-jupyter (pyproject.toml) - # mkdocs-material - # nbconvert -pymdown-extensions==10.0 - # via - # mkdocs-jupyter (pyproject.toml) - # mkdocs-material -pyrsistent==0.19.3 - # via jsonschema -pytest==6.2.5 - # via - # mkdocs-jupyter (pyproject.toml) - # pytest-cov -pytest-cov==4.0.0 - # via mkdocs-jupyter (pyproject.toml) -python-dateutil==2.8.2 - # via - # ghp-import - # jupyter-client -pyyaml==6.0 - # via - # jupytext - # mkdocs - # pymdown-extensions - # pyyaml-env-tag -pyyaml-env-tag==0.1 - # via mkdocs -pyzmq==25.0.2 - # via - # ipykernel - # jupyter-client -regex==2023.3.23 - # via mkdocs-material -requests==2.31.0 - # via mkdocs-material -six==1.16.0 - # via - # asttokens - # bleach - # python-dateutil -soupsieve==2.4 - # via beautifulsoup4 -stack-data==0.6.2 - # via ipython -tinycss2==1.2.1 - # via nbconvert -toml==0.10.2 - # via - # jupytext - # pytest -tomli==2.0.1 - # via coverage -tornado==6.3.3 - # via - # ipykernel - # jupyter-client -traitlets==5.9.0 - # via - # comm - # ipykernel - # ipython - # jupyter-client - # jupyter-core - # matplotlib-inline - # nbclient - # nbconvert - # nbformat -urllib3==1.26.15 - # via requests -watchdog==3.0.0 - # via mkdocs -wcwidth==0.2.6 - # via prompt-toolkit -webencodings==0.5.1 - # via - # bleach - # tinycss2 diff --git a/mkdocs_jupyter/__about__.py b/src/mkdocs_jupyter/__about__.py similarity index 100% rename from mkdocs_jupyter/__about__.py rename to src/mkdocs_jupyter/__about__.py diff --git a/mkdocs_jupyter/__init__.py b/src/mkdocs_jupyter/__init__.py similarity index 100% rename from mkdocs_jupyter/__init__.py rename to src/mkdocs_jupyter/__init__.py diff --git a/mkdocs_jupyter/config.py b/src/mkdocs_jupyter/config.py similarity index 100% rename from mkdocs_jupyter/config.py rename to src/mkdocs_jupyter/config.py diff --git a/mkdocs_jupyter/convert.py b/src/mkdocs_jupyter/convert.py similarity index 100% rename from mkdocs_jupyter/convert.py rename to src/mkdocs_jupyter/convert.py diff --git a/mkdocs_jupyter/nbconvert2.py b/src/mkdocs_jupyter/nbconvert2.py similarity index 100% rename from mkdocs_jupyter/nbconvert2.py rename to src/mkdocs_jupyter/nbconvert2.py diff --git a/mkdocs_jupyter/plugin.py b/src/mkdocs_jupyter/plugin.py similarity index 100% rename from mkdocs_jupyter/plugin.py rename to src/mkdocs_jupyter/plugin.py diff --git a/mkdocs_jupyter/preprocessors.py b/src/mkdocs_jupyter/preprocessors.py similarity index 100% rename from mkdocs_jupyter/preprocessors.py rename to src/mkdocs_jupyter/preprocessors.py diff --git a/mkdocs_jupyter/templates/mkdocs_html/assets/.gitignore b/src/mkdocs_jupyter/templates/mkdocs_html/assets/.gitignore similarity index 100% rename from mkdocs_jupyter/templates/mkdocs_html/assets/.gitignore rename to src/mkdocs_jupyter/templates/mkdocs_html/assets/.gitignore diff --git a/mkdocs_jupyter/templates/mkdocs_html/assets/clipboard.umd.js b/src/mkdocs_jupyter/templates/mkdocs_html/assets/clipboard.umd.js similarity index 100% rename from mkdocs_jupyter/templates/mkdocs_html/assets/clipboard.umd.js rename to src/mkdocs_jupyter/templates/mkdocs_html/assets/clipboard.umd.js diff --git a/mkdocs_jupyter/templates/mkdocs_html/conf.json b/src/mkdocs_jupyter/templates/mkdocs_html/conf.json similarity index 100% rename from mkdocs_jupyter/templates/mkdocs_html/conf.json rename to src/mkdocs_jupyter/templates/mkdocs_html/conf.json diff --git a/mkdocs_jupyter/templates/mkdocs_html/notebook.html.j2 b/src/mkdocs_jupyter/templates/mkdocs_html/notebook.html.j2 similarity index 100% rename from mkdocs_jupyter/templates/mkdocs_html/notebook.html.j2 rename to src/mkdocs_jupyter/templates/mkdocs_html/notebook.html.j2 diff --git a/mkdocs_jupyter/templates/mkdocs_md/conf.json b/src/mkdocs_jupyter/templates/mkdocs_md/conf.json similarity index 100% rename from mkdocs_jupyter/templates/mkdocs_md/conf.json rename to src/mkdocs_jupyter/templates/mkdocs_md/conf.json diff --git a/mkdocs_jupyter/templates/mkdocs_md/md-no-codecell.md.j2 b/src/mkdocs_jupyter/templates/mkdocs_md/md-no-codecell.md.j2 similarity index 100% rename from mkdocs_jupyter/templates/mkdocs_md/md-no-codecell.md.j2 rename to src/mkdocs_jupyter/templates/mkdocs_md/md-no-codecell.md.j2 diff --git a/mkdocs_jupyter/tests/__init__.py b/src/mkdocs_jupyter/tests/__init__.py similarity index 100% rename from mkdocs_jupyter/tests/__init__.py rename to src/mkdocs_jupyter/tests/__init__.py diff --git a/mkdocs_jupyter/tests/mkdocs/base-with-nbs-failure.yml b/src/mkdocs_jupyter/tests/mkdocs/base-with-nbs-failure.yml similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/base-with-nbs-failure.yml rename to src/mkdocs_jupyter/tests/mkdocs/base-with-nbs-failure.yml diff --git a/mkdocs_jupyter/tests/mkdocs/base-with-nbs-pys.yml b/src/mkdocs_jupyter/tests/mkdocs/base-with-nbs-pys.yml similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/base-with-nbs-pys.yml rename to src/mkdocs_jupyter/tests/mkdocs/base-with-nbs-pys.yml diff --git a/mkdocs_jupyter/tests/mkdocs/base-with-nbs.yml b/src/mkdocs_jupyter/tests/mkdocs/base-with-nbs.yml similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/base-with-nbs.yml rename to src/mkdocs_jupyter/tests/mkdocs/base-with-nbs.yml diff --git a/mkdocs_jupyter/tests/mkdocs/base-with-pys.yml b/src/mkdocs_jupyter/tests/mkdocs/base-with-pys.yml similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/base-with-pys.yml rename to src/mkdocs_jupyter/tests/mkdocs/base-with-pys.yml diff --git a/mkdocs_jupyter/tests/mkdocs/base-without-nbs.yml b/src/mkdocs_jupyter/tests/mkdocs/base-without-nbs.yml similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/base-without-nbs.yml rename to src/mkdocs_jupyter/tests/mkdocs/base-without-nbs.yml diff --git a/mkdocs_jupyter/tests/mkdocs/docs/demo-script.py b/src/mkdocs_jupyter/tests/mkdocs/docs/demo-script.py similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/demo-script.py rename to src/mkdocs_jupyter/tests/mkdocs/docs/demo-script.py diff --git a/mkdocs_jupyter/tests/mkdocs/docs/demo.ipynb b/src/mkdocs_jupyter/tests/mkdocs/docs/demo.ipynb similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/demo.ipynb rename to src/mkdocs_jupyter/tests/mkdocs/docs/demo.ipynb diff --git a/mkdocs_jupyter/tests/mkdocs/docs/extras/README.md b/src/mkdocs_jupyter/tests/mkdocs/docs/extras/README.md similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/extras/README.md rename to src/mkdocs_jupyter/tests/mkdocs/docs/extras/README.md diff --git a/mkdocs_jupyter/tests/mkdocs/docs/extras/default.css b/src/mkdocs_jupyter/tests/mkdocs/docs/extras/default.css similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/extras/default.css rename to src/mkdocs_jupyter/tests/mkdocs/docs/extras/default.css diff --git a/mkdocs_jupyter/tests/mkdocs/docs/extras/material.css b/src/mkdocs_jupyter/tests/mkdocs/docs/extras/material.css similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/extras/material.css rename to src/mkdocs_jupyter/tests/mkdocs/docs/extras/material.css diff --git a/mkdocs_jupyter/tests/mkdocs/docs/extras/styles.css b/src/mkdocs_jupyter/tests/mkdocs/docs/extras/styles.css similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/extras/styles.css rename to src/mkdocs_jupyter/tests/mkdocs/docs/extras/styles.css diff --git a/mkdocs_jupyter/tests/mkdocs/docs/extras/styles.py b/src/mkdocs_jupyter/tests/mkdocs/docs/extras/styles.py similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/extras/styles.py rename to src/mkdocs_jupyter/tests/mkdocs/docs/extras/styles.py diff --git a/mkdocs_jupyter/tests/mkdocs/docs/fail.ipynb b/src/mkdocs_jupyter/tests/mkdocs/docs/fail.ipynb similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/fail.ipynb rename to src/mkdocs_jupyter/tests/mkdocs/docs/fail.ipynb diff --git a/mkdocs_jupyter/tests/mkdocs/docs/img/jupyter.png b/src/mkdocs_jupyter/tests/mkdocs/docs/img/jupyter.png similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/img/jupyter.png rename to src/mkdocs_jupyter/tests/mkdocs/docs/img/jupyter.png diff --git a/mkdocs_jupyter/tests/mkdocs/docs/index.md b/src/mkdocs_jupyter/tests/mkdocs/docs/index.md similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/index.md rename to src/mkdocs_jupyter/tests/mkdocs/docs/index.md diff --git a/mkdocs_jupyter/tests/mkdocs/docs/ruby.ipynb b/src/mkdocs_jupyter/tests/mkdocs/docs/ruby.ipynb similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/ruby.ipynb rename to src/mkdocs_jupyter/tests/mkdocs/docs/ruby.ipynb diff --git a/mkdocs_jupyter/tests/mkdocs/docs/variational-inference-script.py b/src/mkdocs_jupyter/tests/mkdocs/docs/variational-inference-script.py similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/variational-inference-script.py rename to src/mkdocs_jupyter/tests/mkdocs/docs/variational-inference-script.py diff --git a/mkdocs_jupyter/tests/mkdocs/docs/variational-inference.ipynb b/src/mkdocs_jupyter/tests/mkdocs/docs/variational-inference.ipynb similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/docs/variational-inference.ipynb rename to src/mkdocs_jupyter/tests/mkdocs/docs/variational-inference.ipynb diff --git a/mkdocs_jupyter/tests/mkdocs/material-execute-ignore.yml b/src/mkdocs_jupyter/tests/mkdocs/material-execute-ignore.yml similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/material-execute-ignore.yml rename to src/mkdocs_jupyter/tests/mkdocs/material-execute-ignore.yml diff --git a/mkdocs_jupyter/tests/mkdocs/material-with-nbs-pys.yml b/src/mkdocs_jupyter/tests/mkdocs/material-with-nbs-pys.yml similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/material-with-nbs-pys.yml rename to src/mkdocs_jupyter/tests/mkdocs/material-with-nbs-pys.yml diff --git a/mkdocs_jupyter/tests/mkdocs/material-with-nbs.yml b/src/mkdocs_jupyter/tests/mkdocs/material-with-nbs.yml similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/material-with-nbs.yml rename to src/mkdocs_jupyter/tests/mkdocs/material-with-nbs.yml diff --git a/mkdocs_jupyter/tests/mkdocs/material-with-pys.yml b/src/mkdocs_jupyter/tests/mkdocs/material-with-pys.yml similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/material-with-pys.yml rename to src/mkdocs_jupyter/tests/mkdocs/material-with-pys.yml diff --git a/mkdocs_jupyter/tests/mkdocs/overrides/main.html b/src/mkdocs_jupyter/tests/mkdocs/overrides/main.html similarity index 100% rename from mkdocs_jupyter/tests/mkdocs/overrides/main.html rename to src/mkdocs_jupyter/tests/mkdocs/overrides/main.html diff --git a/mkdocs_jupyter/tests/test_base_usage.py b/src/mkdocs_jupyter/tests/test_base_usage.py similarity index 100% rename from mkdocs_jupyter/tests/test_base_usage.py rename to src/mkdocs_jupyter/tests/test_base_usage.py diff --git a/mkdocs_jupyter/tests/test_pkg.py b/src/mkdocs_jupyter/tests/test_pkg.py similarity index 73% rename from mkdocs_jupyter/tests/test_pkg.py rename to src/mkdocs_jupyter/tests/test_pkg.py index 8cedf94..dfb1cfb 100644 --- a/mkdocs_jupyter/tests/test_pkg.py +++ b/src/mkdocs_jupyter/tests/test_pkg.py @@ -21,10 +21,9 @@ def test_assets_included(): html_assets = os.path.join(mkdocs_html, "assets") assert os.path.exists(os.path.join(html_assets, "clipboard.umd.js")) - assert os.path.exists(os.path.join(html_assets, "mkdocs-jupyter.css")) - assert os.path.exists(os.path.join(html_assets, "mkdocs-jupyter.css.map")) - assert os.path.exists(os.path.join(html_assets, "mkdocs-jupyter.js")) - # assert os.path.exists(os.path.join(html_assets, "mkdocs-jupyter.js.map")) + assert os.path.exists(os.path.join(html_assets, "index.css")) + assert os.path.exists(os.path.join(html_assets, "theme-dark.css")) + assert os.path.exists(os.path.join(html_assets, "theme-light.css")) mkdocs_md = os.path.join(settings.templates_dir, "mkdocs_md") assert os.path.exists(os.path.join(mkdocs_md, "conf.json")) diff --git a/mkdocs_jupyter/utils.py b/src/mkdocs_jupyter/utils.py similarity index 100% rename from mkdocs_jupyter/utils.py rename to src/mkdocs_jupyter/utils.py