Skip to content
Myr

➖ Drop support for `typer-slim` and `typer-cli`, no more versions will be released, use only `typer` (#1568)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sebastián Ramírez · committed by GitHub · parent 4b13020 · Browse files · 3 files+0 added−93 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+0 added−93 removed

  • other:+0 added−93 removed

3 files+0 added−93 removed

modified:.github/labeler.yml-1 removed
deleted:pdm_build.py-40 removed
1import os2from typing import Any34from pdm.backend.hooks import Context56TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE")789def pdm_build_initialize(context: Context) -> None:10 metadata = context.config.metadata11 # Get main version12 version = metadata["version"]13 # Get custom config for the current package, from the env var14 all_configs_config: dict[str, Any] = context.config.data["tool"]["tiangolo"][15 "_internal-slim-build"16 ]["packages"]1718 if TIANGOLO_BUILD_PACKAGE not in all_configs_config:19 return2021 config = all_configs_config[TIANGOLO_BUILD_PACKAGE]22 project_config: dict[str, Any] = config["project"]23 # Override main [project] configs with custom configs for this package24 for key, value in project_config.items():25 metadata[key] = value26 # Get custom build config for the current package27 build_config: dict[str, Any] = (28 config.get("tool", {}).get("pdm", {}).get("build", {})29 )30 # Override PDM build config with custom build config for this package31 for key, value in build_config.items():32 context.config.build_config[key] = value33 # Get main dependencies34 dependencies: list[str] = metadata.get("dependencies", [])35 # Sync versions in dependencies36 new_dependencies = []37 for dep in dependencies:38 new_dep = f"{dep}>={version}"39 new_dependencies.append(new_dep)40 metadata["dependencies"] = new_dependencies
modified:pyproject.toml-52 removed
98 unmodified lines
99 "docs_src/",100 "scripts/",101]102103[tool.tiangolo._internal-slim-build.packages.typer-slim.project]104name = "typer-slim"105readme = "typer-slim/README.md"106dependencies = [107 "typer",108]109optional-dependencies = {}110scripts = {}111112[tool.tiangolo._internal-slim-build.packages.typer-slim.tool.pdm.build]113# excludes needs to explicitly exclude the top level python packages,114# otherwise PDM includes them by default115# A "*" glob pattern can't be used here because in PDM internals, the patterns are put116# in a set (unordered, order varies) and each excluded file is assigned one of the117# glob patterns that matches, as the set is unordered, the matched pattern could be "*"118# independent of the order here. And then the internal code would give it a lower score119# than the one for a default included file.120# By not using "*" and explicitly excluding the top level packages, they get a higher121# score than the default inclusion122excludes = ["typer", "tests", "pdm_build.py"]123# source-includes needs to explicitly define some value because PDM will check the124# truthy value of the list, and if empty, will include some defaults, including "tests",125# an empty string doesn't match anything, but makes the list truthy, so that PDM126# doesn't override it during the build.127source-includes = [""]128129[tool.tiangolo._internal-slim-build.packages.typer-cli.project]130name = "typer-cli"131readme = "typer-cli/README.md"132dependencies = [133 "typer",134]135optional-dependencies = {}136scripts = {}137138[tool.tiangolo._internal-slim-build.packages.typer-cli.tool.pdm.build]139# excludes needs to explicitly exclude the top level python packages,140# otherwise PDM includes them by default141# A "*" glob pattern can't be used here because in PDM internals, the patterns are put142# in a set (unordered, order varies) and each excluded file is assigned one of the143# glob patterns that matches, as the set is unordered, the matched pattern could be "*"144# independent of the order here. And then the internal code would give it a lower score145# than the one for a default included file.146# By not using "*" and explicitly excluding the top level packages, they get a higher147# score than the default inclusion148excludes = ["typer", "tests", "pdm_build.py"]149# source-includes needs to explicitly define some value because PDM will check the150# truthy value of the list, and if empty, will include some defaults, including "tests",151# an empty string doesn't match anything, but makes the list truthy, so that PDM152# doesn't override it during the build.153source-includes = [""]154103[tool.pytest.ini_options]104addopts = [105 "--strict-config",106 "--strict-markers",
105 unmodified lines