mirror of
https://github.com/fastapi/sqlmodel.git
synced 2026-03-13 09:29:54 +08:00
➖ Drop support for sqlmodel-slim, no more versions will be released, use only sqmodel (#1772)
This commit is contained in:
committed by
GitHub
parent
3e123f71cb
commit
248a0b9017
1
.github/labeler.yml
vendored
1
.github/labeler.yml
vendored
@@ -16,7 +16,6 @@ internal:
|
||||
- scripts/**
|
||||
- .gitignore
|
||||
- .pre-commit-config.yaml
|
||||
- pdm_build.py
|
||||
- requirements*.txt
|
||||
- uv.lock
|
||||
- all-globs-to-all-files:
|
||||
|
||||
40
pdm_build.py
40
pdm_build.py
@@ -1,40 +0,0 @@
|
||||
import os
|
||||
from typing import Any
|
||||
|
||||
from pdm.backend.hooks import Context
|
||||
|
||||
TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE")
|
||||
|
||||
|
||||
def pdm_build_initialize(context: Context) -> None:
|
||||
metadata = context.config.metadata
|
||||
# Get main version
|
||||
version = metadata["version"]
|
||||
# Get custom config for the current package, from the env var
|
||||
all_configs_config: dict[str, Any] = context.config.data["tool"]["tiangolo"][
|
||||
"_internal-slim-build"
|
||||
]["packages"]
|
||||
|
||||
if TIANGOLO_BUILD_PACKAGE not in all_configs_config:
|
||||
return
|
||||
|
||||
config = all_configs_config[TIANGOLO_BUILD_PACKAGE]
|
||||
project_config: dict[str, Any] = config["project"]
|
||||
# Override main [project] configs with custom configs for this package
|
||||
for key, value in project_config.items():
|
||||
metadata[key] = value
|
||||
# Get custom build config for the current package
|
||||
build_config: dict[str, Any] = (
|
||||
config.get("tool", {}).get("pdm", {}).get("build", {})
|
||||
)
|
||||
# Override PDM build config with custom build config for this package
|
||||
for key, value in build_config.items():
|
||||
context.config.build_config[key] = value
|
||||
# Get main dependencies
|
||||
dependencies: list[str] = metadata.get("dependencies", [])
|
||||
# Sync versions in dependencies
|
||||
new_dependencies = []
|
||||
for dep in dependencies:
|
||||
new_dep = f"{dep}>={version}"
|
||||
new_dependencies.append(new_dep)
|
||||
metadata["dependencies"] = new_dependencies
|
||||
@@ -100,32 +100,6 @@ source-includes = [
|
||||
"sqlmodel/sql/expression.py.jinja2",
|
||||
]
|
||||
|
||||
[tool.tiangolo._internal-slim-build.packages.sqlmodel-slim.project]
|
||||
name = "sqlmodel-slim"
|
||||
readme = "sqlmodel-slim/README.md"
|
||||
dependencies = [
|
||||
"sqlmodel",
|
||||
]
|
||||
optional-dependencies = {}
|
||||
scripts = {}
|
||||
|
||||
[tool.tiangolo._internal-slim-build.packages.sqlmodel-slim.tool.pdm.build]
|
||||
# excludes needs to explicitly exclude the top level python packages,
|
||||
# otherwise PDM includes them by default
|
||||
# A "*" glob pattern can't be used here because in PDM internals, the patterns are put
|
||||
# in a set (unordered, order varies) and each excluded file is assigned one of the
|
||||
# glob patterns that matches, as the set is unordered, the matched pattern could be "*"
|
||||
# independent of the order here. And then the internal code would give it a lower score
|
||||
# than the one for a default included file.
|
||||
# By not using "*" and explicitly excluding the top level packages, they get a higher
|
||||
# score than the default inclusion
|
||||
excludes = ["sqlmodel", "docs_src", "tests", "pdm_build.py"]
|
||||
# source-includes needs to explicitly define some value because PDM will check the
|
||||
# truthy value of the list, and if empty, will include some defaults, including "tests",
|
||||
# an empty string doesn't match anything, but makes the list truthy, so that PDM
|
||||
# doesn't override it during the build.
|
||||
source-includes = [""]
|
||||
|
||||
[tool.coverage.run]
|
||||
parallel = true
|
||||
data_file = "coverage/.coverage"
|
||||
|
||||
Reference in New Issue
Block a user