Skip to content

Commit 9f9553a

Browse files
Small fixes for python publishing (#441)
* fix: Avoid setting dynamic version Version is now fixed because of sampo, so we can get rid of this * feat: add changeset * docs: Add new RELEASING section to README
1 parent 16bc87b commit 9f9553a

3 files changed

Lines changed: 26 additions & 18 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
pypi/posthog: patch
3+
---
4+
5+
Fix posthoganalytics release, previously broken

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Please see the [Python integration docs](https://posthog.com/docs/integrations/p
1414

1515
## Python Version Support
1616

17-
| SDK Version | Python Versions Supported | Notes |
18-
|-------------|---------------------------|-------|
19-
| 7.3.1+ | 3.10, 3.11, 3.12, 3.13, 3.14 | Added Python 3.14 support |
20-
| 7.0.0 - 7.0.1 | 3.10, 3.11, 3.12, 3.13 | Dropped Python 3.9 support |
21-
| 4.0.1 - 6.x | 3.9, 3.10, 3.11, 3.12, 3.13 | Python 3.9+ required |
17+
| SDK Version | Python Versions Supported | Notes |
18+
| ------------- | ---------------------------- | -------------------------- |
19+
| 7.3.1+ | 3.10, 3.11, 3.12, 3.13, 3.14 | Added Python 3.14 support |
20+
| 7.0.0 - 7.0.1 | 3.10, 3.11, 3.12, 3.13 | Dropped Python 3.9 support |
21+
| 4.0.1 - 6.x | 3.9, 3.10, 3.11, 3.12, 3.13 | Python 3.9+ required |
2222

2323
## Development
2424

@@ -27,13 +27,13 @@ Please see the [Python integration docs](https://posthog.com/docs/integrations/p
2727
We recommend using [uv](https://docs.astral.sh/uv/). It's super fast.
2828

2929
1. Run `uv venv env` (creates virtual environment called "env")
30-
* or `python3 -m venv env`
30+
- or `python3 -m venv env`
3131
2. Run `source env/bin/activate` (activates the virtual environment)
3232
3. Run `uv sync --extra dev --extra test` (installs the package in develop mode, along with test dependencies)
33-
* or `pip install -e ".[dev,test]"`
33+
- or `pip install -e ".[dev,test]"`
3434
4. you have to run `pre-commit install` to have auto linting pre commit
3535
5. Run `make test`
36-
1. To run a specific test do `pytest -k test_no_api_key`
36+
6. To run a specific test do `pytest -k test_no_api_key`
3737

3838
## PostHog recommends `uv` so...
3939

@@ -51,16 +51,10 @@ make test
5151

5252
Assuming you have a [local version of PostHog](https://posthog.com/docs/developing-locally) running, you can run `python3 example.py` to see the library in action.
5353

54-
### Releasing Versions
55-
56-
Updates are released automatically using GitHub Actions when `version.py` is updated on `master`. After bumping `version.py` in `master` and adding to `CHANGELOG.md`, the [release workflow](https://github.com/PostHog/posthog-python/blob/master/.github/workflows/release.yaml) will automatically trigger and deploy the new version.
57-
58-
If you need to check the latest runs or manually trigger a release, you can go to [our release workflow's page](https://github.com/PostHog/posthog-python/actions/workflows/release.yaml) and dispatch it manually, using workflow from `master`.
59-
60-
6154
### Testing changes locally with the PostHog app
6255

6356
You can run `make prep_local`, and it'll create a new folder alongside the SDK repo one called `posthog-python-local`, which you can then import into the posthog project by changing pyproject.toml to look like this:
57+
6458
```toml
6559
dependencies = [
6660
...
@@ -71,4 +65,16 @@ dependencies = [
7165
[tools.uv.sources]
7266
posthoganalytics = { path = "../posthog-python-local" }
7367
```
68+
7469
This'll let you build and test SDK changes fully locally, incorporating them into your local posthog app stack. It mainly takes care of the `posthog -> posthoganalytics` module renaming. You'll need to re-run `make prep_local` each time you make a change, and re-run `uv sync --active` in the posthog app project.
70+
71+
## Releasing
72+
73+
This repository uses [Sampo](https://github.com/bruits/sampo) for versioning, changelogs, and publishing to crates.io.
74+
75+
1. When making changes, include a changeset: `sampo add`
76+
2. Create a PR with your changes and the changeset file
77+
3. Add the `release` label and merge to `main`
78+
4. Approve the release in Slack when prompted — this triggers version bump, crates.io publish, git tag, and GitHub Release
79+
80+
You can also trigger a release manually via the workflow's `workflow_dispatch` trigger (still requires pending changesets).

setup_analytics.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
# Override specific values
2525
config["project"]["name"] = "posthoganalytics"
2626
config["project"]["readme"] = "README_ANALYTICS.md"
27-
config["tool"]["setuptools"]["dynamic"]["version"] = {
28-
"attr": "posthoganalytics.version.VERSION"
29-
}
3027

3128
# Rename packages from posthog.* to posthoganalytics.*
3229
if "packages" in config["tool"]["setuptools"]:

0 commit comments

Comments
 (0)