Skip to content

Commit 61ff5f3

Browse files
kesmit13claude
andcommitted
Expand README and CONTRIBUTING documentation
- Add comprehensive package description and key features to README - Document optional dependencies with links to package websites - Add Configuration, Result Formats, Management API sections - Add Vector Store, Fusion SQL examples, and Advanced Options - Update ibis extra to use ibis-framework[singlestoredb] - Add development environment setup with uv to CONTRIBUTING - Add version bumping and release process documentation - Document management API test warnings and PyPI verification link Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 383be1a commit 61ff5f3

File tree

3 files changed

+379
-26
lines changed

3 files changed

+379
-26
lines changed

CONTRIBUTING.md

Lines changed: 127 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@ Fork this repo and commit your changes to the forked repo.
44
From there make a Pull Request with your submission keeping the
55
following in mind:
66

7+
## Setting up a development environment
8+
9+
Use [uv](https://docs.astral.sh/uv/) to create a virtual environment and install
10+
development dependencies:
11+
12+
```bash
13+
# Create and activate a virtual environment
14+
uv venv
15+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
16+
17+
# Install the package with all development dependencies
18+
uv pip install -e ".[dev]"
19+
20+
# Install pre-commit hooks (required for contributions)
21+
pre-commit install
22+
```
23+
24+
Alternatively, use standard pip:
25+
26+
```bash
27+
python -m venv .venv
28+
source .venv/bin/activate
29+
pip install -e ".[dev]"
30+
pre-commit install
31+
```
32+
733
## Pre-commit checks on the clone of this repo
834

935
The CI pipeline in this repo runs a bunch of validation checks and code
@@ -28,25 +54,11 @@ pre-commit run --all-files
2854
### Prerequisites
2955

3056
Before running tests, ensure you have:
57+
- **Development environment set up** (see above)
3158
- **Docker installed and running** (for automatic test database management)
32-
- Test dependencies installed: `pip install -e ".[test]"` or `pip install -e ".[dev]"` for all development dependencies
33-
34-
The `docker` Python package is required for the test framework to manage Docker containers automatically.
3559

36-
### Installation
37-
38-
To create a test environment:
39-
```bash
40-
pip install -e ".[dev]" # All development dependencies (recommended)
41-
```
42-
43-
Or if you only need specific dependency groups:
44-
```bash
45-
pip install -e ".[test]" # Just testing dependencies
46-
pip install -e ".[docs]" # Just documentation dependencies
47-
pip install -e ".[build]" # Just build dependencies
48-
pip install -e ".[examples]" # Just example/demo dependencies
49-
```
60+
The `docker` Python package (included in `[dev]` and `[test]` extras) is required
61+
for the test framework to manage Docker containers automatically.
5062

5163
### Basic Testing
5264

@@ -136,7 +148,7 @@ The following environment variables control test behavior:
136148

137149
- **`SINGLESTOREDB_PURE_PYTHON`**: Set to `1` to disable C acceleration and test in pure Python mode.
138150

139-
- **`SINGLESTOREDB_MANAGEMENT_TOKEN`**: Management API token for testing management features (mark tests with `@pytest.mark.management`).
151+
- **`SINGLESTOREDB_MANAGEMENT_TOKEN`**: Management API token for testing management features. Get your API key from the [SingleStore Portal](https://portal.singlestore.com/). Tests marked with `@pytest.mark.management` will create and delete workspace groups/workspaces in your organization.
140152

141153
### Testing Best Practices
142154

@@ -152,6 +164,10 @@ The following environment variables control test behavior:
152164
```
153165

154166
3. **Management API tests**: These require a management token and are marked with `@pytest.mark.management`.
167+
- Set `SINGLESTOREDB_MANAGEMENT_TOKEN` to your API key
168+
- **Warning**: These tests create actual workspace groups and workspaces in the SingleStore Launchpad organization associated with your API key
169+
- Resources are cleaned up after tests, but failed tests may leave orphaned resources
170+
- To skip management tests: `pytest -v -m 'not management' singlestoredb/tests`
155171

156172
### Examples
157173

@@ -172,3 +188,96 @@ SINGLESTOREDB_URL=admin:pass@localhost:3306 pytest -v singlestoredb/tests
172188
# Debug mode with verbose output
173189
pytest -vv -s singlestoredb/tests/test_basics.py
174190
```
191+
192+
## Version Bumping and Releases
193+
194+
This section documents the process for creating new releases of the SDK.
195+
196+
### Bumping the Version
197+
198+
Use the `resources/bump_version.py` script to increment the version number
199+
and prepare release notes.
200+
201+
```bash
202+
# Bump patch version (1.2.3 -> 1.2.4)
203+
python resources/bump_version.py patch
204+
205+
# Bump minor version (1.2.3 -> 1.3.0)
206+
python resources/bump_version.py minor
207+
208+
# Bump major version (1.2.3 -> 2.0.0)
209+
python resources/bump_version.py major
210+
211+
# Provide custom release notes (supports reStructuredText)
212+
python resources/bump_version.py patch --summary "* Fixed critical bug in connection handling"
213+
```
214+
215+
The script performs the following steps:
216+
1. Reads the current version from `pyproject.toml`
217+
2. Calculates the new version based on bump type
218+
3. Updates version in both `pyproject.toml` and `singlestoredb/__init__.py`
219+
4. Generates release notes from git history (or uses provided summary)
220+
5. Opens an editor to customize release notes for `docs/src/whatsnew.rst`
221+
6. Builds the documentation
222+
7. Stages all modified files for commit
223+
8. Optionally commits and pushes changes
224+
225+
### Creating a Release
226+
227+
After version bumping and CI tests pass, use the `resources/create_release.py`
228+
script to create a GitHub release.
229+
230+
```bash
231+
# Create release using version from pyproject.toml
232+
python resources/create_release.py
233+
234+
# Create release for a specific version
235+
python resources/create_release.py --version 1.16.9
236+
237+
# Preview without creating (dry run)
238+
python resources/create_release.py --dry-run
239+
```
240+
241+
The script:
242+
1. Checks prerequisites (gh CLI installed, authenticated with GitHub)
243+
2. Extracts version from `pyproject.toml` (or uses specified version)
244+
3. Reads release notes from `docs/src/whatsnew.rst`
245+
4. Creates a GitHub release with tag `v<version>`
246+
247+
**Prerequisites**: The GitHub CLI (`gh`) must be installed and authenticated.
248+
Install from https://cli.github.com/ and run `gh auth login`.
249+
250+
### Complete Release Workflow
251+
252+
1. **Bump the version**:
253+
```bash
254+
python resources/bump_version.py patch
255+
```
256+
257+
2. **Review and edit release notes** in the editor that opens
258+
259+
3. **Commit and push** (the script prompts for this, or do manually):
260+
```bash
261+
git commit -m "Prepare for v1.x.x release" && git push
262+
```
263+
264+
4. **Wait for CI tests to pass** on GitHub Actions
265+
266+
5. **Create the GitHub release**:
267+
```bash
268+
python resources/create_release.py
269+
```
270+
271+
6. **Verify PyPI publish** workflow completes successfully
272+
(triggered automatically by the GitHub release). Check the
273+
[PyPI package page](https://pypi.org/project/singlestoredb/) to confirm
274+
the new version is available.
275+
276+
### Version File Locations
277+
278+
Version numbers are stored in two locations that must stay in sync:
279+
- `pyproject.toml` (line 7): Package metadata version
280+
- `singlestoredb/__init__.py` (line 16): `__version__` variable
281+
282+
The `bump_version.py` script handles updating both files automatically.
283+
Never edit these manually unless you update both locations.

0 commit comments

Comments
 (0)