14
0
forked from pool/python-typer

Accepting request 1085562 from home:theMarix:branches:devel:languages:python

- Update to upstream version 0.9.0
  * Add support for PEP-593 Annotated for specifying options and
    arguments.
  * Add support for custom types and parsers.
- Drop patch run-subprocesses-with-correct-python.patch that got
  included upstream.

OBS-URL: https://build.opensuse.org/request/show/1085562
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-typer?expand=0&rev=15
This commit is contained in:
Matthias Bach
2023-05-08 19:13:01 +00:00
committed by Git OBS Bridge
parent 1446f53fd9
commit df1ca89a25
6 changed files with 30 additions and 3165 deletions

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sun May 7 14:47:17 UTC 2023 - Matthias Bach <marix@marix.org> - 0.9.0
- Update to upstream version 0.9.0
* Add support for PEP-593 Annotated for specifying options and
arguments.
* Add support for custom types and parsers.
- Drop patch run-subprocesses-with-correct-python.patch that got
included upstream.
-------------------------------------------------------------------
Thu Jan 5 15:07:01 UTC 2023 - Matthias Bach <marix@marix.org> - 0.7.0

View File

@@ -19,14 +19,13 @@
%define skip_python2 1
Name: python-typer
Version: 0.7.0
Version: 0.9.0
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
Patch0: run-subprocesses-with-correct-python.patch
Patch1: set-proper-pythonpath-for-tutorial-script-tests.patch
BuildRequires: %{python_module click}
BuildRequires: %{python_module coverage}
@@ -71,6 +70,7 @@ This package provides the Typer Python package required to build and run Typer-b
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/*
%{python_sitelib}/typer
%{python_sitelib}/typer-%{version}*-info
%changelog

File diff suppressed because it is too large Load Diff

View File

@@ -60,61 +60,38 @@ environment and that gets resolved by this commit:
[ 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(+)
tests/test_tutorial/test_subcommands/test_tutorial001.py | 2 +-
tests/test_tutorial/test_subcommands/test_tutorial003.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test_tutorial/test_subcommands/test_tutorial001.py b/tests/test_tutorial/test_subcommands/test_tutorial001.py
index c4fca5b..1280e22 100644
index 1280e22..6f86826 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):
@@ -87,7 +87,7 @@ def test_scripts(mod):
from docs_src.subcommands.tutorial001 import items, users
+ env = os.environ.copy()
env = os.environ.copy()
- env["PYTHONPATH"] = ":".join(list(tutorial001.__path__))
+ env["PYTHONPATH"] = ":".join(list(tutorial001.__path__) + [env["PYTHONPATH"]] if "PYTHONPATH" in env else [])
+
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 4db168b..eaf4539 100644
index 2d6149c..0a05ae0 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):
@@ -160,7 +160,7 @@ def test_scripts(mod):
from docs_src.subcommands.tutorial003 import items, lands, reigns, towns, users
+ env = os.environ.copy()
env = os.environ.copy()
- env["PYTHONPATH"] = ":".join(list(tutorial003.__path__))
+ env["PYTHONPATH"] = ":".join(list(tutorial003.__path__) + [env["PYTHONPATH"]] if "PYTHONPATH" in env else [])
+
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

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ff797846578a9f2a201b53442aedeb543319466870fbe1c701eab66dd7681165
size 251871

3
typer-0.9.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2
size 273985