diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9205aac475..5b7c8e9f4e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,11 @@ env: POETRY_VERSION: "1.4.1" DENO_VERSION: "1.37.1" REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/typegate + WASM_TOOLS_VERSION: "1.0.37" + JCO_VERSION: "0.12.1" + WASMEDGE_VERSION: "0.12.1" + WASM_OPT_VERSION: "0.114.1" + PNPM_VERSION: "8.6.11" jobs: check-bump: @@ -92,20 +97,56 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: dsherret/rust-toolchain-file@v1 + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }} - uses: abatilo/actions-poetry@v2 with: poetry-version: ${{ env.POETRY_VERSION }} + - uses: pnpm/action-setup@v2.4.0 + with: + version: ${{ env.PNPM_VERSION }} + - uses: denoland/setup-deno@v1 + with: + deno-version: ${{ env.DENO_VERSION }} - uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} cache: "poetry" - - working-directory: typegraph/python - env: + - env: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + WASM_FILE: target/release/typegraph_core.wasm run: | + curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $WASMEDGE_VERSION + export LD_LIBRARY_PATH="$HOME/.wasmedge/lib:$LD_LIBRARY_PATH" + cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked + cargo install wasm-opt --version $WASM_OPT_VERSION --locked + + cargo build -p typegraph_core --target wasm32-unknown-unknown -F wasm --release + wasm-opt -Oz target/wasm32-unknown-unknown/release/typegraph_core.wasm -o $WASM_FILE.opt + wasm-tools component new $WASM_FILE.opt -o $WASM_FILE + + poetry install + poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen + + cd typegraph/python poetry install --sync poetry build poetry publish + cd ../.. + + cd typegraph/deno/src + deno run -A ../../../dev/publish.ts + cd ../../.. + + npm install --global @bytecodealliance/jco@$JCO_VERSION + jco transpile $WASM_FILE -o typegraph/deno/src/gen --map "*=../imports.ts" + deno run -A typegraph/deno/dev/fix-declarations.ts + cd typegraph/node + pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" + pnpm publish - uses: svenstaro/upload-release-action@v2 with: tag: ${{ github.ref }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d36c6b4c1..4b89293617 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -163,7 +163,7 @@ jobs: run: | python3 -m venv .venv source .venv/bin/activate - cd typegraph/python_next + cd typegraph/python poetry install --sync cd ../.. @@ -172,8 +172,8 @@ jobs: cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked cargo build -p typegraph_core --target wasm32-unknown-unknown -F wasm wasm-tools component new target/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE - rm -rf typegraph/python_next/typegraph_next/gen - poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python_next/typegraph_next/gen + rm -rf typegraph/python/typegraph/gen + poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen cargo run --locked --package meta-cli -- --help cargo test --locked --package meta-cli @@ -216,7 +216,7 @@ jobs: run: | python3 -m venv .venv ${{ matrix.activate }} - cd typegraph/python_next + cd typegraph/python poetry install --sync cd ../.. @@ -225,8 +225,8 @@ jobs: cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked cargo build -p typegraph_core --target wasm32-unknown-unknown -F wasm wasm-tools component new target/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE - rm -rf typegraph/python_next/typegraph_next/gen - poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python_next/typegraph_next/gen + rm -rf typegraph/python/typegraph/gen + poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen cargo run --locked --package meta-cli -- --help cargo test --locked --package meta-cli @@ -326,8 +326,8 @@ jobs: rm -rf typegraph/deno/src/gen jco transpile $WASM_FILE -o typegraph/deno/src/gen --map "*=../imports.ts" deno run -A typegraph/deno/dev/fix-declarations.ts - rm -rf typegraph/python_next/typegraph_next/gen - poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python_next/typegraph_next/gen + rm -rf typegraph/python/typegraph/gen + poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen deno install -A -n deno_bindgen $DENO_BINDGEN_URL OUT_DIR=target deno_bindgen -- --locked --package native -F deno @@ -372,7 +372,7 @@ jobs: tar -xvf meta.tar python3 -m venv .venv source .venv/bin/activate - cd typegraph/python_next + cd typegraph/python poetry install --sync cd ../.. cargo test --locked --exclude meta-cli --exclude native --exclude typegraph_core --workspace diff --git a/.gitignore b/.gitignore index b6d133e3cb..8e9a18bbd9 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,6 @@ coverage* typegraph/node typegraph/deno/src/gen -typegraph/python_next/typegraph_next/gen +typegraph/python/typegraph/gen *.egg-info/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea8bb3a3b3..487fba4d0b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,15 +28,23 @@ repos: rev: 3.6.0 hooks: - id: commitizen - stages: [commit-msg] + stages: + - commit-msg - repo: https://github.com/doublify/pre-commit-rust rev: v1.0 hooks: - id: fmt - id: cargo-check - args: ["--locked"] + args: + - "--locked" - id: clippy - args: ["--locked", "-F", "wasm", "--", "--deny", "warnings"] + args: + - "--locked" + - "-F" + - "wasm" + - "--" + - "--deny" + - "warnings" - repo: local hooks: - id: deno-fmt diff --git a/Cargo.lock b/Cargo.lock index 624fc06823..844925399b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -975,7 +975,7 @@ dependencies = [ [[package]] name = "common" -version = "0.2.0-alpha.1" +version = "0.2.0" dependencies = [ "anyhow", "base64 0.21.4", @@ -3221,7 +3221,7 @@ dependencies = [ [[package]] name = "macros" -version = "0.2.0-alpha.1" +version = "0.2.0" dependencies = [ "proc-macro2", "quote", @@ -3314,7 +3314,7 @@ dependencies = [ [[package]] name = "meta-cli" -version = "0.2.0-alpha.1" +version = "0.2.0" dependencies = [ "anyhow", "assert_cmd", @@ -3724,7 +3724,7 @@ dependencies = [ [[package]] name = "native" -version = "0.2.0-alpha.1" +version = "0.2.0" dependencies = [ "anyhow", "base64 0.21.4", @@ -7545,7 +7545,7 @@ dependencies = [ [[package]] name = "typegraph_core" -version = "0.2.0-alpha.1" +version = "0.2.0" dependencies = [ "common", "enum_dispatch", @@ -7572,7 +7572,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typescript" -version = "0.2.0-alpha.1" +version = "0.2.0" dependencies = [ "anyhow", "dprint-plugin-typescript", @@ -8418,7 +8418,7 @@ dependencies = [ [[package]] name = "xtask" -version = "0.2.0-alpha.1" +version = "0.2.0" dependencies = [ "anyhow", "clap", diff --git a/dev/lock.yml b/dev/lock.yml index 5cb34ca9d7..001de08af9 100644 --- a/dev/lock.yml +++ b/dev/lock.yml @@ -1,7 +1,7 @@ dev: files: dev/LICENSE-MPL-2.0.md: - - typegraph/python_next/LICENSE.md + - typegraph/python/LICENSE.md - typegraph/deno/LICENSE.md lines: rust-toolchain.toml: @@ -17,9 +17,10 @@ dev: '( WASM_TOOLS_VERSION: ").+(")': WASM_TOOLS_VERSION '( JCO_VERSION: ").+(")': JCO_VERSION '( WASMEDGE_VERSION: ").+(")': WASMEDGE_VERSION - typegraph/python_next/typegraph_next/__init__.py: + '( WASM_OPT_VERSION: ").+(")': WASM_OPT_VERSION + typegraph/python/typegraph/__init__.py: (version = ").+("): METATYPE_VERSION - typegraph/python_next/pyproject.toml: + typegraph/python/pyproject.toml: (description = ").+("): TAGLINE '**/Cargo.toml': (version = ").+("): METATYPE_VERSION @@ -32,7 +33,7 @@ dev: (ARG WASMEDGE_VERSION=).*(): WASMEDGE_VERSION typegate/src/typegraph/versions.ts: (const typegraphVersion = ").*(";): TYPEGRAPH_VERSION - typegraph/python_next/typegraph_next/graph/typegraph.py: + typegraph/python/typegraph/graph/typegraph.py: (typegraph_version = ").*("): TYPEGRAPH_VERSION typegraph/core/src/typegraph.rs: '(static TYPEGRAPH_VERSION: &str = ").*(";)': TYPEGRAPH_VERSION @@ -69,7 +70,8 @@ dev: WASMEDGE_VERSION: 0.12.1 TYPEGRAPH_VERSION: 0.0.2 PRISMA_VERSION: 5.4.0-dev.31 - METATYPE_VERSION: 0.2.0-alpha.1 + METATYPE_VERSION: 0.2.0 + WASM_OPT_VERSION: 0.114.1 TAGLINE: >- Declarative API development platform. Build serverless backends with zero-trust and less code, no matter where and how your (legacy) systems diff --git a/dev/publish.ts b/dev/publish.ts index fbf8d17530..511a6e0ca9 100644 --- a/dev/publish.ts +++ b/dev/publish.ts @@ -49,7 +49,7 @@ await dnt.build({ packageManager: "pnpm", package: { name: "@typegraph/sdk", - version: "0.0.1", //lockfile.dev.lock.METATYPE_VERSION, + version: lockfile.dev.lock.METATYPE_VERSION, description: lockfile.dev.lock.TAGLINE, license: "MPL-2.0", repository: { diff --git a/examples/demo/demo.py b/examples/demo/demo.py index 29a29c46ac..12fdee3c02 100644 --- a/examples/demo/demo.py +++ b/examples/demo/demo.py @@ -1,7 +1,7 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Auth, Rate -from typegraph_next.providers import PrismaRuntime -from typegraph_next.runtimes import DenoRuntime, HttpRuntime, PythonRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Auth, Rate +from typegraph.providers import PrismaRuntime +from typegraph.runtimes import DenoRuntime, HttpRuntime, PythonRuntime @typegraph( diff --git a/examples/templates/python/api/example.py b/examples/templates/python/api/example.py index 2baac4bb7f..0ba10790e9 100644 --- a/examples/templates/python/api/example.py +++ b/examples/templates/python/api/example.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes import PythonRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes import PythonRuntime @typegraph() diff --git a/examples/templates/python/compose.yml b/examples/templates/python/compose.yml index e24a2602a4..b49d79d3eb 100644 --- a/examples/templates/python/compose.yml +++ b/examples/templates/python/compose.yml @@ -1,6 +1,6 @@ services: typegate: - image: ghcr.io/metatypedev/typegate:v0.2.0-alpha.1 + image: ghcr.io/metatypedev/typegate:v0.2.0 restart: always ports: - "7890:7890" diff --git a/examples/templates/python/pyproject.toml b/examples/templates/python/pyproject.toml index 6b9b564d07..abf2d9b9d4 100644 --- a/examples/templates/python/pyproject.toml +++ b/examples/templates/python/pyproject.toml @@ -1,13 +1,13 @@ [tool.poetry] name = "example" -version = "0.2.0-alpha.1" +version = "0.2.0" description = "" authors = [] readme = "README.md" [tool.poetry.dependencies] python = ">=3.8,<4.0" -typegraph = "0.2.0-alpha.1" +typegraph = "0.2.0" [build-system] requires = ["poetry-core"] diff --git a/libs/common/Cargo.toml b/libs/common/Cargo.toml index e9e7b99de7..8856e0cdd4 100644 --- a/libs/common/Cargo.toml +++ b/libs/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "common" -version = "0.2.0-alpha.1" +version = "0.2.0" edition = "2021" [dependencies] diff --git a/libs/macros/Cargo.toml b/libs/macros/Cargo.toml index 38228e2fba..b401db1cce 100644 --- a/libs/macros/Cargo.toml +++ b/libs/macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "macros" -version = "0.2.0-alpha.1" +version = "0.2.0" edition = "2021" [lib] diff --git a/libs/typescript/Cargo.toml b/libs/typescript/Cargo.toml index fba6fa3428..9a0e1ee42d 100644 --- a/libs/typescript/Cargo.toml +++ b/libs/typescript/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "typescript" -version = "0.2.0-alpha.1" +version = "0.2.0" edition = "2021" [dependencies] diff --git a/libs/xtask/Cargo.toml b/libs/xtask/Cargo.toml index 18e532555b..232beac492 100644 --- a/libs/xtask/Cargo.toml +++ b/libs/xtask/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xtask" -version = "0.2.0-alpha.1" +version = "0.2.0" edition = "2021" [dependencies] diff --git a/meta-cli/Cargo.toml b/meta-cli/Cargo.toml index 6883902c56..367b18576e 100644 --- a/meta-cli/Cargo.toml +++ b/meta-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meta-cli" -version = "0.2.0-alpha.1" +version = "0.2.0" edition = "2021" description = "Declarative API development platform. Build serverless backends with zero-trust and less code, no matter where and how your (legacy) systems are." diff --git a/meta-cli/src/tests/typegraphs/codegen.py b/meta-cli/src/tests/typegraphs/codegen.py index e142b5e5a3..8d4830ca2d 100644 --- a/meta-cli/src/tests/typegraphs/codegen.py +++ b/meta-cli/src/tests/typegraphs/codegen.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes import DenoRuntime @typegraph() diff --git a/meta-cli/src/tests/typegraphs/enum_node.py b/meta-cli/src/tests/typegraphs/enum_node.py index ebf6f53944..e2ded66395 100644 --- a/meta-cli/src/tests/typegraphs/enum_node.py +++ b/meta-cli/src/tests/typegraphs/enum_node.py @@ -1,5 +1,5 @@ -from typegraph_next import t, typegraph, Graph -from typegraph_next.runtimes import DenoRuntime +from typegraph import t, typegraph, Graph +from typegraph.runtimes import DenoRuntime @typegraph() diff --git a/meta-cli/src/tests/typegraphs/union_node.py b/meta-cli/src/tests/typegraphs/union_node.py index baba3e7888..e85bff5bef 100644 --- a/meta-cli/src/tests/typegraphs/union_node.py +++ b/meta-cli/src/tests/typegraphs/union_node.py @@ -1,5 +1,5 @@ -from typegraph_next import t, typegraph, Graph -from typegraph_next.runtimes import DenoRuntime +from typegraph import t, typegraph, Graph +from typegraph.runtimes import DenoRuntime @typegraph() diff --git a/meta-cli/tests/e2e/typegraphs/validator.py b/meta-cli/tests/e2e/typegraphs/validator.py index 4ecc562e5b..03ec9fbfc5 100644 --- a/meta-cli/tests/e2e/typegraphs/validator.py +++ b/meta-cli/tests/e2e/typegraphs/validator.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, t, Graph -from typegraph_next.runtimes import DenoRuntime +from typegraph import typegraph, t, Graph +from typegraph.runtimes import DenoRuntime @typegraph() diff --git a/poetry.lock b/poetry.lock index 954379889b..9a25dba052 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "anyio" version = "4.0.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -26,7 +25,6 @@ trio = ["trio (>=0.22)"] name = "astunparse" version = "1.6.3" description = "An AST unparser for Python" -category = "main" optional = false python-versions = "*" files = [ @@ -42,7 +40,6 @@ wheel = ">=0.23.0,<1.0" name = "black" version = "23.9.1" description = "The uncompromising code formatter." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -89,7 +86,6 @@ uvloop = ["uvloop (>=0.15.2)"] name = "certifi" version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -101,7 +97,6 @@ files = [ name = "charset-normalizer" version = "3.3.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "dev" optional = false python-versions = ">=3.7.0" files = [ @@ -201,7 +196,6 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -216,7 +210,6 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -228,7 +221,6 @@ files = [ name = "databind" version = "1.5.3" description = "Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. The `databind` package will install the full suite of databind packages. Compatible with Python 3.7 and newer." -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -244,7 +236,6 @@ files = [ name = "databind-core" version = "1.5.3" description = "Databind is a library inspired by jackson-databind to de-/serialize Python dataclasses. Compatible with Python 3.7 and newer." -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -261,7 +252,6 @@ typing-extensions = ">=3.10.0" name = "databind-json" version = "1.5.3" description = "De-/serialize Python dataclasses to or from JSON payloads. Compatible with Python 3.7 and newer." -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -278,7 +268,6 @@ typing-extensions = ">=3.10.0" name = "deprecated" version = "1.2.14" description = "Python @deprecated decorator to deprecate old python classes, functions or methods." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -296,7 +285,6 @@ dev = ["PyTest", "PyTest-Cov", "bump2version (<1)", "sphinx (<2)", "tox"] name = "docspec" version = "2.1.2" description = "Docspec is a JSON object specification for representing API documentation of programming languages." -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -312,7 +300,6 @@ Deprecated = ">=1.2.12,<2.0.0" name = "docspec-python" version = "2.1.2" description = "A parser based on lib2to3 producing docspec data from Python source code." -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -329,7 +316,6 @@ docspec = ">=2.1.2,<3.0.0" name = "docstring-parser" version = "0.11" description = "\"Parse Python docstrings in reST, Google and Numpydoc format\"" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -343,7 +329,6 @@ test = ["black", "pytest"] name = "exceptiongroup" version = "1.1.3" description = "Backport of PEP 654 (exception groups)" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -358,7 +343,6 @@ test = ["pytest (>=6)"] name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -370,7 +354,6 @@ files = [ name = "httpcore" version = "0.18.0" description = "A minimal low-level HTTP client." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -382,17 +365,16 @@ files = [ anyio = ">=3.0,<5.0" certifi = "*" h11 = ">=0.13,<0.15" -sniffio = ">=1.0.0,<2.0.0" +sniffio = "==1.*" [package.extras] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (>=1.0.0,<2.0.0)"] +socks = ["socksio (==1.*)"] [[package]] name = "httpx" version = "0.25.0" description = "The next generation HTTP client." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -408,15 +390,14 @@ sniffio = "*" [package.extras] brotli = ["brotli", "brotlicffi"] -cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<14)"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (>=1.0.0,<2.0.0)"] +socks = ["socksio (==1.*)"] [[package]] name = "idna" version = "3.4" description = "Internationalized Domain Names in Applications (IDNA)" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -428,7 +409,6 @@ files = [ name = "importlib-metadata" version = "6.8.0" description = "Read metadata from Python packages" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -448,7 +428,6 @@ testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs name = "jinja2" version = "3.1.2" description = "A very fast and expressive template engine." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -466,7 +445,6 @@ i18n = ["Babel (>=2.7)"] name = "markupsafe" version = "2.1.3" description = "Safely add untrusted strings to HTML/XML markup." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -526,7 +504,6 @@ files = [ name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -538,7 +515,6 @@ files = [ name = "nr-util" version = "0.8.12" description = "General purpose Python utility library." -category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -554,7 +530,6 @@ typing-extensions = ">=3.0.0" name = "packaging" version = "23.2" description = "Core utilities for Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -566,7 +541,6 @@ files = [ name = "pathspec" version = "0.11.2" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -578,7 +552,6 @@ files = [ name = "platformdirs" version = "3.11.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -594,7 +567,6 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-co name = "pydoc-markdown" version = "4.6.4" description = "Create Python API documentation in Markdown format." -category = "dev" optional = false python-versions = "^3.8" files = [] @@ -629,7 +601,6 @@ resolved_reference = "994c941a41cdd5fe747801f0b4cf18f490fcd23a" name = "python-box" version = "7.1.1" description = "Advanced Python dictionaries with dot notation access" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -662,7 +633,6 @@ yaml = ["ruamel.yaml (>=0.17)"] name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -712,7 +682,6 @@ files = [ name = "requests" version = "2.31.0" description = "Python HTTP for Humans." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -734,7 +703,6 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "respx" version = "0.20.2" description = "A utility for mocking out the Python HTTPX and HTTP Core libraries." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -749,7 +717,6 @@ httpx = ">=0.21.0" name = "ruff" version = "0.0.291" description = "An extremely fast Python linter, written in Rust." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -776,7 +743,6 @@ files = [ name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -788,7 +754,6 @@ files = [ name = "sniffio" version = "1.3.0" description = "Sniff out which async library your code is running under" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -800,7 +765,6 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -812,7 +776,6 @@ files = [ name = "tomli-w" version = "1.0.0" description = "A lil' TOML writer" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -821,10 +784,9 @@ files = [ ] [[package]] -name = "typegraph-next" -version = "0.2.0-alpha.1" +name = "typegraph" +version = "0.2.0" description = "Declarative API development platform. Build serverless backends with zero-trust and less code, no matter where and how your (legacy) systems are." -category = "main" optional = false python-versions = ">=3.8,<4.0" files = [] @@ -838,13 +800,12 @@ wasmtime = "^10.0.1" [package.source] type = "directory" -url = "typegraph/python_next" +url = "typegraph/python" [[package]] name = "typing-extensions" version = "4.8.0" description = "Backported and Experimental Type Hints for Python 3.8+" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -856,7 +817,6 @@ files = [ name = "urllib3" version = "2.0.6" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -874,7 +834,6 @@ zstd = ["zstandard (>=0.18.0)"] name = "wasmtime" version = "10.0.1" description = "A WebAssembly runtime powered by Wasmtime" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -893,7 +852,6 @@ testing = ["coverage", "flake8 (==4.0.1)", "pycparser", "pytest", "pytest-flake8 name = "watchdog" version = "3.0.0" description = "Filesystem events monitoring" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -933,7 +891,6 @@ watchmedo = ["PyYAML (>=3.10)"] name = "wheel" version = "0.41.2" description = "A built-package format for Python" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -948,7 +905,6 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"] name = "wrapt" version = "1.15.0" description = "Module for decorators, wrappers and monkey patching." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" files = [ @@ -1033,7 +989,6 @@ files = [ name = "yapf" version = "0.40.2" description = "A formatter for Python code" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1050,7 +1005,6 @@ tomli = ">=2.0.1" name = "zipp" version = "3.17.0" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1065,4 +1019,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8,<4.0" -content-hash = "85de3d4ea85f673e250965408f8a6fe9257af98234ef287049783c200ea99da4" +content-hash = "349de0b533c457d51c88caa32bdb84fae498858826e7ca3bc3a22822025359a4" diff --git a/pyproject.toml b/pyproject.toml index 35d0b74aff..148b22e7ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] name = "metatype" -version = "0.2.0-alpha.1" +version = "0.2.0" description = "" authors = [] [tool.poetry.dependencies] python = ">=3.8,<4.0" -typegraph_next = { path = "typegraph/python_next", develop = true } +typegraph = { path = "typegraph/python", develop = true } # typegraph-std = "^0.0.1" [tool.poetry.group.dev.dependencies] diff --git a/typegate/native/Cargo.toml b/typegate/native/Cargo.toml index 2bfeb49bc7..d5834cb79a 100644 --- a/typegate/native/Cargo.toml +++ b/typegate/native/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "native" -version = "0.2.0-alpha.1" +version = "0.2.0" edition = "2021" [lib] diff --git a/typegate/src/typegraphs/introspection.py b/typegate/src/typegraphs/introspection.py index 2ecf7d2407..1f6ec412f0 100644 --- a/typegate/src/typegraphs/introspection.py +++ b/typegate/src/typegraphs/introspection.py @@ -1,13 +1,13 @@ # Copyright Metatype under the Elastic License 2.0. -from typegraph_next import typegraph, t, Graph, Policy -from typegraph_next.gen.exports.runtimes import ( +from typegraph import typegraph, t, Graph, Policy +from typegraph.gen.exports.runtimes import ( TypegraphOperation, EffectNone, ) -from typegraph_next.wit import runtimes, store -from typegraph_next.gen.types import Err -from typegraph_next.runtimes.base import Materializer +from typegraph.wit import runtimes, store +from typegraph.gen.types import Err +from typegraph.runtimes.base import Materializer @typegraph() diff --git a/typegate/src/typegraphs/prisma_migration.py b/typegate/src/typegraphs/prisma_migration.py index 6de4869bbd..804f63ead6 100644 --- a/typegate/src/typegraphs/prisma_migration.py +++ b/typegate/src/typegraphs/prisma_migration.py @@ -1,13 +1,13 @@ -from typegraph_next.gen.exports.runtimes import ( +from typegraph.gen.exports.runtimes import ( PrismaMigrationOperation, ) -from typegraph_next.gen.types import Err -from typegraph_next import typegraph, t, Graph -from typegraph_next.graph.params import Auth, Rate -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph.gen.types import Err +from typegraph import typegraph, t, Graph +from typegraph.graph.params import Auth, Rate +from typegraph.runtimes.deno import DenoRuntime # we don't want to expose system runtimes to the user, so no client SDK -from typegraph_next.wit import runtimes, store +from typegraph.wit import runtimes, store @typegraph( diff --git a/typegate/src/typegraphs/typegate.py b/typegate/src/typegraphs/typegate.py index 631d71c2b7..671feec79d 100644 --- a/typegate/src/typegraphs/typegate.py +++ b/typegate/src/typegraphs/typegate.py @@ -1,17 +1,17 @@ # Copyright Metatype under the Elastic License 2.0. -from typegraph_next import typegraph, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime -from typegraph_next.graph.params import Auth, Rate, Cors -from typegraph_next.wit import runtimes, store -from typegraph_next.gen.exports.runtimes import ( +from typegraph import typegraph, t, Graph +from typegraph.runtimes.deno import DenoRuntime +from typegraph.graph.params import Auth, Rate, Cors +from typegraph.wit import runtimes, store +from typegraph.gen.exports.runtimes import ( TypegateOperation, EffectNone, EffectCreate, EffectDelete, ) -from typegraph_next.gen.types import Err -from typegraph_next.runtimes.base import Materializer +from typegraph.gen.types import Err +from typegraph.runtimes.base import Materializer @typegraph( diff --git a/typegate/tests/auth/auth.py b/typegate/tests/auth/auth.py index 3019546928..596466c03f 100644 --- a/typegate/tests/auth/auth.py +++ b/typegate/tests/auth/auth.py @@ -1,7 +1,7 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import oauth2 -from typegraph_next.runtimes.deno import DenoRuntime -from typegraph_next.runtimes.http import HttpRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import oauth2 +from typegraph.runtimes.deno import DenoRuntime +from typegraph.runtimes.http import HttpRuntime @typegraph( diff --git a/typegate/tests/auto/test/test.py b/typegate/tests/auto/test/test.py index 30a2bfc920..bd655961c2 100644 --- a/typegate/tests/auto/test/test.py +++ b/typegate/tests/auto/test/test.py @@ -1,7 +1,7 @@ # Copyright Metatype under the Elastic License 2.0. -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/e2e/typegraph/__snapshots__/typegraph_test.ts.snap b/typegate/tests/e2e/typegraph/__snapshots__/typegraph_test.ts.snap index 1fbf7be0f1..fec29f2e31 100644 --- a/typegate/tests/e2e/typegraph/__snapshots__/typegraph_test.ts.snap +++ b/typegate/tests/e2e/typegraph/__snapshots__/typegraph_test.ts.snap @@ -754,7 +754,7 @@ snapshot[`typegraphs creation 3`] = ` "idempotent": true }, "data": { - "code": "file:scripts/three.ts;base64:H4sIAAAAAAAA/+1Y627bNhT2bz0Fof6ROkWx5TgbvKnY1nZdgQYL0mwYEAQCLdG2UEnUSGqxZ/hN9jZ7sR2Ssm7xpcWSYC18gMQiD8+Nl4+HJ6RpnpCFmy97j0Z9oPOzM/UL1P0deiOvN+ifnQ/6Xt8byv7BwBsMe/3eE1DBBWYI9f4rdYP7TOgZeknzJYtnc4EuiMBimRP0yz9/OyiJQ5JxEqEiiwhDYk7QBf0rThKMLosJcNE7PQL9RhiPaYY8t+8az9D7y1e/n5S8k7cRyUQ8jQkbo4vLdycwxjCmjKZIWpoxnM+DjCwEitOcMoGEUzO2jXPVp5tjhlO+EfqhEHMHAmHcQVdYkD2CVedG9s1OSzmFIJebcZeqtXUgKyDElHAXYqWb8a/g+0ozDIPTlFzLmfWRcLlgRSgsAwGt1H9JJs2IOQY2ZgwvLeHGmSAzwizbQWmc+UMHZTglvnl9R03bqeUEtKUczQUsAk5ANGd0sbTM96VV0y7Hr/WP1lNxHcM2jFDjwCEncQCMOJspi/rTajqDg2lCsVBs9WVJ3wduH4IoEhGDjYBOfdgFLaksIFmRKin5Yd2o2XB0cLedoeXE1CKbmZId/s3AQd6tg0KaTeOZvzI/kCWMMv/ESUHM9RZna0Xa41KNOwJF7qhtPdDzsglfTtGqVF0rsFtWMsIFiVpLS2I4Tcy6aUxhIwz71rbr1byvKrgD8YCRKejcbKzOZKY4TvRsyi9r2/K/rBdc7wDj+2pb62UP4Tz58lBZlXKcJPQuCBlRpxon3P8J/jWs6wFzggEyuH9z2+WkRMxpBBzzzetr8x6bAhDBfrkxnzd5ZJFTTrZqTfEiwDMScBL6A6+vGWW4GFABRktwcCeYxyFsKwEz+KP8lr1yZynscOcpDr3RuaX4P0NDse3SEANI8SWu1BNxF2cR+CvNnvedbncSp7EAf76pOX8UhC1LRqM7oSFOArIICef+qO6H3SsAWoK4gk/fLDhhZhWhbURkiqS/QXl2A7l+3JqNNabZYzVUYZLfhCPLVoy8mEC/hjU3V4gOHMWauXrK63ilHV+qcqdFFtb92tdqJzkthnAnlCYEZ81NrCUi2IGWjfwXCA4RMWu27ardrbHXArdKUdvoHekRqELl6hJ7+EzwQP43GHn9bv43HHqDY/73BLQnFVMo4hzOyB4uT9orlC/h6sgqM6pVJVjNy6uBjPd2dxcdNe5twcH90Kld8dte7EZPHEW+lnFliEGC00mErQ5YNlOuJq3u9UgypzHjzUSrg7HVOLijaBbtH7hu9dhdGN8qp4NAizFa3JTO3KKvZKO0eLsH1eG3oa5cpuWuG6aRa92PeluE648LobyHVkhpdZBWhNbqYlJ96HnZaX5UMJ/fLcVDFueCn4o5I8QVvPcIdAD/AfmHXfz3hmdH/H8KOj39lALA6wRz0Xj5qxc/qNj55C8F9LNfPnDYFIcEXcvd9jbLC6HQbTJG8OaaEPYtNHDdWBuGhFKAe4kJ8kGE1D6V6LBC2EETtB43lMlDuIKe1SZ/HqMrOL0s+k6/sxwI5UNG77IX8i1kj5Vx3DTe8GStuIyIgmWVNelT70siHsvk/VHLfwfzv/Pzr+/V//pno+P5fwL6P9f/nDIrc/YU6Q7X3rCqZ1XFFSjGDZoVrpWJIXOA021OWsUkVbfyIJMwjElLg2Y4svTgnw2BLd/lbY1x1FIlcxRICHXaAnUby7yULXu9Ken9Kl/2oEkOOqhJljUoq3Vp4UqXVr0zI/7kGsHu9FjBOZSoavamZ3cmDGW9RpLHoVY3cVrlgIFntvOrjc5G6gZFwYYSOf0OklNXaZJdShukdnE0RnK51Cqt7Y72VjqodJYMExpLWYHUbk1lmcu0jS0psrqRtD96+wUqLvmnV0QNAFUpjYoE2t2Ua59LesK7Zo/FkCMd6UgPQP8CI0sWDAAeAAA=" + "code": "file:scripts/three.ts;base64:H4sIAAAAAAAA/+1Y727bNhD3Zz0FoX6ROkXxv6SDNxXb2q4r0GBBmg0DDEOgJdoWKokaSS32DL/J3mYvtiMp65/tuMWSYCt8QGKRdzzeHckfjxfQJIvJ0s1WnUejLtDlcKh+gdq/g36/1+l1h5e9br/bH8j+Xq/ffdHpdp6Aci4wQ6jzb6nt3P+EnqFXNFuxaL4Q6IoILFYZQT///ZeD4iggKSchytOQMCQWBF3RP6M4xug6nwIXvdcS6FfCeERT1He7rvEMfbh+/dtZwTt7F5JURLOIsBG6un5/BjKGMWM0QXKmOcPZAkVJRplAwqn6WiKu/p9hhhO+lf8+FwsHzGfcQTdYkP1jdqZ5u09/RsGh1VbkWrXaMiwHTxLCXXCJbkVfw/eNZhgGpwm5lQH0kHC5YHkgLAMBrdV/SSZNiTkCNmYMryzhRqkgc8Is20FJlHoDB6U4IZ55e0dN26nGCWjLcTQTEGscw9CM0eXKMj8Us5p2Ib/RP1pPyXUM2zACfdyPGYl9YETpXM2oP626MdifxRQLxVZflrS953bBiTwWEczh05kHi90YlfokzRM1Sn5YYxUNRzs3aYkWgamGbCMlO7xxz0H9iYMCms6iubc2P5IVSJl/4Dgn5maPsZUibXGhxr0ARe5Fc3Zfx2XrvgzRulBdKbAbs6SECxI2lpZEcGiYNa6FsOaGPbHtajV3Vfl3MNxnZAY6txurFcwER7GOpvyy9i3/q2rB9Q4wvit3tF72AA6QJ0+RVSrHcUzv/IARdXhxzL0f4V9tdi2wIBiQgXvjSZuTELGgIXDMt29uzR02BbyB/TI2n9d5ZJlRTvZqTfDSx3PicxJ4cDVoRuEuBhgAaYkG7hTzKIBtJSCCP8hv2St3lgILd5HgoH9xaSn+T9BQbLuYiAGGeBJIqkDcRWkI9sppL7tOuzuOkkiAPV9XnN9zwlYFo9Yd0wDHPlkGhHPvouqH3SvIUvhRiZKemXPCzNJD2wjJDEl7/eLs+nL9uDUfaSSzR0pUYZJXhyPLVowsn0K/RjQ3U8ANHMWauzrklb9yHk+qcmd5GlT92tZyJzkNhnCnlMYEp/VNrEeEsAMtG3kvERwiYlZs21W7W8OuBWYVQ22jc6KnpBKuy9vt4TPBI/lfb/hi2M7/BoNB75T/PQHtT8UUsjj3ZmQPkjEdks9WcH+kpXLVKrOs+g1Wg8edndyGSA1+e8DwfvzUpnhNKw5DKA5DT49xpXd+jJNpiK0WYtbzrjqtd3okmbOI8Xq21QLaUg4uKpqG9wtuGj12G8v3jtNOoOUILceFMRP0lWwUM07ugXb4rakrlml16JqpJVy7Xu/zcPNpLhSX0RoprQ7SitBG3U6qDz0vOs1PcubLuKp4wKJM8HOxYIS4gncegY7gPyD/oI3//cHwhP9PQefnn1MAeBNjLmovf/XiBxUHn/zFAP3sly8fNsMBQbdyt71Ls1woxJuOEDzGpoR9Aw1cNTaGIeEVrgCJE/KlhNQ+lYixRthBU7QZ1ZTJg7mGnvU2sR6hGzjRLPxWP8AccOVjSu/Sl/KRZI/U5Lg+ec2SjeIyInKWlrNJmzpfEvFIZvWPWv47mv9dXlzs1P+6w/7p/D8B/Ufrf06RpDn7y3XHS3FYlbfKWgvU5nr1gtfaxJBDwJk2p43akipj9SGnMIxpQ4NmOLIS4Q0HwJbP9KbGKGyoktkKpIY6gYEyjmVey5a92Vb4fpEPfdAkhY5qklUOyipdenCpS6s+mBt/dsngcKKsQBwqVhV723M4J4YqXy3d41C6mzqN6kCvbzYzra3OWhIHNcKaEhl+B8nQlZpkl9IGSV4UjpBcLrVKG7ulvZEYKp0Fw4TGShYktVkzWfUybWNPsqzuIW2P3n6+8kv+6RVRAqAqoWEeQ7udaN1nkg54e9pTbeREJzrRg9I/dTR9KgAeAAA=" } }, { diff --git a/typegate/tests/e2e/typegraph/typegraphs/python/complex.py b/typegate/tests/e2e/typegraph/typegraphs/python/complex.py index de5e0cccf7..b410298f03 100644 --- a/typegate/tests/e2e/typegraph/typegraphs/python/complex.py +++ b/typegate/tests/e2e/typegraph/typegraphs/python/complex.py @@ -1,11 +1,11 @@ # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. # SPDX-License-Identifier: MPL-2.0 -from typegraph_next import t, typegraph -from typegraph_next.graph.params import Auth, Cors, Rate -from typegraph_next.graph.typegraph import Graph -from typegraph_next.policy import Policy -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import t, typegraph +from typegraph.graph.params import Auth, Cors, Rate +from typegraph.graph.typegraph import Graph +from typegraph.policy import Policy +from typegraph.runtimes.deno import DenoRuntime someType = t.struct( { diff --git a/typegate/tests/e2e/typegraph/typegraphs/python/multiple_runtimes.py b/typegate/tests/e2e/typegraph/typegraphs/python/multiple_runtimes.py index e975d20146..a89cb68896 100644 --- a/typegate/tests/e2e/typegraph/typegraphs/python/multiple_runtimes.py +++ b/typegate/tests/e2e/typegraph/typegraphs/python/multiple_runtimes.py @@ -1,7 +1,7 @@ -from typegraph_next import Graph, t, typegraph -from typegraph_next.policy import Policy -from typegraph_next.runtimes.deno import DenoRuntime -from typegraph_next.runtimes.python import PythonRuntime +from typegraph import Graph, t, typegraph +from typegraph.policy import Policy +from typegraph.runtimes.deno import DenoRuntime +from typegraph.runtimes.python import PythonRuntime @typegraph() diff --git a/typegate/tests/e2e/typegraph/typegraphs/python/simple.py b/typegate/tests/e2e/typegraph/typegraphs/python/simple.py index d04b063721..dd54fd3415 100644 --- a/typegate/tests/e2e/typegraph/typegraphs/python/simple.py +++ b/typegate/tests/e2e/typegraph/typegraphs/python/simple.py @@ -1,8 +1,8 @@ # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. # SPDX-License-Identifier: MPL-2.0 -from typegraph_next import t, typegraph, Policy, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import t, typegraph, Policy, Graph +from typegraph.runtimes.deno import DenoRuntime a = t.integer() diff --git a/typegate/tests/graphql/graphql.py b/typegate/tests/graphql/graphql.py index 3cc1a8a835..d618b6bbb5 100644 --- a/typegate/tests/graphql/graphql.py +++ b/typegate/tests/graphql/graphql.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, effects, Policy, t, Graph -from typegraph_next.runtimes.graphql import GraphQLRuntime +from typegraph import typegraph, effects, Policy, t, Graph +from typegraph.runtimes.graphql import GraphQLRuntime @typegraph() diff --git a/typegate/tests/injection/injection.py b/typegate/tests/injection/injection.py index 8bfbdd0709..64bfb5907b 100644 --- a/typegate/tests/injection/injection.py +++ b/typegate/tests/injection/injection.py @@ -1,8 +1,8 @@ -from typegraph_next import typegraph, effects, Policy, t, Graph -from typegraph_next.providers.prisma import PrismaRuntime -from typegraph_next.runtimes.deno import DenoRuntime -from typegraph_next.runtimes.graphql import GraphQLRuntime -from typegraph_next.effects import CREATE, UPDATE, DELETE, NONE +from typegraph import typegraph, effects, Policy, t, Graph +from typegraph.providers.prisma import PrismaRuntime +from typegraph.runtimes.deno import DenoRuntime +from typegraph.runtimes.graphql import GraphQLRuntime +from typegraph.effects import CREATE, UPDATE, DELETE, NONE @typegraph() diff --git a/typegate/tests/internal/internal.py b/typegate/tests/internal/internal.py index 2db6fb1a3d..17a9a95157 100644 --- a/typegate/tests/internal/internal.py +++ b/typegate/tests/internal/internal.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph(name="test_internal") diff --git a/typegate/tests/introspection/union_either.py b/typegate/tests/introspection/union_either.py index 3bca33b65b..0bec423094 100644 --- a/typegate/tests/introspection/union_either.py +++ b/typegate/tests/introspection/union_either.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/nesting/nesting.py b/typegate/tests/nesting/nesting.py index 43cb32e1e0..b79b3bb563 100644 --- a/typegate/tests/nesting/nesting.py +++ b/typegate/tests/nesting/nesting.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.http import HttpRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.http import HttpRuntime @typegraph() diff --git a/typegate/tests/planner/planner.py b/typegate/tests/planner/planner.py index 79676eac37..25d36150c3 100644 --- a/typegate/tests/planner/planner.py +++ b/typegate/tests/planner/planner.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, t, Graph, Policy -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, t, Graph, Policy +from typegraph.runtimes.deno import DenoRuntime from typing import Optional diff --git a/typegate/tests/policies/effects.py b/typegate/tests/policies/effects.py index a24b5491aa..fc0ea8f760 100644 --- a/typegate/tests/policies/effects.py +++ b/typegate/tests/policies/effects.py @@ -1,6 +1,6 @@ -from typegraph_next import typegraph, effects, t, Graph, Policy -from typegraph_next.graph.params import Auth -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, effects, t, Graph, Policy +from typegraph.graph.params import Auth +from typegraph.runtimes.deno import DenoRuntime @typegraph( diff --git a/typegate/tests/policies/policies.py b/typegate/tests/policies/policies.py index 2aa542ed62..f12fee3ba0 100644 --- a/typegate/tests/policies/policies.py +++ b/typegate/tests/policies/policies.py @@ -1,6 +1,6 @@ -from typegraph_next import typegraph, t, Graph -from typegraph_next.graph.params import Auth -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, t, Graph +from typegraph.graph.params import Auth +from typegraph.runtimes.deno import DenoRuntime @typegraph( diff --git a/typegate/tests/policies/policies_jwt.py b/typegate/tests/policies/policies_jwt.py index 39e068d725..9677a996ef 100644 --- a/typegate/tests/policies/policies_jwt.py +++ b/typegate/tests/policies/policies_jwt.py @@ -1,8 +1,8 @@ import re -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Auth -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Auth +from typegraph.runtimes.deno import DenoRuntime @typegraph( diff --git a/typegate/tests/policies/policies_jwt_format.py b/typegate/tests/policies/policies_jwt_format.py index 5480d73367..334262d15e 100644 --- a/typegate/tests/policies/policies_jwt_format.py +++ b/typegate/tests/policies/policies_jwt_format.py @@ -1,6 +1,6 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Auth -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Auth +from typegraph.runtimes.deno import DenoRuntime @typegraph( diff --git a/typegate/tests/policies/policies_jwt_injection.py b/typegate/tests/policies/policies_jwt_injection.py index 0517417c55..774ae36c8e 100644 --- a/typegate/tests/policies/policies_jwt_injection.py +++ b/typegate/tests/policies/policies_jwt_injection.py @@ -1,6 +1,6 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Auth -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Auth +from typegraph.runtimes.deno import DenoRuntime @typegraph( diff --git a/typegate/tests/query_parsers/graphql_namespaces.py b/typegate/tests/query_parsers/graphql_namespaces.py index 19589ac1f0..6be69ae61c 100644 --- a/typegate/tests/query_parsers/graphql_namespaces.py +++ b/typegate/tests/query_parsers/graphql_namespaces.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, effects, Policy, t, Graph -from typegraph_next.runtimes.graphql import GraphQLRuntime +from typegraph import typegraph, effects, Policy, t, Graph +from typegraph.runtimes.graphql import GraphQLRuntime @typegraph(name="graphql_namespaces") diff --git a/typegate/tests/random/random.py b/typegate/tests/random/random.py index 17e8736874..5773ca8a4d 100644 --- a/typegate/tests/random/random.py +++ b/typegate/tests/random/random.py @@ -1,7 +1,7 @@ -from typegraph_next import t, typegraph -from typegraph_next.graph.typegraph import Graph -from typegraph_next.policy import Policy -from typegraph_next.runtimes.random import RandomRuntime +from typegraph import t, typegraph +from typegraph.graph.typegraph import Graph +from typegraph.policy import Policy +from typegraph.runtimes.random import RandomRuntime rec = t.struct( { diff --git a/typegate/tests/rest/custom.py b/typegate/tests/rest/custom.py index 828a9a5353..d4a9ced3b1 100644 --- a/typegate/tests/rest/custom.py +++ b/typegate/tests/rest/custom.py @@ -1,5 +1,5 @@ -from typegraph_next import t, typegraph, Graph, Policy -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import t, typegraph, Graph, Policy +from typegraph.runtimes.deno import DenoRuntime @typegraph(dynamic=False, folder="custom_dir") diff --git a/typegate/tests/runtimes/deno/deno.py b/typegate/tests/runtimes/deno/deno.py index 30e7c84355..7a491f3732 100644 --- a/typegate/tests/runtimes/deno/deno.py +++ b/typegate/tests/runtimes/deno/deno.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, effects, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, effects, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/runtimes/deno/deno_dep.py b/typegate/tests/runtimes/deno/deno_dep.py index 1e7a3ff199..52cf7aa6c3 100644 --- a/typegate/tests/runtimes/deno/deno_dep.py +++ b/typegate/tests/runtimes/deno/deno_dep.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/runtimes/deno/deno_reload.py b/typegate/tests/runtimes/deno/deno_reload.py index 1377363d44..651ca0938a 100644 --- a/typegate/tests/runtimes/deno/deno_reload.py +++ b/typegate/tests/runtimes/deno/deno_reload.py @@ -1,7 +1,7 @@ import os -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/runtimes/graphql/typegraphs/python/graphql.py b/typegate/tests/runtimes/graphql/typegraphs/python/graphql.py index f19d627fa7..c06f31b6b3 100644 --- a/typegate/tests/runtimes/graphql/typegraphs/python/graphql.py +++ b/typegate/tests/runtimes/graphql/typegraphs/python/graphql.py @@ -1,5 +1,5 @@ -from typegraph_next import t, typegraph, effects, Policy, Graph -from typegraph_next.runtimes.graphql import GraphQLRuntime +from typegraph import t, typegraph, effects, Policy, Graph +from typegraph.runtimes.graphql import GraphQLRuntime user = t.struct( { diff --git a/typegate/tests/runtimes/http/http.py b/typegate/tests/runtimes/http/http.py index f2eedf7f0a..bc94d13f16 100644 --- a/typegate/tests/runtimes/http/http.py +++ b/typegate/tests/runtimes/http/http.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.http import HttpRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.http import HttpRuntime @typegraph() diff --git a/typegate/tests/runtimes/http/http_content_type.py b/typegate/tests/runtimes/http/http_content_type.py index b2681f8c9d..b014060b5b 100644 --- a/typegate/tests/runtimes/http/http_content_type.py +++ b/typegate/tests/runtimes/http/http_content_type.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.http import HttpRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.http import HttpRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/full_prisma_mapping.py b/typegate/tests/runtimes/prisma/full_prisma_mapping.py index 07eb39a72d..deda95e2bd 100644 --- a/typegate/tests/runtimes/prisma/full_prisma_mapping.py +++ b/typegate/tests/runtimes/prisma/full_prisma_mapping.py @@ -1,6 +1,6 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.gen.exports.runtimes import EffectUpdate -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.gen.exports.runtimes import EffectUpdate +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/mixed_runtime.py b/typegate/tests/runtimes/prisma/mixed_runtime.py index 641f295eda..9d7aa28041 100644 --- a/typegate/tests/runtimes/prisma/mixed_runtime.py +++ b/typegate/tests/runtimes/prisma/mixed_runtime.py @@ -1,7 +1,7 @@ -from typegraph_next import typegraph, t, Graph, Policy -from typegraph_next.providers.prisma import PrismaRuntime -from typegraph_next.runtimes.graphql import GraphQLRuntime -from typegraph_next.runtimes.random import RandomRuntime +from typegraph import typegraph, t, Graph, Policy +from typegraph.providers.prisma import PrismaRuntime +from typegraph.runtimes.graphql import GraphQLRuntime +from typegraph.runtimes.random import RandomRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/multi_relations.py b/typegate/tests/runtimes/prisma/multi_relations.py index f132bd49b8..d855c172bb 100644 --- a/typegate/tests/runtimes/prisma/multi_relations.py +++ b/typegate/tests/runtimes/prisma/multi_relations.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/multiple_runtimes.py b/typegate/tests/runtimes/prisma/multiple_runtimes.py index 9817af4cdc..8dc5a1f617 100644 --- a/typegate/tests/runtimes/prisma/multiple_runtimes.py +++ b/typegate/tests/runtimes/prisma/multiple_runtimes.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/normal_1_1.py b/typegate/tests/runtimes/prisma/normal_1_1.py index bca860381d..c62284673c 100644 --- a/typegate/tests/runtimes/prisma/normal_1_1.py +++ b/typegate/tests/runtimes/prisma/normal_1_1.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, t, Graph, Policy -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, t, Graph, Policy +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/optional_1_1.py b/typegate/tests/runtimes/prisma/optional_1_1.py index 456bba140f..31bcccae23 100644 --- a/typegate/tests/runtimes/prisma/optional_1_1.py +++ b/typegate/tests/runtimes/prisma/optional_1_1.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, t, Graph, Policy -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, t, Graph, Policy +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/optional_1_n.py b/typegate/tests/runtimes/prisma/optional_1_n.py index 63cec9a29e..87dfd10776 100644 --- a/typegate/tests/runtimes/prisma/optional_1_n.py +++ b/typegate/tests/runtimes/prisma/optional_1_n.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/prisma.py b/typegate/tests/runtimes/prisma/prisma.py index 67bba44fba..fdaa267d83 100644 --- a/typegate/tests/runtimes/prisma/prisma.py +++ b/typegate/tests/runtimes/prisma/prisma.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/prisma_edgecases.py b/typegate/tests/runtimes/prisma/prisma_edgecases.py index 549ee735b0..8e224ad312 100644 --- a/typegate/tests/runtimes/prisma/prisma_edgecases.py +++ b/typegate/tests/runtimes/prisma/prisma_edgecases.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/typegate/tests/runtimes/prisma/schema_generation.py b/typegate/tests/runtimes/prisma/schema_generation.py index 1acc3fea10..9cd03d170d 100644 --- a/typegate/tests/runtimes/prisma/schema_generation.py +++ b/typegate/tests/runtimes/prisma/schema_generation.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, t, Graph -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, t, Graph +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/typegate/tests/runtimes/python_wasi/python_wasi.py b/typegate/tests/runtimes/python_wasi/python_wasi.py index db3b580182..2714c36ec3 100644 --- a/typegate/tests/runtimes/python_wasi/python_wasi.py +++ b/typegate/tests/runtimes/python_wasi/python_wasi.py @@ -1,5 +1,5 @@ -from typegraph_next import Graph, Policy, t, typegraph -from typegraph_next.runtimes.python import PythonRuntime +from typegraph import Graph, Policy, t, typegraph +from typegraph.runtimes.python import PythonRuntime def test(x): diff --git a/typegate/tests/runtimes/s3/s3.py b/typegate/tests/runtimes/s3/s3.py index 428fe31cdd..68f8f2f97f 100644 --- a/typegate/tests/runtimes/s3/s3.py +++ b/typegate/tests/runtimes/s3/s3.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.providers.aws import S3Runtime +from typegraph import typegraph, Policy, t, Graph +from typegraph.providers.aws import S3Runtime @typegraph() diff --git a/typegate/tests/runtimes/temporal/temporal.py b/typegate/tests/runtimes/temporal/temporal.py index dc6aa3f0a6..e017ff47e4 100644 --- a/typegate/tests/runtimes/temporal/temporal.py +++ b/typegate/tests/runtimes/temporal/temporal.py @@ -1,5 +1,5 @@ -from typegraph_next import t, typegraph, Policy, Graph -from typegraph_next.providers.temporal import TemporalRuntime +from typegraph import t, typegraph, Policy, Graph +from typegraph.providers.temporal import TemporalRuntime @typegraph() diff --git a/typegate/tests/runtimes/wasmedge/rust/Cargo.toml b/typegate/tests/runtimes/wasmedge/rust/Cargo.toml index 98d0d45ffd..11656c4788 100644 --- a/typegate/tests/runtimes/wasmedge/rust/Cargo.toml +++ b/typegate/tests/runtimes/wasmedge/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust" -version = "0.2.0-alpha.1" +version = "0.2.0" edition = "2021" [lib] diff --git a/typegate/tests/runtimes/wasmedge/wasmedge.py b/typegate/tests/runtimes/wasmedge/wasmedge.py index 409c9abd0e..a27708395a 100644 --- a/typegate/tests/runtimes/wasmedge/wasmedge.py +++ b/typegate/tests/runtimes/wasmedge/wasmedge.py @@ -1,7 +1,7 @@ -from typegraph_next import t, typegraph -from typegraph_next.graph.typegraph import Graph -from typegraph_next.policy import Policy -from typegraph_next.runtimes.wasmedge import WasmEdgeRuntime +from typegraph import t, typegraph +from typegraph.graph.typegraph import Graph +from typegraph.policy import Policy +from typegraph.runtimes.wasmedge import WasmEdgeRuntime @typegraph() diff --git a/typegate/tests/schema_validation/circular.py b/typegate/tests/schema_validation/circular.py index 47654f0517..0a2fdeab34 100644 --- a/typegate/tests/schema_validation/circular.py +++ b/typegate/tests/schema_validation/circular.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/simple/class_syntax.py b/typegate/tests/simple/class_syntax.py index a573dd55d9..70e5b45d37 100644 --- a/typegate/tests/simple/class_syntax.py +++ b/typegate/tests/simple/class_syntax.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/simple/error_message.py b/typegate/tests/simple/error_message.py index 3006f9fc75..73c0e887b4 100644 --- a/typegate/tests/simple/error_message.py +++ b/typegate/tests/simple/error_message.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, effects, Policy, t, Graph -from typegraph_next.runtimes import DenoRuntime +from typegraph import typegraph, effects, Policy, t, Graph +from typegraph.runtimes import DenoRuntime @typegraph() diff --git a/typegate/tests/simple/simple.py b/typegate/tests/simple/simple.py index 411f6e2ef9..7458ad4712 100644 --- a/typegate/tests/simple/simple.py +++ b/typegate/tests/simple/simple.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/type_nodes/array_of_optional.py b/typegate/tests/type_nodes/array_of_optional.py index 8c0ec80d74..c361d0a87f 100644 --- a/typegate/tests/type_nodes/array_of_optional.py +++ b/typegate/tests/type_nodes/array_of_optional.py @@ -1,5 +1,5 @@ -from typegraph_next import Policy, t, typegraph, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import Policy, t, typegraph, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/type_nodes/either_node.py b/typegate/tests/type_nodes/either_node.py index a0e10b68cc..f05b71e3fc 100644 --- a/typegate/tests/type_nodes/either_node.py +++ b/typegate/tests/type_nodes/either_node.py @@ -1,5 +1,5 @@ -from typegraph_next import Policy, t, typegraph, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import Policy, t, typegraph, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/type_nodes/union_node.py b/typegate/tests/type_nodes/union_node.py index 354ce50d2f..c261209b0c 100644 --- a/typegate/tests/type_nodes/union_node.py +++ b/typegate/tests/type_nodes/union_node.py @@ -1,5 +1,5 @@ -from typegraph_next import Policy, t, typegraph, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import Policy, t, typegraph, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/type_nodes/union_node_attr.py b/typegate/tests/type_nodes/union_node_attr.py index 0433313ea3..12c40e1771 100644 --- a/typegate/tests/type_nodes/union_node_attr.py +++ b/typegate/tests/type_nodes/union_node_attr.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/type_nodes/union_node_quantifier.py b/typegate/tests/type_nodes/union_node_quantifier.py index ee61512296..ac9699973b 100644 --- a/typegate/tests/type_nodes/union_node_quantifier.py +++ b/typegate/tests/type_nodes/union_node_quantifier.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/typecheck/apply.py b/typegate/tests/typecheck/apply.py index d164022c22..150b913ccf 100644 --- a/typegate/tests/typecheck/apply.py +++ b/typegate/tests/typecheck/apply.py @@ -1,5 +1,5 @@ -from typegraph_next import t, typegraph, Policy, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import t, typegraph, Policy, Graph +from typegraph.runtimes.deno import DenoRuntime simple_tpe = t.struct( { diff --git a/typegate/tests/typecheck/type_alias.py b/typegate/tests/typecheck/type_alias.py index f6ef880bc2..c451a2e2de 100644 --- a/typegate/tests/typecheck/type_alias.py +++ b/typegate/tests/typecheck/type_alias.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.random import RandomRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.random import RandomRuntime @typegraph() diff --git a/typegate/tests/typecheck/typecheck.py b/typegate/tests/typecheck/typecheck.py index b64a67dc29..a2c74d54bd 100644 --- a/typegate/tests/typecheck/typecheck.py +++ b/typegate/tests/typecheck/typecheck.py @@ -1,7 +1,7 @@ # Copyright Metatype under the Elastic License 2.0. -from typegraph_next import typegraph, effects, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, effects, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegate/tests/typename/typename.py b/typegate/tests/typename/typename.py index 76c5e0d5ab..17bc6938cf 100644 --- a/typegate/tests/typename/typename.py +++ b/typegate/tests/typename/typename.py @@ -1,7 +1,7 @@ -from typegraph_next import Graph, Policy, effects, t, typegraph -from typegraph_next.providers.prisma import PrismaRuntime -from typegraph_next.runtimes.deno import DenoRuntime -from typegraph_next.runtimes.random import RandomRuntime +from typegraph import Graph, Policy, effects, t, typegraph +from typegraph.providers.prisma import PrismaRuntime +from typegraph.runtimes.deno import DenoRuntime +from typegraph.runtimes.random import RandomRuntime @typegraph() diff --git a/typegate/tests/vars/vars.py b/typegate/tests/vars/vars.py index 26a2f16fb8..1e020c85d7 100644 --- a/typegate/tests/vars/vars.py +++ b/typegate/tests/vars/vars.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/typegraph/core/Cargo.toml b/typegraph/core/Cargo.toml index e9d4c8ce96..487c9c54a9 100644 --- a/typegraph/core/Cargo.toml +++ b/typegraph/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "typegraph_core" -version = "0.2.0-alpha.1" +version = "0.2.0" edition = "2021" [lib] diff --git a/typegraph/python_next/LICENSE.md b/typegraph/python/LICENSE.md similarity index 100% rename from typegraph/python_next/LICENSE.md rename to typegraph/python/LICENSE.md diff --git a/typegraph/python_next/poetry.lock b/typegraph/python/poetry.lock similarity index 100% rename from typegraph/python_next/poetry.lock rename to typegraph/python/poetry.lock diff --git a/typegraph/python_next/pyproject.toml b/typegraph/python/pyproject.toml similarity index 82% rename from typegraph/python_next/pyproject.toml rename to typegraph/python/pyproject.toml index 506adf3fc9..77053da35a 100644 --- a/typegraph/python_next/pyproject.toml +++ b/typegraph/python/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] -name = "typegraph_next" -version = "0.2.0-alpha.1" +name = "typegraph" +version = "0.2.0" description = "Declarative API development platform. Build serverless backends with zero-trust and less code, no matter where and how your (legacy) systems are." authors = ["Metatype Contributors "] license = "MPL-2.0" homepage = "https://metatype.dev" repository = "https://github.com/metatypedev/metatype" -include = ["typegraph_next/**/*", "LICENSE.md"] +include = ["typegraph/**/*", "LICENSE.md"] keywords = ["api", "composition", "typesystem", "graphql", "ecosystem"] classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", @@ -19,7 +19,3 @@ wasmtime = "^10.0.1" typing-extensions = "^4.7.1" python-box = "^7.1.1" astunparse = "^1.6.3" - -[tool.pyright] -venvPath = "." -venv = ".venv" diff --git a/typegraph/python/typegraph/__init__.py b/typegraph/python/typegraph/__init__.py new file mode 100644 index 0000000000..ae12898c99 --- /dev/null +++ b/typegraph/python/typegraph/__init__.py @@ -0,0 +1,8 @@ +# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. +# SPDX-License-Identifier: MPL-2.0 + +from typegraph.graph.typegraph import typegraph, Graph # noqa +from typegraph.policy import Policy # noqa +from typegraph import effects as fx # noqa + +version = "0.2.0" diff --git a/typegraph/python_next/typegraph_next/effects.py b/typegraph/python/typegraph/effects.py similarity index 93% rename from typegraph/python_next/typegraph_next/effects.py rename to typegraph/python/typegraph/effects.py index 72181e72c5..002b7f2e40 100644 --- a/typegraph/python_next/typegraph_next/effects.py +++ b/typegraph/python/typegraph/effects.py @@ -1,7 +1,7 @@ # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. # SPDX-License-Identifier: MPL-2.0 -from typegraph_next.gen.exports.runtimes import ( +from typegraph.gen.exports.runtimes import ( EffectCreate, EffectDelete, EffectNone, diff --git a/typegraph/python_next/typegraph_next/g.py b/typegraph/python/typegraph/g.py similarity index 70% rename from typegraph/python_next/typegraph_next/g.py rename to typegraph/python/typegraph/g.py index b723d80382..a75f701d3e 100644 --- a/typegraph/python_next/typegraph_next/g.py +++ b/typegraph/python/typegraph/g.py @@ -1,4 +1,4 @@ # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. # SPDX-License-Identifier: MPL-2.0 -from typegraph_next.policy import Policy # noqa +from typegraph.policy import Policy # noqa diff --git a/typegraph/python_next/typegraph_next/graph/params.py b/typegraph/python/typegraph/graph/params.py similarity index 99% rename from typegraph/python_next/typegraph_next/graph/params.py rename to typegraph/python/typegraph/graph/params.py index 1d1764264f..00db1abb19 100644 --- a/typegraph/python_next/typegraph_next/graph/params.py +++ b/typegraph/python/typegraph/graph/params.py @@ -4,7 +4,7 @@ from dataclasses import dataclass import json from typing import List, Optional -from typegraph_next.gen.exports import core +from typegraph.gen.exports import core from box import Box diff --git a/typegraph/python_next/typegraph_next/graph/typegraph.py b/typegraph/python/typegraph/graph/typegraph.py similarity index 91% rename from typegraph/python_next/typegraph_next/graph/typegraph.py rename to typegraph/python/typegraph/graph/typegraph.py index 98d486e524..fe59e20c0a 100644 --- a/typegraph/python_next/typegraph_next/graph/typegraph.py +++ b/typegraph/python/typegraph/graph/typegraph.py @@ -6,20 +6,20 @@ from pathlib import Path from typing import TYPE_CHECKING, Callable, List, Optional, Union -from typegraph_next.gen.exports.core import ( +from typegraph.gen.exports.core import ( Auth, Rate, Cors as CoreCors, TypegraphInitParams, ) -from typegraph_next.gen.types import Err -from typegraph_next.policy import PolicyPerEffect, PolicySpec, get_policy_chain, Policy -from typegraph_next.wit import core, store -from typegraph_next.graph.params import Cors +from typegraph.gen.types import Err +from typegraph.policy import PolicyPerEffect, PolicySpec, get_policy_chain, Policy +from typegraph.wit import core, store +from typegraph.graph.params import Cors if TYPE_CHECKING: - from typegraph_next import t + from typegraph import t typegraph_version = "0.0.2" @@ -102,7 +102,7 @@ def expose( self.typegraph.expose(default_policy, **kwargs) def inherit(self): - from typegraph_next.injection import InheritDef + from typegraph.injection import InheritDef return InheritDef() diff --git a/typegraph/python_next/typegraph_next/imports.py b/typegraph/python/typegraph/imports.py similarity index 91% rename from typegraph/python_next/typegraph_next/imports.py rename to typegraph/python/typegraph/imports.py index 7eb6b9b2f2..7c806df85f 100644 --- a/typegraph/python_next/typegraph_next/imports.py +++ b/typegraph/python/typegraph/imports.py @@ -5,8 +5,8 @@ from typing import List import sys -from typegraph_next.gen import imports -from typegraph_next.gen.types import Err, Ok, Result +from typegraph.gen import imports +from typegraph.gen.types import Err, Ok, Result class Abi(imports.Abi): diff --git a/typegraph/python_next/typegraph_next/injection.py b/typegraph/python/typegraph/injection.py similarity index 97% rename from typegraph/python_next/typegraph_next/injection.py rename to typegraph/python/typegraph/injection.py index a78011527f..58ce01f576 100644 --- a/typegraph/python_next/typegraph_next/injection.py +++ b/typegraph/python/typegraph/injection.py @@ -3,8 +3,8 @@ import json from typing import Callable, Dict, Union -from typegraph_next.effects import EffectType -from typegraph_next import t +from typegraph.effects import EffectType +from typegraph import t def serialize_injection( diff --git a/typegraph/python_next/typegraph_next/policy.py b/typegraph/python/typegraph/policy.py similarity index 92% rename from typegraph/python_next/typegraph_next/policy.py rename to typegraph/python/typegraph/policy.py index 99a71e4d32..5be56240e2 100644 --- a/typegraph/python_next/typegraph_next/policy.py +++ b/typegraph/python/typegraph/policy.py @@ -5,21 +5,21 @@ from re import Pattern from typing import Optional, Union, List -from typegraph_next.gen.exports.core import ( +from typegraph.gen.exports.core import ( ContextCheckPattern, ContextCheckValue, Err, MaterializerId, PolicySpecPerEffect, ) -from typegraph_next.gen.exports.core import ( +from typegraph.gen.exports.core import ( Policy as WitPolicy, PolicySpec as WitPolicySpec, PolicySpecSimple, PolicyPerEffect as WitPolicyPerEffect, ) -from typegraph_next.gen.exports.runtimes import MaterializerDenoPredefined -from typegraph_next.wit import core, runtimes, store +from typegraph.gen.exports.runtimes import MaterializerDenoPredefined +from typegraph.wit import core, runtimes, store class Policy: @@ -65,7 +65,7 @@ def context(cls, key: str, check: Union[str, Pattern]) -> "Policy": # TODO implement in Rust for the Guest wasm @classmethod def internal(cls) -> "Policy": - from typegraph_next.runtimes.deno import DenoRuntime + from typegraph.runtimes.deno import DenoRuntime return DenoRuntime().policy( "__internal", "(_, { context }) => context.provider === 'internal'" diff --git a/typegraph/python/typegraph/providers/__init__.py b/typegraph/python/typegraph/providers/__init__.py new file mode 100644 index 0000000000..0418edacca --- /dev/null +++ b/typegraph/python/typegraph/providers/__init__.py @@ -0,0 +1,6 @@ +# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. +# SPDX-License-Identifier: MPL-2.0 + +from typegraph.providers.aws import S3Runtime # noqa +from typegraph.providers.prisma import PrismaRuntime # noqa +from typegraph.providers.temporal import TemporalRuntime # noqa diff --git a/typegraph/python_next/typegraph_next/providers/aws.py b/typegraph/python/typegraph/providers/aws.py similarity index 93% rename from typegraph/python_next/typegraph_next/providers/aws.py rename to typegraph/python/typegraph/providers/aws.py index fa2aade6d7..641aa7ed1c 100644 --- a/typegraph/python_next/typegraph_next/providers/aws.py +++ b/typegraph/python/typegraph/providers/aws.py @@ -2,18 +2,18 @@ # SPDX-License-Identifier: MPL-2.0 from dataclasses import dataclass -from typegraph_next.runtimes.base import Materializer -from typegraph_next.runtimes.base import Runtime -from typegraph_next.wit import aws, store -from typegraph_next.gen.exports.aws import ( +from typegraph.runtimes.base import Materializer +from typegraph.runtimes.base import Runtime +from typegraph.wit import aws, store +from typegraph.gen.exports.aws import ( S3RuntimeData, S3PresignGetParams, S3PresignPutParams, ) -from typegraph_next.gen.exports.runtimes import EffectNone, EffectCreate -from typegraph_next.gen.types import Err +from typegraph.gen.exports.runtimes import EffectNone, EffectCreate +from typegraph.gen.types import Err from typing import Optional -from typegraph_next import t +from typegraph import t class S3Runtime(Runtime): diff --git a/typegraph/python_next/typegraph_next/providers/prisma.py b/typegraph/python/typegraph/providers/prisma.py similarity index 96% rename from typegraph/python_next/typegraph_next/providers/prisma.py rename to typegraph/python/typegraph/providers/prisma.py index 11f7d5032e..9efc14376c 100644 --- a/typegraph/python_next/typegraph_next/providers/prisma.py +++ b/typegraph/python/typegraph/providers/prisma.py @@ -3,15 +3,15 @@ from typing import Union, Optional -from typegraph_next.runtimes.base import Runtime -from typegraph_next.wit import runtimes, store -from typegraph_next.gen.types import Err -from typegraph_next.gen.exports.runtimes import ( +from typegraph.runtimes.base import Runtime +from typegraph.wit import runtimes, store +from typegraph.gen.types import Err +from typegraph.gen.exports.runtimes import ( Effect, PrismaRuntimeData, PrismaLinkData, ) -from typegraph_next import t +from typegraph import t class PrismaRuntime(Runtime): diff --git a/typegraph/python_next/typegraph_next/providers/temporal.py b/typegraph/python/typegraph/providers/temporal.py similarity index 90% rename from typegraph/python_next/typegraph_next/providers/temporal.py rename to typegraph/python/typegraph/providers/temporal.py index c3a77e71c2..2bba165222 100644 --- a/typegraph/python_next/typegraph_next/providers/temporal.py +++ b/typegraph/python/typegraph/providers/temporal.py @@ -3,9 +3,9 @@ from typing import Union -from typegraph_next.runtimes.base import Runtime +from typegraph.runtimes.base import Runtime -from typegraph_next.gen.exports.runtimes import ( +from typegraph.gen.exports.runtimes import ( TemporalOperationData, TemporalRuntimeData, TemporalOperationType, @@ -14,10 +14,10 @@ TemporalOperationTypeQueryWorkflow, TemporalOperationTypeDescribeWorkflow, ) -from typegraph_next.gen.types import Err -from typegraph_next.wit import runtimes, store +from typegraph.gen.types import Err +from typegraph.wit import runtimes, store -from typegraph_next import t +from typegraph import t class TemporalRuntime(Runtime): diff --git a/typegraph/python/typegraph/runtimes/__init__.py b/typegraph/python/typegraph/runtimes/__init__.py new file mode 100644 index 0000000000..9962e5effe --- /dev/null +++ b/typegraph/python/typegraph/runtimes/__init__.py @@ -0,0 +1,10 @@ +# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. +# SPDX-License-Identifier: MPL-2.0 + +from typegraph.runtimes.deno import DenoRuntime # noqa +from typegraph.runtimes.graphql import GraphQLRuntime # noqa +from typegraph.runtimes.random import RandomRuntime # noqa +from typegraph.runtimes.http import HttpRuntime # noqa +from typegraph.runtimes.python import PythonRuntime # noqa +from typegraph.runtimes.random import RandomRuntime # noqa +from typegraph.runtimes.wasmedge import WasmEdgeRuntime # noqa diff --git a/typegraph/python_next/typegraph_next/runtimes/base.py b/typegraph/python/typegraph/runtimes/base.py similarity index 68% rename from typegraph/python_next/typegraph_next/runtimes/base.py rename to typegraph/python/typegraph/runtimes/base.py index 5360c79e31..f04afc931a 100644 --- a/typegraph/python_next/typegraph_next/runtimes/base.py +++ b/typegraph/python/typegraph/runtimes/base.py @@ -3,8 +3,8 @@ from dataclasses import dataclass -from typegraph_next.gen.exports.core import MaterializerId, RuntimeId -from typegraph_next.gen.exports.runtimes import Effect +from typegraph.gen.exports.core import MaterializerId, RuntimeId +from typegraph.gen.exports.runtimes import Effect @dataclass diff --git a/typegraph/python_next/typegraph_next/runtimes/deno.py b/typegraph/python/typegraph/runtimes/deno.py similarity index 90% rename from typegraph/python_next/typegraph_next/runtimes/deno.py rename to typegraph/python/typegraph/runtimes/deno.py index 20fdeb3cc1..b79976cac1 100644 --- a/typegraph/python_next/typegraph_next/runtimes/deno.py +++ b/typegraph/python/typegraph/runtimes/deno.py @@ -6,9 +6,9 @@ from typing import TYPE_CHECKING, List, Optional, Any import json -from typegraph_next.runtimes.base import Materializer, Runtime +from typegraph.runtimes.base import Materializer, Runtime -from typegraph_next.gen.exports.runtimes import ( +from typegraph.gen.exports.runtimes import ( Effect, EffectNone, MaterializerDenoFunc, @@ -16,12 +16,12 @@ MaterializerDenoPredefined, MaterializerDenoStatic, ) -from typegraph_next.gen.types import Err -from typegraph_next.policy import Policy -from typegraph_next.wit import runtimes, store +from typegraph.gen.types import Err +from typegraph.policy import Policy +from typegraph.wit import runtimes, store if TYPE_CHECKING: - from typegraph_next import t + from typegraph import t class DenoRuntime(Runtime): @@ -29,7 +29,7 @@ def __init__(self): super().__init__(runtimes.get_deno_runtime(store)) def static(self, out: "t.typedef", value: Any): - from typegraph_next import t + from typegraph import t mat_id = runtimes.register_deno_static( store, MaterializerDenoStatic(json.dumps(value)), out.id @@ -68,7 +68,7 @@ def func( if isinstance(mat_id, Err): raise Exception(mat_id.value) - from typegraph_next import t + from typegraph import t return t.func( inp, out, FunMat(mat_id.value, code=code, secrets=secrets, effect=effect) @@ -95,7 +95,7 @@ def import_( if isinstance(mat_id, Err): raise Exception(mat_id.value) - from typegraph_next import t + from typegraph import t return t.func( inp, @@ -110,7 +110,7 @@ def import_( ) def identity(self, inp: "t.struct") -> "t.func": - from typegraph_next import t + from typegraph import t res = runtimes.get_predefined_deno_func( store, MaterializerDenoPredefined(name="identity") diff --git a/typegraph/python_next/typegraph_next/runtimes/graphql.py b/typegraph/python/typegraph/runtimes/graphql.py similarity index 88% rename from typegraph/python_next/typegraph_next/runtimes/graphql.py rename to typegraph/python/typegraph/runtimes/graphql.py index def677abfc..6aacf06897 100644 --- a/typegraph/python_next/typegraph_next/runtimes/graphql.py +++ b/typegraph/python/typegraph/runtimes/graphql.py @@ -4,17 +4,17 @@ from typing import List, Optional from dataclasses import dataclass -from typegraph_next.runtimes.base import Materializer, Runtime -from typegraph_next.gen.types import Err -from typegraph_next.gen.exports.runtimes import ( +from typegraph.runtimes.base import Materializer, Runtime +from typegraph.gen.types import Err +from typegraph.gen.exports.runtimes import ( BaseMaterializer, Effect, EffectNone, GraphqlRuntimeData, MaterializerGraphqlQuery, ) -from typegraph_next.wit import runtimes, store -from typegraph_next import t +from typegraph.wit import runtimes, store +from typegraph import t @dataclass diff --git a/typegraph/python_next/typegraph_next/runtimes/http.py b/typegraph/python/typegraph/runtimes/http.py similarity index 95% rename from typegraph/python_next/typegraph_next/runtimes/http.py rename to typegraph/python/typegraph/runtimes/http.py index d5574dbbde..8aa0051c0a 100644 --- a/typegraph/python_next/typegraph_next/runtimes/http.py +++ b/typegraph/python/typegraph/runtimes/http.py @@ -4,17 +4,17 @@ from dataclasses import dataclass from typing import Dict, List, Optional from typing_extensions import TypedDict -from typegraph_next.gen.exports.runtimes import ( +from typegraph.gen.exports.runtimes import ( Effect, BaseMaterializer, HttpMethod, HttpRuntimeData, MaterializerHttpRequest, ) -from typegraph_next.gen.types import Err -from typegraph_next.wit import runtimes, store -from typegraph_next.runtimes.base import Materializer, Runtime -from typegraph_next import t, fx +from typegraph.gen.types import Err +from typegraph.wit import runtimes, store +from typegraph.runtimes.base import Materializer, Runtime +from typegraph import t, fx class HttpRequestKwargs(TypedDict): diff --git a/typegraph/python_next/typegraph_next/runtimes/python.py b/typegraph/python/typegraph/runtimes/python.py similarity index 92% rename from typegraph/python_next/typegraph_next/runtimes/python.py rename to typegraph/python/typegraph/runtimes/python.py index 293ff410df..c821154e33 100644 --- a/typegraph/python_next/typegraph_next/runtimes/python.py +++ b/typegraph/python/typegraph/runtimes/python.py @@ -7,9 +7,9 @@ from dataclasses import dataclass from typing import TYPE_CHECKING, List, Optional -from typegraph_next.runtimes.base import Materializer, Runtime +from typegraph.runtimes.base import Materializer, Runtime -from typegraph_next.gen.exports.runtimes import ( +from typegraph.gen.exports.runtimes import ( Effect, EffectNone, BaseMaterializer, @@ -18,11 +18,11 @@ MaterializerPythonDef, MaterializerPythonModule, ) -from typegraph_next.gen.types import Err -from typegraph_next.wit import runtimes, store +from typegraph.gen.types import Err +from typegraph.wit import runtimes, store if TYPE_CHECKING: - from typegraph_next import t + from typegraph import t class PythonRuntime(Runtime): @@ -50,7 +50,7 @@ def from_lambda( if isinstance(mat_id, Err): raise Exception(mat_id.value) - from typegraph_next import t + from typegraph import t return t.func( inp, @@ -79,7 +79,7 @@ def from_def( if isinstance(mat_id, Err): raise Exception(mat_id.value) - from typegraph_next import t + from typegraph import t return t.func( inp, @@ -119,7 +119,7 @@ def import_( if isinstance(py_mod_mat_id, Err): raise Exception(py_mod_mat_id.value) - from typegraph_next import t + from typegraph import t return t.func( inp, diff --git a/typegraph/python_next/typegraph_next/runtimes/random.py b/typegraph/python/typegraph/runtimes/random.py similarity index 83% rename from typegraph/python_next/typegraph_next/runtimes/random.py rename to typegraph/python/typegraph/runtimes/random.py index 4305dddabb..1bb53fcb5c 100644 --- a/typegraph/python_next/typegraph_next/runtimes/random.py +++ b/typegraph/python/typegraph/runtimes/random.py @@ -3,16 +3,16 @@ from dataclasses import dataclass from typing import Optional -from typegraph_next import t -from typegraph_next.gen.exports.runtimes import ( +from typegraph import t +from typegraph.gen.exports.runtimes import ( BaseMaterializer, EffectNone, MaterializerRandom, RandomRuntimeData, ) -from typegraph_next.gen.types import Err -from typegraph_next.runtimes.base import Materializer, Runtime -from typegraph_next.wit import runtimes, store +from typegraph.gen.types import Err +from typegraph.runtimes.base import Materializer, Runtime +from typegraph.wit import runtimes, store class RandomRuntime(Runtime): diff --git a/typegraph/python_next/typegraph_next/runtimes/wasmedge.py b/typegraph/python/typegraph/runtimes/wasmedge.py similarity index 83% rename from typegraph/python_next/typegraph_next/runtimes/wasmedge.py rename to typegraph/python/typegraph/runtimes/wasmedge.py index 5cc0999208..434b7fdbda 100644 --- a/typegraph/python_next/typegraph_next/runtimes/wasmedge.py +++ b/typegraph/python/typegraph/runtimes/wasmedge.py @@ -3,18 +3,18 @@ from dataclasses import dataclass from typing import List, Optional -from typegraph_next.runtimes.base import Materializer, Runtime +from typegraph.runtimes.base import Materializer, Runtime -from typegraph_next.gen.exports.runtimes import ( +from typegraph.gen.exports.runtimes import ( Effect, EffectNone, BaseMaterializer, MaterializerWasi, ) -from typegraph_next.gen.types import Err -from typegraph_next.wit import runtimes, store +from typegraph.gen.types import Err +from typegraph.wit import runtimes, store -from typegraph_next import t +from typegraph import t class WasmEdgeRuntime(Runtime): diff --git a/typegraph/python_next/typegraph_next/t.py b/typegraph/python/typegraph/t.py similarity index 97% rename from typegraph/python_next/typegraph_next/t.py rename to typegraph/python/typegraph/t.py index a0d9718f83..c5f0ac7c16 100644 --- a/typegraph/python_next/typegraph_next/t.py +++ b/typegraph/python/typegraph/t.py @@ -6,8 +6,8 @@ from typing_extensions import Self -from typegraph_next.effects import EffectType -from typegraph_next.gen.exports.core import ( +from typegraph.effects import EffectType +from typegraph.gen.exports.core import ( FuncParams, TypeArray, TypeBase, @@ -25,23 +25,23 @@ TypeUnion, TypeWithInjection, ) -from typegraph_next.gen.exports.runtimes import EffectNone -from typegraph_next.gen.exports.utils import Apply -from typegraph_next.gen.types import Err -from typegraph_next.graph.typegraph import core, store -from typegraph_next.injection import ( +from typegraph.gen.exports.runtimes import EffectNone +from typegraph.gen.exports.utils import Apply +from typegraph.gen.types import Err +from typegraph.graph.typegraph import core, store +from typegraph.injection import ( serialize_generic_injection, serialize_parent_injection, serialize_static_injection, ) -from typegraph_next.policy import Policy, PolicyPerEffect, PolicySpec, get_policy_chain -from typegraph_next.runtimes.deno import Materializer -from typegraph_next.utils import ( +from typegraph.policy import Policy, PolicyPerEffect, PolicySpec, get_policy_chain +from typegraph.runtimes.deno import Materializer +from typegraph.utils import ( build_apply_data, ConfigSpec, serialize_config, ) -from typegraph_next.wit import wit_utils +from typegraph.wit import wit_utils class typedef: diff --git a/typegraph/python_next/typegraph_next/utils.py b/typegraph/python/typegraph/utils.py similarity index 92% rename from typegraph/python_next/typegraph_next/utils.py rename to typegraph/python/typegraph/utils.py index cb57852110..dafe74a0c7 100644 --- a/typegraph/python_next/typegraph_next/utils.py +++ b/typegraph/python/typegraph/utils.py @@ -4,9 +4,9 @@ import json from functools import reduce from typing import Dict, List, Union, Tuple, Optional, Any -from typegraph_next.injection import InheritDef -from typegraph_next.gen.exports.utils import ApplyPath, ApplyValue -from typegraph_next.injection import serialize_static_injection +from typegraph.injection import InheritDef +from typegraph.gen.exports.utils import ApplyPath, ApplyValue +from typegraph.injection import serialize_static_injection # def serialize_record_values(obj: Union[Dict[str, any], None]): diff --git a/typegraph/python_next/typegraph_next/wit.py b/typegraph/python/typegraph/wit.py similarity index 54% rename from typegraph/python_next/typegraph_next/wit.py rename to typegraph/python/typegraph/wit.py index a0c7c94440..5e11794323 100644 --- a/typegraph/python_next/typegraph_next/wit.py +++ b/typegraph/python/typegraph/wit.py @@ -3,12 +3,12 @@ from wasmtime import Store -from typegraph_next.gen import Root, RootImports -from typegraph_next.gen.exports.core import Core -from typegraph_next.gen.exports.runtimes import Runtimes -from typegraph_next.gen.exports.utils import Utils -from typegraph_next.gen.exports.aws import Aws -from typegraph_next.imports import Abi +from typegraph.gen import Root, RootImports +from typegraph.gen.exports.core import Core +from typegraph.gen.exports.runtimes import Runtimes +from typegraph.gen.exports.utils import Utils +from typegraph.gen.exports.aws import Aws +from typegraph.imports import Abi store = Store() abi = Abi() diff --git a/typegraph/python_next/typegraph_next/__init__.py b/typegraph/python_next/typegraph_next/__init__.py deleted file mode 100644 index f08952b584..0000000000 --- a/typegraph/python_next/typegraph_next/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. -# SPDX-License-Identifier: MPL-2.0 - -from typegraph_next.graph.typegraph import typegraph, Graph # noqa -from typegraph_next.policy import Policy # noqa -from typegraph_next import effects as fx # noqa - -version = "0.2.0-alpha.1" diff --git a/typegraph/python_next/typegraph_next/providers/__init__.py b/typegraph/python_next/typegraph_next/providers/__init__.py deleted file mode 100644 index a6bd33ed74..0000000000 --- a/typegraph/python_next/typegraph_next/providers/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. -# SPDX-License-Identifier: MPL-2.0 - -from typegraph_next.providers.aws import S3Runtime # noqa -from typegraph_next.providers.prisma import PrismaRuntime # noqa -from typegraph_next.providers.temporal import TemporalRuntime # noqa diff --git a/typegraph/python_next/typegraph_next/runtimes/__init__.py b/typegraph/python_next/typegraph_next/runtimes/__init__.py deleted file mode 100644 index 3d44db1741..0000000000 --- a/typegraph/python_next/typegraph_next/runtimes/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. -# SPDX-License-Identifier: MPL-2.0 - -from typegraph_next.runtimes.deno import DenoRuntime # noqa -from typegraph_next.runtimes.graphql import GraphQLRuntime # noqa -from typegraph_next.runtimes.random import RandomRuntime # noqa -from typegraph_next.runtimes.http import HttpRuntime # noqa -from typegraph_next.runtimes.python import PythonRuntime # noqa -from typegraph_next.runtimes.random import RandomRuntime # noqa -from typegraph_next.runtimes.wasmedge import WasmEdgeRuntime # noqa diff --git a/website/docs/guides/authentication/basic.py b/website/docs/guides/authentication/basic.py index cb9911be3d..3c11d073d0 100644 --- a/website/docs/guides/authentication/basic.py +++ b/website/docs/guides/authentication/basic.py @@ -1,7 +1,7 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Auth, Cors -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Auth, Cors +from typegraph.runtimes.deno import DenoRuntime # skip:end diff --git a/website/docs/guides/authentication/jwt.py b/website/docs/guides/authentication/jwt.py index 4bd04a8b27..937737d252 100644 --- a/website/docs/guides/authentication/jwt.py +++ b/website/docs/guides/authentication/jwt.py @@ -1,7 +1,7 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Auth, Cors -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Auth, Cors +from typegraph.runtimes.deno import DenoRuntime # skip:end diff --git a/website/docs/guides/authentication/oauth2.py b/website/docs/guides/authentication/oauth2.py index 08a0375ceb..5109a6a5f1 100644 --- a/website/docs/guides/authentication/oauth2.py +++ b/website/docs/guides/authentication/oauth2.py @@ -1,7 +1,7 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Auth, Cors -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Auth, Cors +from typegraph.runtimes.deno import DenoRuntime # skip:end diff --git a/website/docs/guides/crud-with-prisma/prisma_blog.py b/website/docs/guides/crud-with-prisma/prisma_blog.py index 983548b58b..79d795ea79 100644 --- a/website/docs/guides/crud-with-prisma/prisma_blog.py +++ b/website/docs/guides/crud-with-prisma/prisma_blog.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.providers.prisma import PrismaRuntime @typegraph() diff --git a/website/docs/guides/external-functions/math.py b/website/docs/guides/external-functions/math.py index ebfb61e846..5e1c9af98d 100644 --- a/website/docs/guides/external-functions/math.py +++ b/website/docs/guides/external-functions/math.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.runtimes.deno import DenoRuntime @typegraph() diff --git a/website/docs/guides/files-upload/t.py b/website/docs/guides/files-upload/t.py index e9e36d197f..44858682b6 100644 --- a/website/docs/guides/files-upload/t.py +++ b/website/docs/guides/files-upload/t.py @@ -1,5 +1,5 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.providers.aws import S3Runtime +from typegraph import typegraph, Policy, t, Graph +from typegraph.providers.aws import S3Runtime @typegraph() diff --git a/website/docs/reference/changelog.mdx b/website/docs/reference/changelog.mdx index 128d70f3f8..1b553bf8a5 100644 --- a/website/docs/reference/changelog.mdx +++ b/website/docs/reference/changelog.mdx @@ -33,7 +33,7 @@ comments: false **Full Changelog**: [v0.1.12...v0.1.14](https://github.com/metatypedev/metatype/compare/v0.1.12...v0.1.14) -## [v0.1.12](https://github.com/metatypedev/metatype/releases/tag/v0.1.12) (8/4/2023) +## [v0.1.12](https://github.com/metatypedev/metatype/releases/tag/v0.1.12) (8/3/2023) @@ -315,7 +315,7 @@ comments: false **Full Changelog**: [v0.0.3-dev.5...v0.0.3-dev.6](https://github.com/metatypedev/metatype/compare/v0.0.3-dev.5...v0.0.3-dev.6) -## [v0.0.3-dev.5](https://github.com/metatypedev/metatype/releases/tag/v0.0.3-dev.5) (2/25/2023) +## [v0.0.3-dev.5](https://github.com/metatypedev/metatype/releases/tag/v0.0.3-dev.5) (2/24/2023) @@ -386,7 +386,7 @@ comments: false **Full Changelog**: [v0.0.3-dev.2...v0.0.3-dev.3](https://github.com/metatypedev/metatype/compare/v0.0.3-dev.2...v0.0.3-dev.3) -## [v0.0.3-dev.2](https://github.com/metatypedev/metatype/releases/tag/v0.0.3-dev.2) (2/8/2023) +## [v0.0.3-dev.2](https://github.com/metatypedev/metatype/releases/tag/v0.0.3-dev.2) (2/7/2023) diff --git a/website/docs/reference/typegraph/python/pydoc.json b/website/docs/reference/typegraph/python/pydoc.json index 1dd9f9fc0f..4d5198e97a 100644 --- a/website/docs/reference/typegraph/python/pydoc.json +++ b/website/docs/reference/typegraph/python/pydoc.json @@ -1,5 +1,13 @@ { - "items": [], - "label": null, + "items": [ + { + "items": [ + "docs/reference/typegraph/python/typegraph/graph/params" + ], + "label": "typegraph.graph", + "type": "category" + } + ], + "label": "typegraph", "type": "category" } \ No newline at end of file diff --git a/website/docs/reference/typegraph/python/typegraph/graph/params.md b/website/docs/reference/typegraph/python/typegraph/graph/params.md new file mode 100644 index 0000000000..94a68aae16 --- /dev/null +++ b/website/docs/reference/typegraph/python/typegraph/graph/params.md @@ -0,0 +1,19 @@ +--- +sidebar_label: params +title: typegraph.graph.params +--- + +## Auth Objects + +```python +class Auth() +``` + +#### jwt + +```python +def jwt(name: str, format: str, algorithm: None) -> "core.Auth" +``` + +[Documentation](http://localhost:3000/docs/guides/authentication#jwt-authentication) + diff --git a/website/docs/tutorials/adding-more-runtimes/database.py b/website/docs/tutorials/adding-more-runtimes/database.py index 9b672b1a27..a5a26c3f97 100644 --- a/website/docs/tutorials/adding-more-runtimes/database.py +++ b/website/docs/tutorials/adding-more-runtimes/database.py @@ -1,11 +1,11 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors # isort: off # skip:end # highlight-next-line -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph.providers.prisma import PrismaRuntime @typegraph( diff --git a/website/docs/tutorials/adding-more-runtimes/graphql.py b/website/docs/tutorials/adding-more-runtimes/graphql.py index c5d99ecc22..6eb6fa2c4c 100644 --- a/website/docs/tutorials/adding-more-runtimes/graphql.py +++ b/website/docs/tutorials/adding-more-runtimes/graphql.py @@ -1,12 +1,12 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors +from typegraph.providers.prisma import PrismaRuntime # isort: off # skip:end # highlight-next-line -from typegraph_next.runtimes.graphql import GraphQLRuntime +from typegraph.runtimes.graphql import GraphQLRuntime @typegraph( diff --git a/website/docs/tutorials/adding-more-runtimes/prisma-no-sugar.py b/website/docs/tutorials/adding-more-runtimes/prisma-no-sugar.py index 2cb8836520..435887d134 100644 --- a/website/docs/tutorials/adding-more-runtimes/prisma-no-sugar.py +++ b/website/docs/tutorials/adding-more-runtimes/prisma-no-sugar.py @@ -1,6 +1,6 @@ # # skip:start -# from typegraph_next import typegraph, effects, t, Graph -# from typegraph_next.providers.prisma import PrismaRuntime +# from typegraph import typegraph, effects, t, Graph +# from typegraph.providers.prisma import PrismaRuntime # # # @typegraph() diff --git a/website/docs/tutorials/authentication-and-security/authentication.py b/website/docs/tutorials/authentication-and-security/authentication.py index e2fb6914b5..b0d1bc564b 100644 --- a/website/docs/tutorials/authentication-and-security/authentication.py +++ b/website/docs/tutorials/authentication-and-security/authentication.py @@ -1,7 +1,7 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors, Auth -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors, Auth +from typegraph.runtimes.deno import DenoRuntime # skip:end diff --git a/website/docs/tutorials/authentication-and-security/cors.py b/website/docs/tutorials/authentication-and-security/cors.py index e72e4a0866..58cf3b9372 100644 --- a/website/docs/tutorials/authentication-and-security/cors.py +++ b/website/docs/tutorials/authentication-and-security/cors.py @@ -1,7 +1,7 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors -from typegraph_next.runtimes.random import RandomRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors +from typegraph.runtimes.random import RandomRuntime # skip:end diff --git a/website/docs/tutorials/authentication-and-security/rate.py b/website/docs/tutorials/authentication-and-security/rate.py index 31b1401824..b62e88ef04 100644 --- a/website/docs/tutorials/authentication-and-security/rate.py +++ b/website/docs/tutorials/authentication-and-security/rate.py @@ -1,7 +1,7 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors, Rate -from typegraph_next.runtimes.random import RandomRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors, Rate +from typegraph.runtimes.random import RandomRuntime # skip:end diff --git a/website/docs/tutorials/policies-and-materializers/deno.py b/website/docs/tutorials/policies-and-materializers/deno.py index 2866e50681..a138ae9324 100644 --- a/website/docs/tutorials/policies-and-materializers/deno.py +++ b/website/docs/tutorials/policies-and-materializers/deno.py @@ -1,7 +1,7 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors -from typegraph_next.runtimes.deno import DenoRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors +from typegraph.runtimes.deno import DenoRuntime # skip:end diff --git a/website/docs/tutorials/policies-and-materializers/policies.py b/website/docs/tutorials/policies-and-materializers/policies.py index 97e405158c..3ee0b60d6e 100644 --- a/website/docs/tutorials/policies-and-materializers/policies.py +++ b/website/docs/tutorials/policies-and-materializers/policies.py @@ -1,8 +1,8 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors, Auth -from typegraph_next.runtimes.deno import DenoRuntime -from typegraph_next.runtimes.random import RandomRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors, Auth +from typegraph.runtimes.deno import DenoRuntime +from typegraph.runtimes.random import RandomRuntime # skip:end diff --git a/website/docs/tutorials/your-first-typegraph/t.py b/website/docs/tutorials/your-first-typegraph/t.py index 643a89ad9a..0b706f6f66 100644 --- a/website/docs/tutorials/your-first-typegraph/t.py +++ b/website/docs/tutorials/your-first-typegraph/t.py @@ -1,6 +1,6 @@ -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors -from typegraph_next.runtimes import RandomRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors +from typegraph.runtimes import RandomRuntime @typegraph( diff --git a/website/docs/tutorials/your-first-typegraph/types.py b/website/docs/tutorials/your-first-typegraph/types.py index 2a6a20a63a..4edfcce819 100644 --- a/website/docs/tutorials/your-first-typegraph/types.py +++ b/website/docs/tutorials/your-first-typegraph/types.py @@ -1,5 +1,5 @@ # skip:start -from typegraph_next import typegraph, t, Graph +from typegraph import typegraph, t, Graph @typegraph() diff --git a/website/src/pages/index.py b/website/src/pages/index.py index 7fecad4411..91e87b2998 100644 --- a/website/src/pages/index.py +++ b/website/src/pages/index.py @@ -1,10 +1,10 @@ # skip:start import re -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors, Rate, oauth2 -from typegraph_next.providers import PrismaRuntime -from typegraph_next.runtimes import HttpRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors, Rate, oauth2 +from typegraph.providers import PrismaRuntime +from typegraph.runtimes import HttpRuntime # skip:end diff --git a/website/use-cases/backend-for-frontend/t.py b/website/use-cases/backend-for-frontend/t.py index 71767a4d93..8a1a3e0ffc 100644 --- a/website/use-cases/backend-for-frontend/t.py +++ b/website/use-cases/backend-for-frontend/t.py @@ -1,7 +1,7 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors -from typegraph_next.runtimes import HttpRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors +from typegraph.runtimes import HttpRuntime # skip:end diff --git a/website/use-cases/faas-runner/t.py b/website/use-cases/faas-runner/t.py index 4106274a8e..d2f583c201 100644 --- a/website/use-cases/faas-runner/t.py +++ b/website/use-cases/faas-runner/t.py @@ -1,7 +1,7 @@ # skip:start -from typegraph_next import typegraph, Policy, t, Graph -from typegraph_next.graph.params import Cors -from typegraph_next.runtimes import DenoRuntime, PythonRuntime +from typegraph import typegraph, Policy, t, Graph +from typegraph.graph.params import Cors +from typegraph.runtimes import DenoRuntime, PythonRuntime # skip:end diff --git a/website/use-cases/prisma.py b/website/use-cases/prisma.py index 6b44170066..1631eafa10 100644 --- a/website/use-cases/prisma.py +++ b/website/use-cases/prisma.py @@ -1,8 +1,8 @@ # skip:start -from typegraph_next import Policy, t -from typegraph_next.graph.params import Cors -from typegraph_next.graph.typegraph import Graph, typegraph -from typegraph_next.providers.prisma import PrismaRuntime +from typegraph import Policy, t +from typegraph.graph.params import Cors +from typegraph.graph.typegraph import Graph, typegraph +from typegraph.providers.prisma import PrismaRuntime # skip:end diff --git a/whiz.yaml b/whiz.yaml index d9945486bc..1dcf9fb1b9 100644 --- a/whiz.yaml +++ b/whiz.yaml @@ -68,13 +68,8 @@ typegraph: jco transpile $WASM_FILE -o typegraph/deno/src/gen --map "*=../imports.ts" deno run -A typegraph/deno/dev/fix-declarations.ts - # cargo build -p typegraph_core --target wasm32-unknown-unknown -F wasm --release - # wasm-opt -Oz target/wasm32-unknown-unknown/release/typegraph_core.wasm -o test.wasm - # wasm-tools component new test.wasm -o $WASM_FILE - # jco + transpile - - rm -rf typegraph/python_next/typegraph_next/gen - poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python_next/typegraph_next/gen + rm -rf typegraph/python/typegraph/gen + poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen depends_on: - libs @@ -139,6 +134,7 @@ install: JCO_VERSION: "0.12.1" CARGO_INSTA_VERSION: "1.30.0" WASMEDGE_VERSION: "0.12.1" + WASM_OPT_VERSION: "0.114.1" DENO_VERSION: "1.37.1" command: | set -e @@ -146,6 +142,7 @@ install: poetry install --sync ~/.wasmedge/bin/wasmedge --version | grep -q $WASMEDGE_VERSION || curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $WASMEDGE_VERSION cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked + cargo install wasm-opt --version $WASM_OPT_VERSION --locked cargo install cargo-insta --version $CARGO_INSTA_VERSION --locked deno install --allow-all --force -n deno_bindgen $DENO_BINDGEN_URL npm install --global @bytecodealliance/jco@$JCO_VERSION