Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c13b71056e | ||
|
|
900e0d3371 | ||
|
|
a280b58c10 | ||
|
|
9ebbf255f7 | ||
|
|
39cbf27904 | ||
|
|
28d0e76370 |
1
.github/workflows/publish.yml
vendored
1
.github/workflows/publish.yml
vendored
@@ -18,6 +18,7 @@ jobs:
|
||||
matrix:
|
||||
package:
|
||||
- sqlmodel
|
||||
- sqlmodel-slim
|
||||
permissions:
|
||||
id-token: write
|
||||
steps:
|
||||
|
||||
1
.github/workflows/test-redistribute.yml
vendored
1
.github/workflows/test-redistribute.yml
vendored
@@ -16,6 +16,7 @@ jobs:
|
||||
matrix:
|
||||
package:
|
||||
- sqlmodel
|
||||
- sqlmodel-slim
|
||||
steps:
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
|
||||
@@ -2,6 +2,16 @@
|
||||
|
||||
## Latest Changes
|
||||
|
||||
## 0.0.18
|
||||
|
||||
### Internal
|
||||
|
||||
* ✨ Add `sqlmodel-slim` setup. PR [#916](https://github.com/tiangolo/sqlmodel/pull/916) by [@tiangolo](https://github.com/tiangolo).
|
||||
|
||||
In the future SQLModel will include the standard default recommended packages, and `sqlmodel-slim` will come without those recommended standard packages and with a group of optional dependencies `sqlmodel-slim[standard]`, equivalent to `sqlmodel`, for those that want to opt out of those packages.
|
||||
|
||||
* 🔧 Re-enable MkDocs Material Social plugin. PR [#915](https://github.com/tiangolo/sqlmodel/pull/915) by [@tiangolo](https://github.com/tiangolo).
|
||||
|
||||
## 0.0.17
|
||||
|
||||
### Refactors
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
plugins:
|
||||
# TODO: Re-enable once this is fixed: https://github.com/squidfunk/mkdocs-material/issues/6983
|
||||
# social:
|
||||
social:
|
||||
typeset:
|
||||
|
||||
39
pdm_build.py
Normal file
39
pdm_build.py
Normal file
@@ -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)
|
||||
@@ -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 = [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
__version__ = "0.0.17"
|
||||
__version__ = "0.0.18"
|
||||
|
||||
# Re-export from SQLAlchemy
|
||||
from sqlalchemy.engine import create_engine as create_engine
|
||||
|
||||
Reference in New Issue
Block a user