Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-typer for openSUSE:Factory checked in at 2022-06-25 10:24:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-typer (Old) and /work/SRC/openSUSE:Factory/.python-typer.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-typer" Sat Jun 25 10:24:40 2022 rev:4 rq:984951 version:0.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-typer/python-typer.changes 2021-08-31 19:56:22.558013353 +0200 +++ /work/SRC/openSUSE:Factory/.python-typer.new.1548/python-typer.changes 2022-06-25 10:25:01.694739374 +0200 @@ -1,0 +2,17 @@ +Fri Jun 24 18:20:30 UTC 2022 - Matthias Bach <[email protected]> - 0.4.1 + +- Add run-subprocesses-with-correct-python.patch to ensure tests + aren't accidentally running subprocesses using the wrong Python + version. +- Add set-proper-pythonpath-for-tutorial-script-tests.patch to fix + issue with build failing due to import failures. + +------------------------------------------------------------------- +Tue Jun 14 14:37:26 UTC 2022 - Matthias Bach <[email protected]> - 0.4.1 + +- Update to upstream version 0.4.1 + * Fix import of get_terminal_size for Click 8.1.0 support. +- Switch from traditional setup.py installation to pyproject macros + as upstream no longer ships its setup.py compability wrapper. + +------------------------------------------------------------------- Old: ---- python-typer-rpmlintrc typer-0.4.0.tar.gz New: ---- run-subprocesses-with-correct-python.patch set-proper-pythonpath-for-tutorial-script-tests.patch typer-0.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-typer.spec ++++++ --- /var/tmp/diff_new_pack.caw9ur/_old 2022-06-25 10:25:02.202740099 +0200 +++ /var/tmp/diff_new_pack.caw9ur/_new 2022-06-25 10:25:02.206740105 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-typer # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # Copyright (c) 2021 Matthias Bach <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -19,17 +19,19 @@ %define skip_python2 1 Name: python-typer -Version: 0.4.0 +Version: 0.4.1 Release: 0 Summary: Typer, build great CLIs. Easy to code. Based on Python type hints License: MIT Group: Development/Languages/Python URL: https://github.com/tiangolo/typer Source: https://files.pythonhosted.org/packages/source/t/typer/typer-%{version}.tar.gz -Source1: %{name}-rpmlintrc +Patch0: run-subprocesses-with-correct-python.patch +Patch1: set-proper-pythonpath-for-tutorial-script-tests.patch BuildRequires: %{python_module click} BuildRequires: %{python_module coverage} BuildRequires: %{python_module flit-core} +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module shellingham} BuildRequires: fdupes @@ -50,12 +52,13 @@ %prep %setup -q -n typer-%{version} +%autopatch -p1 %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check ++++++ run-subprocesses-with-correct-python.patch ++++++ ++++ 2787 lines (skipped) ++++++ set-proper-pythonpath-for-tutorial-script-tests.patch ++++++ From: Matthias Bach <[email protected]> Date: Fri, 24 Jun 2022 19:54:06 +0200 Subject: [PATCH] Ensure the PYTHONPATH is set properly when testing the tutorial scripts References: https://github.com/tiangolo/typer/pull/407 Upstream: sent When packaging Typer for openSUSE I ran into errors because the tutorial scripts were unable to import their colocated modules. Curiously this only seems to be occurring when these scripts are run via coverage, as they are in the tests. Them being run via coverage however also prevents just changing the working directory for the script runs, as then the coverage file would end up in the wrong directory. Curiously, I have not been able to reproduce this issue on openSUSE Leap but only seen it on openSUSE Tumbleweed. Thus, there might be something weird with the Python stack or the coverage version on Tumbleweed. However, as the same PYTHONPATH-patching is also done for the tests of the tutorial code that run it directly and not as a subprocess, I think it is just consistent to also do this for the script test. For reference, this is the error that I am observing in the packaging environment and that gets resolved by this commit: [ 123s] =================================== FAILURES =================================== [ 123s] _________________________________ test_scripts _________________________________ [ 123s] [ 123s] mod = <module 'docs_src.subcommands.tutorial001.main' from '/home/abuild/rpmbuild/BUILD/typer-0.4.1/docs_src/subcommands/tutorial001/main.py'> [ 123s] [ 123s] def test_scripts(mod): [ 123s] from docs_src.subcommands.tutorial001 import items, users [ 123s] [ 123s] for module in [mod, items, users]: [ 123s] result = subprocess.run( [ 123s] ["coverage", "run", module.__file__, "--help"], [ 123s] stdout=subprocess.PIPE, [ 123s] stderr=subprocess.PIPE, [ 123s] encoding="utf-8", [ 123s] ) [ 123s] > assert "Usage" in result.stdout [ 123s] E assert 'Usage' in '' [ 123s] E + where '' = CompletedProcess(args=['coverage', 'run', '/home/abuild/rpmbuild/BUILD/typer-0.4.1/docs_src/subcommands/tutorial001/main.py', '--help'], returncode=1, stdout='', stderr='Traceback (most recent call last):\n File "/home/abuild/rpmbuild/BUILD/typer-0.4.1/docs_src/subcommands/tutorial001/main.py", line 3, in <module>\n import items\nModuleNotFoundError: No module named \'items\'\n').stdout [ 123s] [ 123s] tests/test_tutorial/test_subcommands/test_tutorial001.py:94: AssertionError [ 123s] _________________________________ test_scripts _________________________________ [ 123s] [ 123s] mod = <module 'docs_src.subcommands.tutorial003.main' from '/home/abuild/rpmbuild/BUILD/typer-0.4.1/docs_src/subcommands/tutorial003/main.py'> [ 123s] [ 123s] def test_scripts(mod): [ 123s] from docs_src.subcommands.tutorial003 import items, lands, reigns, towns, users [ 123s] [ 123s] for module in [mod, items, lands, reigns, towns, users]: [ 123s] result = subprocess.run( [ 123s] ["coverage", "run", module.__file__, "--help"], [ 123s] stdout=subprocess.PIPE, [ 123s] stderr=subprocess.PIPE, [ 123s] encoding="utf-8", [ 123s] ) [ 123s] > assert "Usage" in result.stdout [ 123s] E assert 'Usage' in '' [ 123s] E + where '' = CompletedProcess(args=['coverage', 'run', '/home/abuild/rpmbuild/BUILD/typer-0.4.1/docs_src/subcommands/tutorial003/main.py', '--help'], returncode=1, stdout='', stderr='Traceback (most recent call last):\n File "/home/abuild/rpmbuild/BUILD/typer-0.4.1/docs_src/subcommands/tutorial003/main.py", line 3, in <module>\n import items\nModuleNotFoundError: No module named \'items\'\n').stdout [ 123s] [ 123s] tests/test_tutorial/test_subcommands/test_tutorial003.py:146: AssertionError --- tests/test_tutorial/test_subcommands/test_tutorial001.py | 5 +++++ tests/test_tutorial/test_subcommands/test_tutorial003.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tests/test_tutorial/test_subcommands/test_tutorial001.py b/tests/test_tutorial/test_subcommands/test_tutorial001.py index 1b8b60e..392cf24 100644 --- a/tests/test_tutorial/test_subcommands/test_tutorial001.py +++ b/tests/test_tutorial/test_subcommands/test_tutorial001.py @@ -1,3 +1,4 @@ +import os import subprocess import sys @@ -85,11 +86,15 @@ def test_users_delete(app): def test_scripts(mod): from docs_src.subcommands.tutorial001 import items, users + env = os.environ.copy() + env["PYTHONPATH"] = ":".join(list(tutorial001.__path__)) + for module in [mod, items, users]: result = subprocess.run( [sys.executable, "-m", "coverage", "run", module.__file__, "--help"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8", + env=env, ) assert "Usage" in result.stdout diff --git a/tests/test_tutorial/test_subcommands/test_tutorial003.py b/tests/test_tutorial/test_subcommands/test_tutorial003.py index 57f1174..7de9107 100644 --- a/tests/test_tutorial/test_subcommands/test_tutorial003.py +++ b/tests/test_tutorial/test_subcommands/test_tutorial003.py @@ -1,3 +1,4 @@ +import os import subprocess import sys @@ -137,11 +138,15 @@ def test_lands_towns_burn(app): def test_scripts(mod): from docs_src.subcommands.tutorial003 import items, lands, reigns, towns, users + env = os.environ.copy() + env["PYTHONPATH"] = ":".join(list(tutorial003.__path__)) + for module in [mod, items, lands, reigns, towns, users]: result = subprocess.run( [sys.executable, "-m", "coverage", "run", module.__file__, "--help"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8", + env=env, ) assert "Usage" in result.stdout -- 2.35.3 ++++++ typer-0.4.0.tar.gz -> typer-0.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/.github/actions/comment-docs-preview-in-pr/Dockerfile new/typer-0.4.1/.github/actions/comment-docs-preview-in-pr/Dockerfile --- old/typer-0.4.0/.github/actions/comment-docs-preview-in-pr/Dockerfile 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/.github/actions/comment-docs-preview-in-pr/Dockerfile 2022-03-30 21:18:31.091544200 +0200 @@ -0,0 +1,7 @@ +FROM python:3.7 + +RUN pip install httpx "pydantic==1.5.1" pygithub + +COPY ./app /app + +CMD ["python", "/app/main.py"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/.github/actions/comment-docs-preview-in-pr/action.yml new/typer-0.4.1/.github/actions/comment-docs-preview-in-pr/action.yml --- old/typer-0.4.0/.github/actions/comment-docs-preview-in-pr/action.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/.github/actions/comment-docs-preview-in-pr/action.yml 2022-03-30 21:18:31.091544200 +0200 @@ -0,0 +1,13 @@ +name: Comment Docs Preview in PR +description: Comment with the docs URL preview in the PR +author: Sebasti??n Ram??rez <[email protected]> +inputs: + token: + description: Token for the repo. Can be passed in using {{ secrets.GITHUB_TOKEN }} + required: true + deploy_url: + description: The deployment URL to comment in the PR + required: true +runs: + using: docker + image: Dockerfile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/.github/actions/comment-docs-preview-in-pr/app/main.py new/typer-0.4.1/.github/actions/comment-docs-preview-in-pr/app/main.py --- old/typer-0.4.0/.github/actions/comment-docs-preview-in-pr/app/main.py 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/.github/actions/comment-docs-preview-in-pr/app/main.py 2022-03-30 21:18:31.091544200 +0200 @@ -0,0 +1,70 @@ +import logging +import sys +from pathlib import Path +from typing import Optional + +import httpx +from github import Github +from github.PullRequest import PullRequest +from pydantic import BaseModel, BaseSettings, SecretStr, ValidationError + +github_api = "https://api.github.com" + + +class Settings(BaseSettings): + github_repository: str + github_event_path: Path + github_event_name: Optional[str] = None + input_token: SecretStr + input_deploy_url: str + + +class PartialGithubEventHeadCommit(BaseModel): + id: str + + +class PartialGithubEventWorkflowRun(BaseModel): + head_commit: PartialGithubEventHeadCommit + + +class PartialGithubEvent(BaseModel): + workflow_run: PartialGithubEventWorkflowRun + + +if __name__ == "__main__": + logging.basicConfig(level=logging.INFO) + settings = Settings() + logging.info(f"Using config: {settings.json()}") + g = Github(settings.input_token.get_secret_value()) + repo = g.get_repo(settings.github_repository) + try: + event = PartialGithubEvent.parse_file(settings.github_event_path) + except ValidationError as e: + logging.error(f"Error parsing event file: {e.errors()}") + sys.exit(0) + use_pr: Optional[PullRequest] = None + for pr in repo.get_pulls(): + if pr.head.sha == event.workflow_run.head_commit.id: + use_pr = pr + break + if not use_pr: + logging.error( + f"No PR found for hash: {event.workflow_run.head_commit.id}" + ) + sys.exit(0) + github_headers = { + "Authorization": f"token {settings.input_token.get_secret_value()}" + } + url = f"{github_api}/repos/{settings.github_repository}/issues/{use_pr.number}/comments" + logging.info(f"Using comments URL: {url}") + response = httpx.post( + url, + headers=github_headers, + json={ + "body": f"???? Docs preview for commit {use_pr.head.sha} at: {settings.input_deploy_url}" + }, + ) + if not (200 <= response.status_code <= 300): + logging.error(f"Error posting comment: {response.text}") + sys.exit(1) + logging.info("Finished") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/.github/workflows/build-docs.yml new/typer-0.4.1/.github/workflows/build-docs.yml --- old/typer-0.4.0/.github/workflows/build-docs.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/.github/workflows/build-docs.yml 2022-03-30 21:18:31.091544200 +0200 @@ -0,0 +1,72 @@ +name: Build Docs +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize] + workflow_dispatch: + inputs: + debug_enabled: + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false +jobs: + build-docs: + runs-on: ubuntu-20.04 + steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + # Allow debugging with tmate + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} + with: + limit-access-to-actor: true + - uses: actions/cache@v2 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-docs + - name: Install Flit + if: steps.cache.outputs.cache-hit != 'true' + run: python3.7 -m pip install flit + - name: Install docs extras + if: steps.cache.outputs.cache-hit != 'true' + run: python3.7 -m flit install --extras doc + - name: Install Material for MkDocs Insiders + if: github.event.pull_request.head.repo.fork == false && steps.cache.outputs.cache-hit != 'true' + run: python3.7 -m pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git + - uses: actions/cache@v2 + with: + key: mkdocs-cards-${{ github.ref }} + path: .cache + - name: Build Docs + if: github.event.pull_request.head.repo.fork == true + run: python3.7 -m mkdocs build + - name: Build Docs with Insiders + if: github.event.pull_request.head.repo.fork == false + run: python3.7 -m mkdocs build --config-file mkdocs.insiders.yml + - name: Zip docs + run: bash ./scripts/zip-docs.sh + - uses: actions/upload-artifact@v2 + with: + name: docs-zip + path: ./docs.zip + - name: Deploy to Netlify + uses: nwtgck/[email protected] + with: + publish-dir: './site' + production-branch: master + github-token: ${{ secrets.GITHUB_TOKEN }} + enable-commit-comment: false + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/.github/workflows/deploy-docs.yml new/typer-0.4.1/.github/workflows/deploy-docs.yml --- old/typer-0.4.0/.github/workflows/deploy-docs.yml 2021-08-30 10:58:33.309700000 +0200 +++ new/typer-0.4.1/.github/workflows/deploy-docs.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,29 +0,0 @@ -name: Build and Deploy to Netlify -on: - push: - pull_request: - types: [opened, synchronize] -jobs: - build-docs: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.7" - - name: Install Flit - run: python3.7 -m pip install flit - - name: Install docs extras - run: python3.7 -m flit install --extras doc - - name: Build MkDocs - run: python3.7 -m mkdocs build - - name: Deploy to Netlify - uses: nwtgck/[email protected] - with: - publish-dir: './site' - production-branch: master - github-token: ${{ secrets.GITHUB_TOKEN }} - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/.github/workflows/preview-docs.yml new/typer-0.4.1/.github/workflows/preview-docs.yml --- old/typer-0.4.0/.github/workflows/preview-docs.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/.github/workflows/preview-docs.yml 2022-03-30 21:18:31.091544200 +0200 @@ -0,0 +1,41 @@ +name: Preview Docs +on: + workflow_run: + workflows: + - Build Docs + types: + - completed + +jobs: + preview-docs: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Download Artifact Docs + uses: dawidd6/[email protected] + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: build-docs.yml + run_id: ${{ github.event.workflow_run.id }} + name: docs-zip + - name: Unzip docs + run: | + rm -rf ./site + unzip docs.zip + rm -f docs.zip + - name: Deploy to Netlify + id: netlify + uses: nwtgck/[email protected] + with: + publish-dir: './site' + production-deploy: false + github-token: ${{ secrets.GITHUB_TOKEN }} + enable-commit-comment: false + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + - name: Comment Deploy + uses: ./.github/actions/comment-docs-preview-in-pr + with: + token: ${{ secrets.GITHUB_TOKEN }} + deploy_url: "${{ steps.netlify.outputs.deploy-url }}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/.github/workflows/publish.yml new/typer-0.4.1/.github/workflows/publish.yml --- old/typer-0.4.0/.github/workflows/publish.yml 2021-08-30 10:58:33.309700000 +0200 +++ new/typer-0.4.1/.github/workflows/publish.yml 2022-03-30 21:18:31.091544200 +0200 @@ -11,9 +11,9 @@ steps: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: - python-version: "3.6" + python-version: "3.7" - name: Install Flit run: pip install flit - name: Install Dependencies diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/.github/workflows/test.yml new/typer-0.4.1/.github/workflows/test.yml --- old/typer-0.4.0/.github/workflows/test.yml 2021-08-30 10:58:33.309700000 +0200 +++ new/typer-0.4.1/.github/workflows/test.yml 2022-03-30 21:18:31.091544200 +0200 @@ -2,6 +2,8 @@ on: push: + branches: + - master pull_request: types: [opened, synchronize] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/PKG-INFO new/typer-0.4.1/PKG-INFO --- old/typer-0.4.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: typer -Version: 0.4.0 +Version: 0.4.1 Summary: Typer, build great CLIs. Easy to code. Based on Python type hints. Home-page: https://github.com/tiangolo/typer Author: Sebasti??n Ram??rez @@ -30,8 +30,8 @@ Requires-Dist: autoflake >=1.3.1,<2.0.0 ; extra == "dev" Requires-Dist: flake8 >=3.8.3,<4.0.0 ; extra == "dev" Requires-Dist: mkdocs >=1.1.2,<2.0.0 ; extra == "doc" -Requires-Dist: mkdocs-material >=5.4.0,<6.0.0 ; extra == "doc" -Requires-Dist: markdown-include >=0.5.1,<0.6.0 ; extra == "doc" +Requires-Dist: mkdocs-material >=8.1.4,<9.0.0 ; extra == "doc" +Requires-Dist: mdx-include >=1.4.1,<2.0.0 ; extra == "doc" Requires-Dist: shellingham >=1.3.0,<2.0.0 ; extra == "test" Requires-Dist: pytest >=4.4.0,<5.4.0 ; extra == "test" Requires-Dist: pytest-cov >=2.10.0,<3.0.0 ; extra == "test" @@ -39,7 +39,7 @@ Requires-Dist: pytest-xdist >=1.32.0,<2.0.0 ; extra == "test" Requires-Dist: pytest-sugar >=0.9.4,<0.10.0 ; extra == "test" Requires-Dist: mypy ==0.910 ; extra == "test" -Requires-Dist: black >=19.10b0,<20.0b0 ; extra == "test" +Requires-Dist: black >=22.3.0,<23.0.0 ; extra == "test" Requires-Dist: isort >=5.0.6,<6.0.0 ; extra == "test" Project-URL: Documentation, https://typer.tiangolo.com/ Provides-Extra: all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/docs/overrides/main.html new/typer-0.4.1/docs/overrides/main.html --- old/typer-0.4.0/docs/overrides/main.html 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/docs/overrides/main.html 2022-03-30 21:18:31.091544200 +0200 @@ -0,0 +1,29 @@ +{% extends "base.html" %} +{%- block scripts %} +{{ super() }} +<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> +<script> + // This prevents the global search from interfering with qa-bot's internal text input. + document.addEventListener('DOMContentLoaded', () => { + document.querySelectorAll('qa-bot').forEach((x) => { + x.addEventListener('keydown', (event) => { + event.stopPropagation(); + }); + }); + }); +</script> +<qa-bot + server="https://tiangolo-typer.docsqa.jina.ai" + theme="infer" + title="Typer Bot" + description="Typer, build great CLIs. Easy to code. Based on Python type hints." + style="font-size: 0.8rem" +> + <dl> + <dt>You can ask questions about Typer. Try:</dt> + <dd>How can I terminate a program?</dd> + <dd>How to launch applications?</dd> + <dd>How to add help to CLI argument?</dd> + </dl> +</qa-bot> +{%- endblock %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/docs/release-notes.md new/typer-0.4.1/docs/release-notes.md --- old/typer-0.4.0/docs/release-notes.md 2021-08-30 10:58:33.313700400 +0200 +++ new/typer-0.4.1/docs/release-notes.md 2022-03-30 21:18:31.091544200 +0200 @@ -1,5 +1,18 @@ ## Latest Changes +## 0.4.1 + +### Fixes + +* ???? Fix import of `get_terminal_size` for Click 8.1.0 support and upgrade Black to fix CI. PR [#380](https://github.com/tiangolo/typer/pull/380) by [@tiangolo](https://github.com/tiangolo) based on original PR [#375](https://github.com/tiangolo/typer/pull/375) by [@madkinsz](https://github.com/madkinsz). + +### Internal + +* ???? Add Jina's QA Bot to the docs to help people that want to ask quick questions. PR [#368](https://github.com/tiangolo/typer/pull/368) by [@tiangolo](https://github.com/tiangolo). +* ???? Only test on push when on master, avoid duplicate CI runs from PRs. PR [#358](https://github.com/tiangolo/typer/pull/358) by [@tiangolo](https://github.com/tiangolo). +* ??? Add support for previewing docs in PRs from forks and enable MkDocs Insiders. PR [#357](https://github.com/tiangolo/typer/pull/357) by [@tiangolo](https://github.com/tiangolo). +* ?????? Upgrade MkDocs Material, MDX-Include, and MkDocs structure. PR [#356](https://github.com/tiangolo/typer/pull/356) by [@tiangolo](https://github.com/tiangolo). +* ???? Update publish GitHub action. PR [#325](https://github.com/tiangolo/typer/pull/325) by [@tiangolo](https://github.com/tiangolo). ## 0.4.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/docs_src/commands/callback/tutorial004.py new/typer-0.4.1/docs_src/commands/callback/tutorial004.py --- old/typer-0.4.0/docs_src/commands/callback/tutorial004.py 2021-08-30 10:58:33.317700600 +0200 +++ new/typer-0.4.1/docs_src/commands/callback/tutorial004.py 2022-03-30 21:18:31.095544000 +0200 @@ -9,7 +9,7 @@ Manage users CLI app. Use it with the create command. - + A new user with the given NAME will be created. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/mkdocs.insiders.yml new/typer-0.4.1/mkdocs.insiders.yml --- old/typer-0.4.0/mkdocs.insiders.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/mkdocs.insiders.yml 2022-03-30 21:18:31.099544000 +0200 @@ -0,0 +1,4 @@ +INHERIT: mkdocs.yml +plugins: + - search + - social diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/mkdocs.yml new/typer-0.4.1/mkdocs.yml --- old/typer-0.4.0/mkdocs.yml 2021-08-30 10:58:33.321701000 +0200 +++ new/typer-0.4.1/mkdocs.yml 2022-03-30 21:18:31.099544000 +0200 @@ -3,127 +3,129 @@ site_url: https://typer.tiangolo.com/ theme: - name: 'material' - palette: - primary: 'black' - accent: 'teal' - icon: - repo: fontawesome/brands/github-alt - logo: 'img/icon-white.svg' - favicon: 'img/favicon.png' + name: material + custom_dir: docs/overrides + palette: + primary: black + accent: teal + icon: + repo: fontawesome/brands/github-alt + logo: img/icon-white.svg + favicon: img/favicon.png repo_name: tiangolo/typer repo_url: https://github.com/tiangolo/typer -edit_uri: '' -google_analytics: - - 'UA-155009830-1' - - 'auto' +edit_uri: "" nav: - - Typer: 'index.md' - - Features: 'features.md' - - Tutorial - User Guide: - - Tutorial - User Guide - Intro: 'tutorial/index.md' - - First Steps: 'tutorial/first-steps.md' - - Printing and Colors: 'tutorial/printing.md' - - Terminating: 'tutorial/terminating.md' - - CLI Arguments: - - CLI Arguments Intro: 'tutorial/arguments/index.md' - - Optional CLI Arguments: 'tutorial/arguments/optional.md' - - CLI Arguments with Default: 'tutorial/arguments/default.md' - - CLI Arguments with Help: 'tutorial/arguments/help.md' - - CLI Arguments with Environment Variables: 'tutorial/arguments/envvar.md' - - Other uses: 'tutorial/arguments/other-uses.md' - - CLI Options: - - CLI Options Intro: 'tutorial/options/index.md' - - CLI Options with Help: 'tutorial/options/help.md' - - Required CLI Options: 'tutorial/options/required.md' - - CLI Option Prompt: 'tutorial/options/prompt.md' - - Password CLI Option and Confirmation Prompt: 'tutorial/options/password.md' - - CLI Option Name: 'tutorial/options/name.md' - - CLI Option Callback and Context: 'tutorial/options/callback-and-context.md' - - Version CLI Option, is_eager: 'tutorial/options/version.md' - - CLI Option autocompletion: 'tutorial/options/autocompletion.md' - - Commands: - - Commands Intro: 'tutorial/commands/index.md' - - Command CLI Arguments: 'tutorial/commands/arguments.md' - - Command CLI Options: 'tutorial/commands/options.md' - - Command Help: 'tutorial/commands/help.md' - - Custom Command Name: 'tutorial/commands/name.md' - - Typer Callback: 'tutorial/commands/callback.md' - - One or Multiple Commands: 'tutorial/commands/one-or-multiple.md' - - Using the Context: 'tutorial/commands/context.md' - - CLI Parameter Types: - - CLI Parameter Types Intro: 'tutorial/parameter-types/index.md' - - Number: 'tutorial/parameter-types/number.md' - - Boolean CLI Options: 'tutorial/parameter-types/bool.md' - - UUID: 'tutorial/parameter-types/uuid.md' - - DateTime: 'tutorial/parameter-types/datetime.md' - - Enum - Choices: 'tutorial/parameter-types/enum.md' - - Path: 'tutorial/parameter-types/path.md' - - File: 'tutorial/parameter-types/file.md' - - SubCommands - Command Groups: - - SubCommands - Command Groups - Intro: 'tutorial/subcommands/index.md' - - Add Typer: 'tutorial/subcommands/add-typer.md' - - SubCommands in a Single File: 'tutorial/subcommands/single-file.md' - - Nested SubCommands: 'tutorial/subcommands/nested-subcommands.md' - - Sub-Typer Callback Override: 'tutorial/subcommands/callback-override.md' - - SubCommand Name and Help: 'tutorial/subcommands/name-and-help.md' - - Multiple Values: - - Multiple Values Intro: 'tutorial/multiple-values/index.md' - - Multiple CLI Options: 'tutorial/multiple-values/multiple-options.md' - - CLI Options with Multiple Values: 'tutorial/multiple-values/options-with-multiple-values.md' - - CLI Arguments with Multiple Values: 'tutorial/multiple-values/arguments-with-multiple-values.md' - - Ask with Prompt: 'tutorial/prompt.md' - - Progress Bar: 'tutorial/progressbar.md' - - CLI Application Directory: 'tutorial/app-dir.md' - - Launching Applications: 'tutorial/launch.md' - - Testing: 'tutorial/testing.md' - - Using Click: 'tutorial/using-click.md' - - Building a Package: 'tutorial/package.md' - - Typer CLI - completion for small scripts: 'typer-cli.md' - - Alternatives, Inspiration and Comparisons: 'alternatives.md' - - Help Typer - Get Help: 'help-typer.md' - - Development - Contributing: 'contributing.md' - - Release Notes: release-notes.md + - Typer: index.md + - Features: features.md + - Tutorial - User Guide: + - Tutorial - User Guide - Intro: tutorial/index.md + - First Steps: tutorial/first-steps.md + - Printing and Colors: tutorial/printing.md + - Terminating: tutorial/terminating.md + - CLI Arguments: + - CLI Arguments Intro: tutorial/arguments/index.md + - Optional CLI Arguments: tutorial/arguments/optional.md + - CLI Arguments with Default: tutorial/arguments/default.md + - CLI Arguments with Help: tutorial/arguments/help.md + - CLI Arguments with Environment Variables: tutorial/arguments/envvar.md + - Other uses: tutorial/arguments/other-uses.md + - CLI Options: + - CLI Options Intro: tutorial/options/index.md + - CLI Options with Help: tutorial/options/help.md + - Required CLI Options: tutorial/options/required.md + - CLI Option Prompt: tutorial/options/prompt.md + - Password CLI Option and Confirmation Prompt: tutorial/options/password.md + - CLI Option Name: tutorial/options/name.md + - CLI Option Callback and Context: tutorial/options/callback-and-context.md + - Version CLI Option, is_eager: tutorial/options/version.md + - CLI Option autocompletion: tutorial/options/autocompletion.md + - Commands: + - Commands Intro: tutorial/commands/index.md + - Command CLI Arguments: tutorial/commands/arguments.md + - Command CLI Options: tutorial/commands/options.md + - Command Help: tutorial/commands/help.md + - Custom Command Name: tutorial/commands/name.md + - Typer Callback: tutorial/commands/callback.md + - One or Multiple Commands: tutorial/commands/one-or-multiple.md + - Using the Context: tutorial/commands/context.md + - CLI Parameter Types: + - CLI Parameter Types Intro: tutorial/parameter-types/index.md + - Number: tutorial/parameter-types/number.md + - Boolean CLI Options: tutorial/parameter-types/bool.md + - UUID: tutorial/parameter-types/uuid.md + - DateTime: tutorial/parameter-types/datetime.md + - Enum - Choices: tutorial/parameter-types/enum.md + - Path: tutorial/parameter-types/path.md + - File: tutorial/parameter-types/file.md + - SubCommands - Command Groups: + - SubCommands - Command Groups - Intro: tutorial/subcommands/index.md + - Add Typer: tutorial/subcommands/add-typer.md + - SubCommands in a Single File: tutorial/subcommands/single-file.md + - Nested SubCommands: tutorial/subcommands/nested-subcommands.md + - Sub-Typer Callback Override: tutorial/subcommands/callback-override.md + - SubCommand Name and Help: tutorial/subcommands/name-and-help.md + - Multiple Values: + - Multiple Values Intro: tutorial/multiple-values/index.md + - Multiple CLI Options: tutorial/multiple-values/multiple-options.md + - CLI Options with Multiple Values: tutorial/multiple-values/options-with-multiple-values.md + - CLI Arguments with Multiple Values: tutorial/multiple-values/arguments-with-multiple-values.md + - Ask with Prompt: tutorial/prompt.md + - Progress Bar: tutorial/progressbar.md + - CLI Application Directory: tutorial/app-dir.md + - Launching Applications: tutorial/launch.md + - Testing: tutorial/testing.md + - Using Click: tutorial/using-click.md + - Building a Package: tutorial/package.md + - Typer CLI - completion for small scripts: typer-cli.md + - Alternatives, Inspiration and Comparisons: alternatives.md + - Help Typer - Get Help: help-typer.md + - Development - Contributing: contributing.md + - Release Notes: release-notes.md markdown_extensions: - - toc: - permalink: true - - markdown.extensions.codehilite: - guess_lang: false - - markdown_include.include: - base_path: docs - - admonition - - codehilite - - extra - - pymdownx.superfences: - custom_fences: - - name: mermaid - class: mermaid - format: !!python/name:pymdownx.superfences.fence_div_format - - pymdownx.tabbed + - toc: + permalink: true + - markdown.extensions.codehilite: + guess_lang: false + - admonition + - codehilite + - extra + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format '' + - pymdownx.tabbed: + alternate_style: true + - mdx_include: + base_path: docs extra: - social: - - icon: fontawesome/brands/github-alt - link: 'https://github.com/tiangolo/typer' - - icon: fontawesome/brands/twitter - link: 'https://twitter.com/tiangolo' - - icon: fontawesome/brands/linkedin - link: 'https://www.linkedin.com/in/tiangolo' - - icon: fontawesome/brands/dev - link: 'https://dev.to/tiangolo' - - icon: fontawesome/brands/medium - link: 'https://medium.com/@tiangolo' - - icon: fontawesome/solid/globe - link: 'https://tiangolo.com' + analytics: + provider: google + property: UA-133183413-1 + social: + - icon: fontawesome/brands/github-alt + link: https://github.com/tiangolo/typer + - icon: fontawesome/brands/twitter + link: https://twitter.com/tiangolo + - icon: fontawesome/brands/linkedin + link: https://www.linkedin.com/in/tiangolo + - icon: fontawesome/brands/dev + link: https://dev.to/tiangolo + - icon: fontawesome/brands/medium + link: https://medium.com/@tiangolo + - icon: fontawesome/solid/globe + link: https://tiangolo.com extra_css: - - 'css/termynal.css' - - 'css/custom.css' + - css/termynal.css + - css/custom.css extra_javascript: - - 'https://unpkg.com/[email protected]/dist/mermaid.min.js' - - 'js/termynal.js' - - 'js/custom.js' + - https://unpkg.com/[email protected]/dist/mermaid.min.js + - js/termynal.js + - js/custom.js diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/pyproject.toml new/typer-0.4.1/pyproject.toml --- old/typer-0.4.0/pyproject.toml 2021-08-30 10:58:33.321701000 +0200 +++ new/typer-0.4.1/pyproject.toml 2022-03-30 21:18:31.099544000 +0200 @@ -44,13 +44,13 @@ "pytest-xdist >=1.32.0,<2.0.0", "pytest-sugar >=0.9.4,<0.10.0", "mypy ==0.910", - "black >=19.10b0,<20.0b0", + "black >=22.3.0,<23.0.0", "isort >=5.0.6,<6.0.0" ] doc = [ "mkdocs >=1.1.2,<2.0.0", - "mkdocs-material >=5.4.0,<6.0.0", - "markdown-include >=0.5.1,<0.6.0" + "mkdocs-material >=8.1.4,<9.0.0", + "mdx-include >=1.4.1,<2.0.0", ] dev = [ "autoflake >=1.3.1,<2.0.0", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/scripts/zip-docs.sh new/typer-0.4.1/scripts/zip-docs.sh --- old/typer-0.4.0/scripts/zip-docs.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/scripts/zip-docs.sh 2022-03-30 21:18:31.099544000 +0200 @@ -0,0 +1,9 @@ +#! /usr/bin/env bash + +set -x +set -e + +if [ -f docs.zip ]; then + rm -rf docs.zip +fi +zip -r docs.zip ./site diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/setup.py new/typer-0.4.1/setup.py --- old/typer-0.4.0/setup.py 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.4.1/setup.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,42 +0,0 @@ -#!/usr/bin/env python -# setup.py generated by flit for tools that don't yet use PEP 517 - -from distutils.core import setup - -packages = \ -['typer'] - -package_data = \ -{'': ['*']} - -install_requires = \ -['click >= 7.1.1, <9.0.0'] - -extras_require = \ -{'all': ['colorama >=0.4.3,<0.5.0', 'shellingham >=1.3.0,<2.0.0'], - 'dev': ['autoflake >=1.3.1,<2.0.0', 'flake8 >=3.8.3,<4.0.0'], - 'doc': ['mkdocs >=1.1.2,<2.0.0', - 'mkdocs-material >=5.4.0,<6.0.0', - 'markdown-include >=0.5.1,<0.6.0'], - 'test': ['shellingham >=1.3.0,<2.0.0', - 'pytest >=4.4.0,<5.4.0', - 'pytest-cov >=2.10.0,<3.0.0', - 'coverage >=5.2,<6.0', - 'pytest-xdist >=1.32.0,<2.0.0', - 'pytest-sugar >=0.9.4,<0.10.0', - 'mypy ==0.910', - 'black >=19.10b0,<20.0b0', - 'isort >=5.0.6,<6.0.0']} - -setup(name='typer', - version='0.4.0', - description='Typer, build great CLIs. Easy to code. Based on Python type hints.', - author='Sebasti??n Ram??rez', - author_email='[email protected]', - url='https://github.com/tiangolo/typer', - packages=packages, - package_data=package_data, - install_requires=install_requires, - extras_require=extras_require, - python_requires='>=3.6', - ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/tests/test_completion/test_completion_install.py new/typer-0.4.1/tests/test_completion/test_completion_install.py --- old/typer-0.4.0/tests/test_completion/test_completion_install.py 2021-08-30 10:58:33.321701000 +0200 +++ new/typer-0.4.1/tests/test_completion/test_completion_install.py 2022-03-30 21:18:31.099544000 +0200 @@ -99,7 +99,9 @@ def test_completion_install_fish(): script_path = Path(mod.__file__) - completion_path: Path = Path.home() / f".config/fish/completions/{script_path.name}.fish" + completion_path: Path = ( + Path.home() / f".config/fish/completions/{script_path.name}.fish" + ) result = subprocess.run( ["coverage", "run", mod.__file__, "--install-completion", "fish"], stdout=subprocess.PIPE, @@ -124,7 +126,9 @@ def test_completion_install_powershell(): - completion_path: Path = Path.home() / f".config/powershell/Microsoft.PowerShell_profile.ps1" + completion_path: Path = ( + Path.home() / f".config/powershell/Microsoft.PowerShell_profile.ps1" + ) completion_path_bytes = f"{completion_path}\n".encode("windows-1252") text = "" if completion_path.is_file(): # pragma: nocover diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.4.0/typer/__init__.py new/typer-0.4.1/typer/__init__.py --- old/typer-0.4.0/typer/__init__.py 2021-08-30 10:58:33.325701500 +0200 +++ new/typer-0.4.1/typer/__init__.py 2022-03-30 21:18:31.103544000 +0200 @@ -1,6 +1,8 @@ """Typer, build great CLIs. Easy to code. Based on Python type hints.""" -__version__ = "0.4.0" +__version__ = "0.4.1" + +from shutil import get_terminal_size as get_terminal_size from click.exceptions import Abort as Abort from click.exceptions import BadParameter as BadParameter @@ -9,7 +11,6 @@ from click.termui import confirm as confirm from click.termui import echo_via_pager as echo_via_pager from click.termui import edit as edit -from click.termui import get_terminal_size as get_terminal_size from click.termui import getchar as getchar from click.termui import launch as launch from click.termui import pause as pause
