Metadata-Version: 2.4
Name: sqliac
Version: 0.1.2
Summary: An alternative to Terraform for SQL databases without using a state.
Author-email: Ruslan Gonzalez Konstantinov <rus.kgo.gmail@example.com>
License: MIT License
        
        Copyright (c) 2026 ruskgo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
        associated documentation files (the "Software"), to deal in the Software without restriction, including
        without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
        following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial
        portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
        LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
        EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
        IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
        USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://codeberg.org/ruskgo/sqliac
Project-URL: Bug Tracker, https://codeberg.org/ruskgo/sqliac/issues
Keywords: sql,iac,terraform-alternative,database
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Jinja2
Requires-Dist: rich
Requires-Dist: sqlparse
Requires-Dist: dictdiffer
Provides-Extra: dev
Requires-Dist: pytest>=9.1.1; extra == "dev"
Provides-Extra: snowflake
Requires-Dist: sqliac-snowflake; extra == "snowflake"
Dynamic: license-file

# Publishing Instructions

## Prereqs

- PyPI account (+ TestPyPI account for the dry run)
- API token from https://pypi.org/manage/account/token/ — start with an **account-scoped** token (project-scoped tokens only work after the project exists on PyPI)
- Both package names available: check https://pypi.org/project/sqliac/ and https://pypi.org/project/sqliac-snowflake/

## 1. Lock the dependency before publishing

Your `tool.uv.sources` workspace links (`sqliac = { workspace = true }`) only resolve locally — outside the workspace, pip/uv fall back to `dependencies = ["sqliac"]` with no version bound. Pin it now, or a future core release can silently break the published adapter wheel with nothing to stop it:

```toml
# sqliac_adapters/sqliac_snowflake/pyproject.toml
dependencies = [
    "sqliac>=0.1.0,<0.2",
    "snowflake-connector-python[secure-local-storage]",
    "cryptography",
]
```

## 2. Build both from the workspace root

`uv build` only builds the root project by default in a workspace — target each member explicitly:

```bash
rm -rf dist/
uv build --package sqliac
uv build --package sqliac-snowflake
ls dist/   # expect 4 files: sdist + wheel × 2 packages
```

## 3. Dry run on TestPyPI first

This is the step that actually catches the entry-point bug from earlier — TestPyPI install is the only way to confirm `sqliac-snowflake` resolves outside the workspace, since local dev never exercises the plugin-discovery path for real.

```bash
export UV_PUBLISH_TOKEN=<testpypi-token>
uv publish --publish-url https://test.pypi.org/legacy/ dist/sqliac-0.1.0*
uv publish --publish-url https://test.pypi.org/legacy/ dist/sqliac_snowflake-0.1.0*
```

Verify in a throwaway venv:
```bash
uv venv /tmp/sqliac-check && source /tmp/sqliac-check/bin/activate
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ sqliac-snowflake
sqliac list   # must print "snowflake" — confirms the entry point resolves outside the workspace
```
`--extra-index-url` is needed because your real dependencies (`jinja2`, `snowflake-connector-python`, etc.) aren't on TestPyPI.

## 4. Publish for real — core first

Order matters for the reason above, not for pip resolution (pip doesn't validate a dependency exists at publish time) — but publishing core first means anyone who installs the adapter mid-release-window gets a working dependency instead of a 404.

```bash
export UV_PUBLISH_TOKEN=<pypi-token>
uv publish dist/sqliac-0.1.0*
uv publish dist/sqliac_snowflake-0.1.0*
```

## 5. Verify the real thing

```bash
uv venv /tmp/sqliac-verify && source /tmp/sqliac-verify/bin/activate
pip install sqliac-snowflake
sqliac list
```

## Strategic note, not tactical

Per rule #2 — manual token exports don't scale past release one. Once this works, move to a GitHub Actions workflow using [PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/) (OIDC — no long-lived token to rotate or leak) triggered on tag push, running the same `uv build` + `uv publish` steps above for each package. That's the point where "publish two packages" stops being a thing a human remembers to do correctly in order, and becomes a thing that can't be done wrong.
