typer-cli 0.12.dev1__tar.gz → 0.12.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: typer-cli
3
- Version: 0.12.dev1
3
+ Version: 0.12.1
4
4
  Summary: Typer, build great CLIs. Easy to code. Based on Python type hints.
5
5
  Home-page: https://github.com/tiangolo/typer
6
6
  Author-Email: Sebastián Ramírez <tiangolo@gmail.com>
@@ -26,7 +26,7 @@ Classifier: License :: OSI Approved :: MIT License
26
26
  Project-URL: Documentation, https://typer.tiangolo.com/
27
27
  Project-URL: Homepage, https://github.com/tiangolo/typer
28
28
  Requires-Python: >=3.7
29
- Requires-Dist: typer-slim[standard]==0.12.dev1
29
+ Requires-Dist: typer==0.12.1
30
30
  Description-Content-Type: text/markdown
31
31
 
32
32
  <p align="center">
@@ -61,9 +61,13 @@ Typer is a library for building <abbr title="command line interface, programs ex
61
61
 
62
62
  ## Typer CLI
63
63
 
64
- This package, `typer-cli`, only provides a command `typer` in the shell with the same functionality of `python -m typer`.
64
+ ⚠️ Do not install this package. ⚠️
65
65
 
66
- The only reason why this is a separate package is to allow developers to opt out of the `typer` command by installing `typer-slim`, that doesn't include `typer-cli`.
66
+ This package, `typer-cli`, does nothing other than depend on `typer`.
67
+
68
+ All the functionality has been integrated into `typer`.
69
+
70
+ The only reason this package exists is as a migration path for old projects that used to depend on `typer-cli`, so that they can get the latest version of `typer`.
67
71
 
68
72
  You probably **should not** install this package.
69
73
 
@@ -73,7 +77,7 @@ Install instead:
73
77
  pip install typer
74
78
  ```
75
79
 
76
- That includes this package, `typer-cli`, with the `typer` command.
80
+ That includes the `typer` command.
77
81
 
78
82
  ## License
79
83
 
@@ -0,0 +1,55 @@
1
+ import os
2
+ from typing import Any, Dict, List
3
+
4
+ from pdm.backend.hooks import Context
5
+
6
+ TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "typer")
7
+
8
+
9
+ def pdm_build_initialize(context: Context):
10
+ metadata = context.config.metadata
11
+ # Get main version
12
+ version = metadata["version"]
13
+ # Get package names to keep in sync with the same main version
14
+ sync_dependencies: List[str] = context.config.data["tool"]["tiangolo"][
15
+ "_internal-slim-build"
16
+ ]["sync-dependencies"]
17
+ # Get custom config for the current package, from the env var
18
+ config: Dict[str, Any] = context.config.data["tool"]["tiangolo"][
19
+ "_internal-slim-build"
20
+ ]["packages"][TIANGOLO_BUILD_PACKAGE]
21
+ project_config: Dict[str, Any] = config["project"]
22
+ # Get main optional dependencies, extras
23
+ optional_dependencies: Dict[str, List[str]] = metadata.get(
24
+ "optional-dependencies", {}
25
+ )
26
+ # Get custom optional dependencies name to always include in this (non-slim) package
27
+ include_optional_dependencies: List[str] = config.get(
28
+ "include-optional-dependencies", []
29
+ )
30
+ # Override main [project] configs with custom configs for this package
31
+ for key, value in project_config.items():
32
+ metadata[key] = value
33
+ # Get custom build config for the current package
34
+ build_config: Dict[str, Any] = (
35
+ config.get("tool", {}).get("pdm", {}).get("build", {})
36
+ )
37
+ # Override PDM build config with custom build config for this package
38
+ for key, value in build_config.items():
39
+ context.config.build_config[key] = value
40
+ # Get main dependencies
41
+ dependencies: List[str] = metadata.get("dependencies", [])
42
+ # Add optional dependencies to the default dependencies for this (non-slim) package
43
+ for include_optional in include_optional_dependencies:
44
+ optional_dependencies_group = optional_dependencies.get(include_optional, [])
45
+ dependencies.extend(optional_dependencies_group)
46
+ # Sync versions in dependencies
47
+ new_dependencies = []
48
+ for dep in dependencies:
49
+ if dep in sync_dependencies:
50
+ new_dep = f"{dep}=={version}"
51
+ new_dependencies.append(new_dep)
52
+ else:
53
+ new_dependencies.append(dep)
54
+ if new_dependencies != dependencies:
55
+ metadata["dependencies"] = new_dependencies
@@ -0,0 +1,240 @@
1
+ [build-system]
2
+ requires = [
3
+ "pdm-backend",
4
+ ]
5
+ build-backend = "pdm.backend"
6
+
7
+ [project]
8
+ name = "typer-cli"
9
+ dynamic = []
10
+ description = "Typer, build great CLIs. Easy to code. Based on Python type hints."
11
+ authors = [
12
+ { name = "Sebastián Ramírez", email = "tiangolo@gmail.com" },
13
+ ]
14
+ requires-python = ">=3.7"
15
+ classifiers = [
16
+ "Intended Audience :: Information Technology",
17
+ "Intended Audience :: System Administrators",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python",
21
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
22
+ "Topic :: Software Development :: Libraries :: Python Modules",
23
+ "Topic :: Software Development :: Libraries",
24
+ "Topic :: Software Development",
25
+ "Typing :: Typed",
26
+ "Development Status :: 4 - Beta",
27
+ "Intended Audience :: Developers",
28
+ "Programming Language :: Python :: 3 :: Only",
29
+ "Programming Language :: Python :: 3.7",
30
+ "Programming Language :: Python :: 3.8",
31
+ "Programming Language :: Python :: 3.9",
32
+ "Programming Language :: Python :: 3.10",
33
+ "Programming Language :: Python :: 3.11",
34
+ "License :: OSI Approved :: MIT License",
35
+ ]
36
+ dependencies = [
37
+ "typer==0.12.1",
38
+ ]
39
+ readme = "typer-cli/README.md"
40
+ version = "0.12.1"
41
+
42
+ [project.urls]
43
+ Documentation = "https://typer.tiangolo.com/"
44
+ homepage = "https://github.com/tiangolo/typer"
45
+
46
+ [project.optional-dependencies]
47
+
48
+ [tool.pdm]
49
+ distribution = true
50
+
51
+ [tool.pdm.version]
52
+ source = "file"
53
+ path = "typer/__init__.py"
54
+
55
+ [tool.pdm.build]
56
+ source-includes = [
57
+ "",
58
+ ]
59
+ excludes = [
60
+ "typer",
61
+ "tests",
62
+ "pdm_build.py",
63
+ ]
64
+
65
+ [tool.tiangolo._internal-slim-build]
66
+ sync-dependencies = [
67
+ "typer-slim[standard]",
68
+ "typer-cli",
69
+ "typer",
70
+ ]
71
+
72
+ [tool.tiangolo._internal-slim-build.packages.typer-slim.project]
73
+ name = "typer-slim"
74
+
75
+ [tool.tiangolo._internal-slim-build.packages.typer]
76
+ include-optional-dependencies = [
77
+ "standard",
78
+ ]
79
+
80
+ [tool.tiangolo._internal-slim-build.packages.typer.project.optional-dependencies]
81
+
82
+ [tool.tiangolo._internal-slim-build.packages.typer.project.scripts]
83
+ typer = "typer.cli:main"
84
+
85
+ [tool.tiangolo._internal-slim-build.packages.typer-cli.project]
86
+ name = "typer-cli"
87
+ readme = "typer-cli/README.md"
88
+ dependencies = [
89
+ "typer",
90
+ ]
91
+
92
+ [tool.tiangolo._internal-slim-build.packages.typer-cli.project.optional-dependencies]
93
+
94
+ [tool.tiangolo._internal-slim-build.packages.typer-cli.tool.pdm.build]
95
+ excludes = [
96
+ "typer",
97
+ "tests",
98
+ "pdm_build.py",
99
+ ]
100
+ source-includes = [
101
+ "",
102
+ ]
103
+
104
+ [tool.isort]
105
+ profile = "black"
106
+ known_third_party = [
107
+ "typer",
108
+ "click",
109
+ ]
110
+ skip_glob = [
111
+ "docs_src/subcommands/tutorial001/main.py",
112
+ "docs_src/subcommands/tutorial003/lands.py",
113
+ "docs_src/subcommands/tutorial003/main.py",
114
+ ]
115
+
116
+ [tool.pytest.ini_options]
117
+ addopts = [
118
+ "--strict-config",
119
+ "--strict-markers",
120
+ ]
121
+ xfail_strict = true
122
+ junit_family = "xunit2"
123
+ filterwarnings = [
124
+ "error",
125
+ "ignore:'autocompletion' is renamed to 'shell_complete'. The old name is deprecated and will be removed in Click 8.1. See the docs about 'Parameter' for information about new behavior.:DeprecationWarning:typer",
126
+ "ignore::DeprecationWarning:xdist",
127
+ ]
128
+
129
+ [tool.coverage.run]
130
+ parallel = true
131
+ data_file = "coverage/.coverage"
132
+ source = [
133
+ "docs_src",
134
+ "tests",
135
+ "typer",
136
+ ]
137
+ omit = [
138
+ "typer/_typing.py",
139
+ ]
140
+ context = "${CONTEXT}"
141
+
142
+ [tool.coverage.report]
143
+ exclude_lines = [
144
+ "pragma: no cover",
145
+ "@overload",
146
+ "if __name__ == \"__main__\":",
147
+ "if TYPE_CHECKING:",
148
+ ]
149
+
150
+ [tool.mypy]
151
+ strict = true
152
+
153
+ [[tool.mypy.overrides]]
154
+ module = "docs_src.*"
155
+ disallow_incomplete_defs = false
156
+ disallow_untyped_defs = false
157
+ disallow_untyped_calls = false
158
+
159
+ [[tool.mypy.overrides]]
160
+ module = "shellingham"
161
+ ignore_missing_imports = true
162
+
163
+ [tool.ruff.lint]
164
+ select = [
165
+ "E",
166
+ "W",
167
+ "F",
168
+ "I",
169
+ "B",
170
+ "C4",
171
+ "UP",
172
+ ]
173
+ ignore = [
174
+ "E501",
175
+ "B008",
176
+ "C901",
177
+ "W191",
178
+ ]
179
+
180
+ [tool.ruff.lint.per-file-ignores]
181
+ "docs_src/progressbar/tutorial004.py" = [
182
+ "UP028",
183
+ "B007",
184
+ ]
185
+ "docs_src/options_autocompletion/tutorial006_an.py" = [
186
+ "B006",
187
+ ]
188
+ "docs_src/multiple_values/multiple_options/tutorial002_an.py" = [
189
+ "B006",
190
+ ]
191
+ "docs_src/options_autocompletion/tutorial007_an.py" = [
192
+ "B006",
193
+ ]
194
+ "docs_src/options_autocompletion/tutorial008_an.py" = [
195
+ "B006",
196
+ ]
197
+ "docs_src/options_autocompletion/tutorial009_an.py" = [
198
+ "B006",
199
+ ]
200
+ "docs_src/parameter_types/enum/tutorial003_an.py" = [
201
+ "B006",
202
+ ]
203
+ "docs_src/progressbar/tutorial001.py" = [
204
+ "B007",
205
+ ]
206
+ "docs_src/progressbar/tutorial003.py" = [
207
+ "B007",
208
+ ]
209
+ "docs_src/progressbar/tutorial005.py" = [
210
+ "B007",
211
+ ]
212
+ "docs_src/progressbar/tutorial006.py" = [
213
+ "B007",
214
+ ]
215
+ "docs_src/prompt/tutorial003.py" = [
216
+ "F841",
217
+ ]
218
+ "docs_src/using_click/tutorial001.py" = [
219
+ "B007",
220
+ ]
221
+ "typer/_typing.py" = [
222
+ "UP036",
223
+ "F822",
224
+ ]
225
+
226
+ [tool.ruff.lint.isort]
227
+ known-third-party = [
228
+ "typer",
229
+ "click",
230
+ ]
231
+ known-first-party = [
232
+ "reigns",
233
+ "towns",
234
+ "lands",
235
+ "items",
236
+ "users",
237
+ ]
238
+
239
+ [tool.ruff.lint.pyupgrade]
240
+ keep-runtime-typing = true
@@ -30,9 +30,13 @@ Typer is a library for building <abbr title="command line interface, programs ex
30
30
 
31
31
  ## Typer CLI
32
32
 
33
- This package, `typer-cli`, only provides a command `typer` in the shell with the same functionality of `python -m typer`.
33
+ ⚠️ Do not install this package. ⚠️
34
34
 
35
- The only reason why this is a separate package is to allow developers to opt out of the `typer` command by installing `typer-slim`, that doesn't include `typer-cli`.
35
+ This package, `typer-cli`, does nothing other than depend on `typer`.
36
+
37
+ All the functionality has been integrated into `typer`.
38
+
39
+ The only reason this package exists is as a migration path for old projects that used to depend on `typer-cli`, so that they can get the latest version of `typer`.
36
40
 
37
41
  You probably **should not** install this package.
38
42
 
@@ -42,7 +46,7 @@ Install instead:
42
46
  pip install typer
43
47
  ```
44
48
 
45
- That includes this package, `typer-cli`, with the `typer` command.
49
+ That includes the `typer` command.
46
50
 
47
51
  ## License
48
52
 
@@ -1,40 +0,0 @@
1
- from pathlib import Path
2
- from typing import List
3
-
4
- from pdm.backend.hooks import Context
5
-
6
- packages_to_sync = ["typer-slim"]
7
-
8
- license_name = "LICENSE"
9
- license_path = Path("..") / license_name
10
-
11
-
12
- def pdm_build_hook_enabled(context: Context):
13
- return context.target == "sdist"
14
-
15
-
16
- def pdm_build_initialize(context: Context):
17
- metadata = context.config.metadata
18
- # Get main version
19
- version = metadata["version"]
20
- # Update version in dependencies to sync them
21
- dependencies: List[str] = metadata["dependencies"]
22
- new_dependencies = []
23
- for dep in dependencies:
24
- if any(dep.startswith(name) for name in packages_to_sync):
25
- new_dep = f"{dep}=={version}"
26
- new_dependencies.append(new_dep)
27
- else:
28
- new_dependencies.append(dep)
29
- if new_dependencies != dependencies:
30
- metadata["dependencies"] = new_dependencies
31
- # LICENSE
32
- license_content = license_path.read_text()
33
- context.ensure_build_dir()
34
- # # Workaround, copy LICENSE to package_dir during build
35
- Path(license_name).write_text(license_content)
36
-
37
-
38
- def pdm_build_finalize(context: Context, artifact: Path):
39
- # Workaround, remove LICENSE from package_dir after build
40
- Path(license_name).unlink()
@@ -1,62 +0,0 @@
1
- [build-system]
2
- requires = [
3
- "pdm-backend",
4
- ]
5
- build-backend = "pdm.backend"
6
-
7
- [project]
8
- name = "typer-cli"
9
- dynamic = []
10
- description = "Typer, build great CLIs. Easy to code. Based on Python type hints."
11
- authors = [
12
- { name = "Sebastián Ramírez", email = "tiangolo@gmail.com" },
13
- ]
14
- readme = "README.md"
15
- requires-python = ">=3.7"
16
- classifiers = [
17
- "Intended Audience :: Information Technology",
18
- "Intended Audience :: System Administrators",
19
- "Operating System :: OS Independent",
20
- "Programming Language :: Python :: 3",
21
- "Programming Language :: Python",
22
- "Topic :: Software Development :: Libraries :: Application Frameworks",
23
- "Topic :: Software Development :: Libraries :: Python Modules",
24
- "Topic :: Software Development :: Libraries",
25
- "Topic :: Software Development",
26
- "Typing :: Typed",
27
- "Development Status :: 4 - Beta",
28
- "Intended Audience :: Developers",
29
- "Programming Language :: Python :: 3 :: Only",
30
- "Programming Language :: Python :: 3.7",
31
- "Programming Language :: Python :: 3.8",
32
- "Programming Language :: Python :: 3.9",
33
- "Programming Language :: Python :: 3.10",
34
- "Programming Language :: Python :: 3.11",
35
- "License :: OSI Approved :: MIT License",
36
- ]
37
- dependencies = [
38
- "typer-slim[standard]==0.12.dev1",
39
- ]
40
- version = "0.12.dev1"
41
-
42
- [project.urls]
43
- Documentation = "https://typer.tiangolo.com/"
44
- homepage = "https://github.com/tiangolo/typer"
45
-
46
- [project.optional-dependencies]
47
- all = []
48
-
49
- [project.scripts]
50
- typer = "typer.cli:main"
51
-
52
- [tool.pdm]
53
- distribution = true
54
-
55
- [tool.pdm.version]
56
- source = "file"
57
- path = "../typer/__init__.py"
58
-
59
- [tool.pdm.build]
60
- excludes = [
61
- "*",
62
- ]
File without changes