| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,11 +12,6 @@ on: | |||
| 12 | 12 | jobs: | |
| 13 | 13 | test-redistribute: | |
| 14 | 14 | runs-on: ubuntu-latest | |
| 15 | - strategy: | ||
| 16 | - matrix: | ||
| 17 | - package: | ||
| 18 | - - sqlmodel | ||
| 19 | - - sqlmodel-slim | ||
| 20 | 15 | steps: | |
| 21 | 16 | - name: Dump GitHub context | |
| 22 | 17 | env: | |
@@ -30,8 +25,6 @@ jobs: | |||
| 30 | 25 | - name: Install build dependencies | |
| 31 | 26 | run: pip install build | |
| 32 | 27 | - name: Build source distribution | |
| 33 | - env: | ||
| 34 | - TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }} | ||
| 35 | 28 | run: python -m build --sdist | |
| 36 | 29 | - name: Decompress source distribution | |
| 37 | 30 | run: | | |
@@ -41,8 +34,6 @@ jobs: | |||
| 41 | 34 | run: | | |
| 42 | 35 | cd dist/sqlmodel*/ | |
| 43 | 36 | pip install --group tests --editable . | |
| 44 | - env: | ||
| 45 | - TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }} | ||
| 46 | 37 | - name: Run source distribution tests | |
| 47 | 38 | run: | | |
| 48 | 39 | cd dist/sqlmodel*/ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,24 +3,23 @@ | |||
| 3 | 3 | ||
| 4 | 4 | from pdm.backend.hooks import Context | |
| 5 | 5 | ||
| 6 | - TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "sqlmodel") | ||
| 6 | + TIANGOLO_BUILD_PACKAGE = os.getenv("TIANGOLO_BUILD_PACKAGE", "typer") | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | def pdm_build_initialize(context: Context) -> None: | |
| 10 | 10 | metadata = context.config.metadata | |
| 11 | + # Get main version | ||
| 12 | + version = metadata["version"] | ||
| 11 | 13 | # Get custom config for the current package, from the env var | |
| 12 | - config: dict[str, Any] = context.config.data["tool"]["tiangolo"][ | ||
| 14 | + all_configs_config: dict[str, Any] = context.config.data["tool"]["tiangolo"][ | ||
| 13 | 15 | "_internal-slim-build" | |
| 14 | - ]["packages"][TIANGOLO_BUILD_PACKAGE] | ||
| 16 | + ]["packages"] | ||
| 17 | + | ||
| 18 | + if TIANGOLO_BUILD_PACKAGE not in all_configs_config: | ||
| 19 | + return | ||
| 20 | + | ||
| 21 | + config = all_configs_config[TIANGOLO_BUILD_PACKAGE] | ||
| 15 | 22 | project_config: dict[str, Any] = config["project"] | |
| 16 | - # Get main optional dependencies, extras | ||
| 17 | - optional_dependencies: dict[str, list[str]] = metadata.get( | ||
| 18 | - "optional-dependencies", {} | ||
| 19 | - ) | ||
| 20 | - # Get custom optional dependencies name to always include in this (non-slim) package | ||
| 21 | - include_optional_dependencies: list[str] = config.get( | ||
| 22 | - "include-optional-dependencies", [] | ||
| 23 | - ) | ||
| 24 | 23 | # Override main [project] configs with custom configs for this package | |
| 25 | 24 | for key, value in project_config.items(): | |
| 26 | 25 | metadata[key] = value | |
@@ -33,7 +32,9 @@ def pdm_build_initialize(context: Context) -> None: | |||
| 33 | 32 | context.config.build_config[key] = value | |
| 34 | 33 | # Get main dependencies | |
| 35 | 34 | dependencies: list[str] = metadata.get("dependencies", []) | |
| 36 | - # Add optional dependencies to the default dependencies for this (non-slim) package | ||
| 37 | - for include_optional in include_optional_dependencies: | ||
| 38 | - optional_dependencies_group = optional_dependencies.get(include_optional, []) | ||
| 39 | - dependencies.extend(optional_dependencies_group) | ||
| 35 | + # Sync versions in dependencies | ||
| 36 | + new_dependencies = [] | ||
| 37 | + for dep in dependencies: | ||
| 38 | + new_dep = f"{dep}>={version}" | ||
| 39 | + new_dependencies.append(new_dep) | ||
| 40 | + metadata["dependencies"] = new_dependencies | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -103,15 +103,29 @@ source-includes = [ | |||
| 103 | 103 | ||
| 104 | 104 | [tool.tiangolo._internal-slim-build.packages.sqlmodel-slim.project] | |
| 105 | 105 | name = "sqlmodel-slim" | |
| 106 | - | ||
| 107 | - [tool.tiangolo._internal-slim-build.packages.sqlmodel] | ||
| 108 | - # include-optional-dependencies = ["standard"] | ||
| 109 | - | ||
| 110 | - [tool.tiangolo._internal-slim-build.packages.sqlmodel.project] | ||
| 106 | + readme = "sqlmodel-slim/README.md" | ||
| 107 | + dependencies = [ | ||
| 108 | + "sqlmodel", | ||
| 109 | + ] | ||
| 111 | 110 | optional-dependencies = {} | |
| 112 | - | ||
| 113 | - # [tool.tiangolo._internal-slim-build.packages.sqlmodel.project.scripts] | ||
| 114 | - # sqlmodel = "sqlmodel.cli:main" | ||
| 111 | + scripts = {} | ||
| 112 | + | ||
| 113 | + [tool.tiangolo._internal-slim-build.packages.sqlmodel-slim.tool.pdm.build] | ||
| 114 | + # excludes needs to explicitly exclude the top level python packages, | ||
| 115 | + # otherwise PDM includes them by default | ||
| 116 | + # A "*" glob pattern can't be used here because in PDM internals, the patterns are put | ||
| 117 | + # in a set (unordered, order varies) and each excluded file is assigned one of the | ||
| 118 | + # glob patterns that matches, as the set is unordered, the matched pattern could be "*" | ||
| 119 | + # independent of the order here. And then the internal code would give it a lower score | ||
| 120 | + # than the one for a default included file. | ||
| 121 | + # By not using "*" and explicitly excluding the top level packages, they get a higher | ||
| 122 | + # score than the default inclusion | ||
| 123 | + excludes = ["sqlmodel", "tests", "pdm_build.py"] | ||
| 124 | + # source-includes needs to explicitly define some value because PDM will check the | ||
| 125 | + # truthy value of the list, and if empty, will include some defaults, including "tests", | ||
| 126 | + # an empty string doesn't match anything, but makes the list truthy, so that PDM | ||
| 127 | + # doesn't override it during the build. | ||
| 128 | + source-includes = [""] | ||
| 115 | 129 | ||
| 116 | 130 | [tool.coverage.run] | |
| 117 | 131 | parallel = true | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,52 @@ | |||
| 1 | + <p align="center"> | ||
| 2 | + <a href="https://sqlmodel.tiangolo.com"><img src="https://sqlmodel.tiangolo.com/img/logo-margin/logo-margin-vector.svg#only-light" alt="SQLModel"></a> | ||
| 3 | + | ||
| 4 | + </p> | ||
| 5 | + <p align="center"> | ||
| 6 | + <em>SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.</em> | ||
| 7 | + </p> | ||
| 8 | + <p align="center"> | ||
| 9 | + <a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3ATest+event%3Apush+branch%3Amain" target="_blank"> | ||
| 10 | + <img src="https://github.com/fastapi/sqlmodel/actions/workflows/test.yml/badge.svg?event=push&branch=main" alt="Test"> | ||
| 11 | + </a> | ||
| 12 | + <a href="https://github.com/fastapi/sqlmodel/actions?query=workflow%3APublish" target="_blank"> | ||
| 13 | + <img src="https://github.com/fastapi/sqlmodel/actions/workflows/publish.yml/badge.svg" alt="Publish"> | ||
| 14 | + </a> | ||
| 15 | + <a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/sqlmodel" target="_blank"> | ||
| 16 | + <img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/sqlmodel.svg" alt="Coverage"> | ||
| 17 | + <a href="https://pypi.org/project/sqlmodel" target="_blank"> | ||
| 18 | + <img src="https://img.shields.io/pypi/v/sqlmodel?color=%2334D058&label=pypi%20package" alt="Package version"> | ||
| 19 | + </a> | ||
| 20 | + </p> | ||
| 21 | + | ||
| 22 | + --- | ||
| 23 | + | ||
| 24 | + **Documentation**: <a href="https://sqlmodel.tiangolo.com" target="_blank">https://sqlmodel.tiangolo.com</a> | ||
| 25 | + | ||
| 26 | + **Source Code**: <a href="https://github.com/fastapi/sqlmodel" target="_blank">https://github.com/fastapi/sqlmodel</a> | ||
| 27 | + | ||
| 28 | + --- | ||
| 29 | + | ||
| 30 | + SQLModel is a library for interacting with <abbr title='Also called "Relational databases"'>SQL databases</abbr> from Python code, with Python objects. It is designed to be intuitive, easy to use, highly compatible, and robust. | ||
| 31 | + | ||
| 32 | + **SQLModel** is based on Python type annotations, and powered by <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> and <a href="https://sqlalchemy.org/" class="external-link" target="_blank">SQLAlchemy</a>. | ||
| 33 | + | ||
| 34 | + ## `sqlmodel-slim` | ||
| 35 | + | ||
| 36 | + ⚠️ Do not install this package. ⚠️ | ||
| 37 | + | ||
| 38 | + This package, `sqlmodel-slim`, does nothing other than depend on `sqlmodel`. | ||
| 39 | + | ||
| 40 | + You **should not** install this package. | ||
| 41 | + | ||
| 42 | + Install instead: | ||
| 43 | + | ||
| 44 | + ```bash | ||
| 45 | + pip install sqlmodel | ||
| 46 | + ``` | ||
| 47 | + | ||
| 48 | + This package is deprecated and will stop receiving any updates and published versions. | ||
| 49 | + | ||
| 50 | + ## License | ||
| 51 | + | ||
| 52 | + This project is licensed under the terms of the MIT license. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments