FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

✨ Add sqlmodel-slim setup by tiangolo · Pull Request #916 · fastapi/sqlmodel · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .toml  (1) .yml  (2) All 3 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
matrix:
package:
- sqlmodel
- sqlmodel-slim
permissions:
id-token: write
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-redistribute.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
matrix:
package:
- sqlmodel
- sqlmodel-slim
steps:
- name: Dump GitHub context
env:
Expand Down
39 changes: 39 additions & 0 deletions pdm_build.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import os
from typing import Any, Dict, List

from pdm.backend.hooks import Context

TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "sqlmodel")


def pdm_build_initialize(context: Context) -> None:
metadata = context.config.metadata
# Get custom config for the current package, from the env var
config: Dict[str, Any] = context.config.data["tool"]["tiangolo"][
"_internal-slim-build"
]["packages"][TIANGOLO_BUILD_PACKAGE]
project_config: Dict[str, Any] = config["project"]
# Get main optional dependencies, extras
optional_dependencies: Dict[str, List[str]] = metadata.get(
"optional-dependencies", {}
)
# Get custom optional dependencies name to always include in this (non-slim) package
include_optional_dependencies: List[str] = config.get(
"include-optional-dependencies", []
)
# 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", [])
# Add optional dependencies to the default dependencies for this (non-slim) package
for include_optional in include_optional_dependencies:
optional_dependencies_group = optional_dependencies.get(include_optional, [])
dependencies.extend(optional_dependencies_group)
12 changes: 12 additions & 0 deletions pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ source-includes = [
"sqlmodel/sql/expression.py.jinja2",
]

[tool.tiangolo._internal-slim-build.packages.sqlmodel-slim.project]
name = "sqlmodel-slim"

[tool.tiangolo._internal-slim-build.packages.sqlmodel]
# include-optional-dependencies = ["standard"]

[tool.tiangolo._internal-slim-build.packages.sqlmodel.project]
optional-dependencies = {}

# [tool.tiangolo._internal-slim-build.packages.sqlmodel.project.scripts]
# sqlmodel = "sqlmodel.cli:main"

[tool.coverage.run]
parallel = true
source = [
Expand Down
2 changes: 1 addition & 1 deletion sqlmodel/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.0.17"
__version__ = "0.0.18.dev1"

# Re-export from SQLAlchemy
from sqlalchemy.engine import create_engine as create_engine
Expand Down

Back | FazBrowse Home | New Git URL