Skip to content

Commit 0ad5fb2

Browse files
feat: bootstrap Python Product Analytics SDK for v0.9.0 (#2)
Initial implementation of the Python SDK following the spec.
1 parent e147a74 commit 0ad5fb2

22 files changed

Lines changed: 1222 additions & 18 deletions

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [altertable-ai]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Bug Report
2+
description: Report a bug
3+
labels: ["bug"]
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
description: A clear description of the bug.
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: reproduction
14+
attributes:
15+
label: Steps to Reproduce
16+
description: Minimal code or steps to reproduce the issue.
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: expected
21+
attributes:
22+
label: Expected Behavior
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: actual
27+
attributes:
28+
label: Actual Behavior
29+
validations:
30+
required: true
31+
- type: input
32+
id: version
33+
attributes:
34+
label: SDK Version
35+
validations:
36+
required: true
37+
- type: input
38+
id: runtime
39+
attributes:
40+
label: "Python Version"
41+
validations:
42+
required: true
43+
- type: dropdown
44+
id: os
45+
attributes:
46+
label: Operating System
47+
options: [macOS, Linux, Windows, Other]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Feature Request
2+
description: Suggest a feature
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: problem
7+
attributes:
8+
label: Problem
9+
description: What problem does this solve?
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: solution
14+
attributes:
15+
label: Proposed Solution
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: alternatives
20+
attributes:
21+
label: Alternatives Considered

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## What
2+
3+
<!-- What does this PR do? One sentence is fine. -->
4+
5+
## Why
6+
7+
<!-- Link an issue or explain the motivation. -->
8+
9+
## Checklist
10+
11+
- [ ] Tests added or updated
12+
- [ ] `CHANGELOG.md` updated (skip for docs/CI-only changes)
13+
- [ ] Breaking change noted in commit footer (`BREAKING CHANGE: …`) and changelog

.github/workflows/ci.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,27 @@ on:
88

99
jobs:
1010
lint:
11-
name: Lint & Typecheck
1211
runs-on: ubuntu-latest
1312
steps:
1413
- uses: actions/checkout@v4
15-
- name: Install poetry
16-
run: pipx install poetry
1714
- name: Set up Python
1815
uses: actions/setup-python@v5
1916
with:
20-
python-version: "3.11"
21-
cache: "poetry"
17+
python-version: "3.14"
18+
cache: "pip"
2219
- name: Install dependencies
23-
run: poetry install
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install poetry
23+
poetry install
2424
- name: Run Ruff
25-
run: poetry run ruff check src tests
26-
- name: Run Mypy
27-
run: poetry run mypy src tests
25+
run: poetry run ruff check .
2826

2927
test:
3028
runs-on: ubuntu-latest
3129
strategy:
3230
matrix:
33-
python-version: ["3.9", "3.10", "3.11", "3.12"]
31+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
3432

3533
services:
3634
altertable:
@@ -51,17 +49,35 @@ jobs:
5149
with:
5250
submodules: recursive
5351

54-
- name: Install poetry
55-
run: pipx install poetry
56-
5752
- name: Set up Python
5853
uses: actions/setup-python@v5
5954
with:
6055
python-version: ${{ matrix.python-version }}
61-
cache: "poetry"
56+
cache: "pip"
6257

6358
- name: Install dependencies
64-
run: poetry install
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install poetry
62+
poetry install
6563
6664
- name: Run tests
6765
run: poetry run pytest
66+
67+
typing:
68+
name: "Typing"
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
- name: Set up Python
73+
uses: actions/setup-python@v5
74+
with:
75+
python-version: "3.14"
76+
cache: "pip"
77+
- name: Install dependencies
78+
run: |
79+
python -m pip install --upgrade pip
80+
pip install poetry
81+
poetry install
82+
- name: Typecheck with mypy
83+
run: poetry run mypy src tests
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
id: release
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
config-file: release-please-config.json
22+
manifest-file: .release-please-manifest.json
23+
outputs:
24+
tag_name: ${{ steps.release.outputs.tag_name }}
25+
release_created: ${{ steps.release.outputs.release_created }}
26+
27+
publish:
28+
needs: check
29+
30+
if: ${{ needs.check.outputs.release_created }}
31+
32+
runs-on: ubuntu-latest
33+
34+
permissions:
35+
contents: write
36+
pull-requests: write
37+
id-token: write
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
persist-credentials: false
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: "3.12"
47+
- name: Install dependencies
48+
run: |
49+
python -m pip install --upgrade pip
50+
pip install poetry
51+
- name: Build
52+
run: |
53+
poetry build
54+
- name: Publish to PyPI
55+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# Virtual environments
30+
.env
31+
.venv
32+
env/
33+
venv/
34+
ENV/
35+
env.bak/
36+
venv.bak/
37+
38+
# Poetry
39+
# poetry.lock
40+
.poetry-env
41+
42+
# Editor
43+
.vscode/
44+
.idea/
45+
*.swp
46+
47+
# Altertable
48+
.DS_Store

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "specs"]
2+
path = specs
3+
url = https://github.com/altertable-ai/altertable-client-specs.git

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

CODE_OF_CONDUCT.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
* Demonstrating empathy and kindness toward other people
14+
* Being respectful of differing opinions, viewpoints, and experiences
15+
* Giving and gracefully accepting constructive feedback
16+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
* Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
* Trolling, insulting or derogatory comments, and personal or political attacks
23+
* Public or private harassment
24+
* Publishing others' private information, such as a physical or email address, without their explicit permission
25+
* Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32+
33+
## Scope
34+
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36+
37+
## Enforcement
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at opensource@altertable.ai. All complaints will be reviewed and investigated promptly and fairly.
40+
41+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
49+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50+
51+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52+
53+
### 2. Warning
54+
55+
**Community Impact**: A violation through a single incident or series of actions.
56+
57+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58+
59+
### 3. Temporary Ban
60+
61+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62+
63+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64+
65+
### 4. Permanent Ban
66+
67+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68+
69+
**Consequence**: A permanent ban from any sort of public interaction within the community.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74+
75+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76+
77+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78+
79+
[homepage]: https://www.contributor-covenant.org
80+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81+
[Mozilla CoC]: https://github.com/mozilla/diversity
82+
[FAQ]: https://www.contributor-covenant.org/faq
83+
[translations]: https://www.contributor-covenant.org/translations

0 commit comments

Comments
 (0)