Skip to content

Commit 423fb7f

Browse files
committed
Merge branch 'master' into feat/before_send
2 parents da76533 + 0d29fb7 commit 423fb7f

File tree

7 files changed

+78
-22
lines changed

7 files changed

+78
-22
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
run: echo "REPO_VERSION=$(python3 posthog/version.py)" >> $GITHUB_ENV
3838

3939
- name: Prepare for building release
40-
run: uv sync --extra build
40+
run: uv sync --extra dev
4141

4242
- name: Push releases to PyPI
43-
run: make release && make release_analytics
43+
run: uv run make release && uv run make release_analytics
4444

4545
- name: Create GitHub release
4646
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1

CHANGELOG.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1+
## 4.4.2- 2025-06-09
2+
3+
- empty point release to fix release automation
4+
5+
## 4.4.1 2025-06-09
6+
7+
- empty point release to fix release automation
8+
19
## 4.4.0 - 2025-06-09
210

311
- Use the new `/flags` endpoint for all feature flag evaluations (don't fall back to `/decide` at all)
412

513
## 4.3.2 - 2025-06-06
614

7-
Add context management:
15+
1. Add context management:
816
- New context manager with `posthog.new_context()`
917
- Tag functions: `posthog.tag()`, `posthog.get_tags()`, `posthog.clear_tags()`
1018
- Function decorator:
1119
- `@posthog.scoped` - Creates context and captures exceptions thrown within the function
1220
- Automatic deduplication of exceptions to ensure each exception is only captured once
13-
14-
## 4.2.1 - 2025-6-05
15-
16-
1. fix: feature flag request use geoip_disable (#235)
17-
2. chore: pin actions versions (#210)
18-
3. fix: opinionated setup and clean fn fix (#240)
19-
4. fix: release action failed (#241)
21+
2. fix: feature flag request use geoip_disable (#235)
22+
3. chore: pin actions versions (#210)
23+
4. fix: opinionated setup and clean fn fix (#240)
24+
5. fix: release action failed (#241)
2025

2126
## 4.2.0 - 2025-05-22
2227

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@ release_analytics:
1616
rm -rf posthoganalytics
1717
mkdir posthoganalytics
1818
cp -r posthog/* posthoganalytics/
19-
find ./posthoganalytics -type f -exec sed -i '' -e 's/from posthog /from posthoganalytics /g' {} \;
20-
find ./posthoganalytics -type f -exec sed -i '' -e 's/from posthog\./from posthoganalytics\./g' {} \;
19+
find ./posthoganalytics -type f -name "*.py" -exec sed -i.bak -e 's/from posthog /from posthoganalytics /g' {} \;
20+
find ./posthoganalytics -type f -name "*.py" -exec sed -i.bak -e 's/from posthog\./from posthoganalytics\./g' {} \;
21+
find ./posthoganalytics -name "*.bak" -delete
2122
rm -rf posthog
2223
python setup_analytics.py sdist bdist_wheel
2324
twine upload dist/*
2425
mkdir posthog
25-
find ./posthoganalytics -type f -exec sed -i '' -e 's/from posthoganalytics /from posthog /g' {} \;
26-
find ./posthoganalytics -type f -exec sed -i '' -e 's/from posthoganalytics\./from posthog\./g' {} \;
26+
find ./posthoganalytics -type f -name "*.py" -exec sed -i.bak -e 's/from posthoganalytics /from posthog /g' {} \;
27+
find ./posthoganalytics -type f -name "*.py" -exec sed -i.bak -e 's/from posthoganalytics\./from posthog\./g' {} \;
28+
find ./posthoganalytics -name "*.bak" -delete
2729
cp -r posthoganalytics/* posthog/
2830
rm -rf posthoganalytics
31+
rm -f pyproject.toml
32+
cp pyproject.toml.backup pyproject.toml
33+
rm -f pyproject.toml.backup
2934

3035
e2e_test:
3136
.buildscripts/e2e.sh

posthog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "4.4.0"
1+
VERSION = "4.4.2"
22

33
if __name__ == "__main__":
44
print(VERSION, end="") # noqa: T201

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ dev = [
5151
"pre-commit",
5252
"pydantic",
5353
"ruff",
54+
"setuptools",
55+
"packaging",
56+
"wheel",
57+
"twine",
58+
"tomli",
59+
"tomli_w",
5460
]
5561
test = [
5662
"mock>=2.0.0",
@@ -70,12 +76,6 @@ test = [
7076
"pydantic",
7177
"parameterized>=0.8.1",
7278
]
73-
build = [
74-
"setuptools",
75-
"packaging",
76-
"wheel",
77-
"twine",
78-
]
7979

8080
[tool.setuptools]
8181
packages = [

setup_analytics.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
11
import os
22
import sys
3+
import tomli
4+
import tomli_w
5+
import shutil
36

47
try:
58
from setuptools import setup
69
except ImportError:
710
from distutils.core import setup
811

912
# Don't import analytics-python module here, since deps may not be installed
10-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "posthog"))
13+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "posthoganalytics"))
1114
from version import VERSION # noqa: E402
1215

16+
17+
# Copy the original pyproject.toml as backup
18+
shutil.copy("pyproject.toml", "pyproject.toml.backup")
19+
20+
# Read the original pyproject.toml
21+
with open("pyproject.toml", "rb") as f:
22+
config = tomli.load(f)
23+
24+
# Override specific values
25+
config["project"]["name"] = "posthoganalytics"
26+
config["tool"]["setuptools"]["dynamic"]["version"] = {
27+
"attr": "posthoganalytics.version.VERSION"
28+
}
29+
30+
# Rename packages from posthog.* to posthoganalytics.*
31+
if "packages" in config["tool"]["setuptools"]:
32+
new_packages = []
33+
for package in config["tool"]["setuptools"]["packages"]:
34+
if package == "posthog":
35+
new_packages.append("posthoganalytics")
36+
elif package.startswith("posthog."):
37+
new_packages.append(package.replace("posthog.", "posthoganalytics.", 1))
38+
else:
39+
new_packages.append(package)
40+
config["tool"]["setuptools"]["packages"] = new_packages
41+
42+
# Overwrite the original pyproject.toml
43+
with open("pyproject.toml", "wb") as f:
44+
tomli_w.dump(config, f)
45+
1346
long_description = """
1447
PostHog is developer-friendly, self-hosted product analytics.
1548
posthog-python is the python package.

uv.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)