Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.4.1 - 2025-06-07

- empty point release to fix the posthog_analytics release

## 4.4.0 - 2025-06-09

- Use the new `/flags` endpoint for all feature flag evaluations (don't fall back to `/decide` at all)
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ release_analytics:
rm -rf posthoganalytics
mkdir posthoganalytics
cp -r posthog/* posthoganalytics/
find ./posthoganalytics -type f -exec sed -i '' -e 's/from posthog /from posthoganalytics /g' {} \;
find ./posthoganalytics -type f -exec sed -i '' -e 's/from posthog\./from posthoganalytics\./g' {} \;
find ./posthoganalytics -type f -not -path "*/__pycache__/*" -exec sed -i '' -e 's/from posthog /from posthoganalytics /g' {} \;
find ./posthoganalytics -type f -not -path "*/__pycache__/*" -exec sed -i '' -e 's/from posthog\./from posthoganalytics\./g' {} \;
Comment on lines +19 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: The sed commands use the -i '' flag which is macOS-specific. This could cause issues on Linux systems.

Suggested change
find ./posthoganalytics -type f -not -path "*/__pycache__/*" -exec sed -i '' -e 's/from posthog /from posthoganalytics /g' {} \;
find ./posthoganalytics -type f -not -path "*/__pycache__/*" -exec sed -i '' -e 's/from posthog\./from posthoganalytics\./g' {} \;
find ./posthoganalytics -type f -not -path "*/__pycache__/*" -exec sed -i.bak -e 's/from posthog /from posthoganalytics /g' {} \; && find ./posthoganalytics -name '*.bak' -delete
find ./posthoganalytics -type f -not -path "*/__pycache__/*" -exec sed -i.bak -e 's/from posthog\./from posthoganalytics\./g' {} \; && find ./posthoganalytics -name '*.bak' -delete

rm -rf posthog
python setup_analytics.py sdist bdist_wheel
twine upload dist/*
mkdir posthog
find ./posthoganalytics -type f -exec sed -i '' -e 's/from posthoganalytics /from posthog /g' {} \;
find ./posthoganalytics -type f -exec sed -i '' -e 's/from posthoganalytics\./from posthog\./g' {} \;
find ./posthoganalytics -type f -not -path "*/__pycache__/*" -exec sed -i '' -e 's/from posthoganalytics /from posthog /g' {} \;
find ./posthoganalytics -type f -not -path "*/__pycache__/*" -exec sed -i '' -e 's/from posthoganalytics\./from posthog\./g' {} \;
cp -r posthoganalytics/* posthog/
rm -rf posthoganalytics
rm -f pyproject.toml
cp pyproject.toml.backup pyproject.toml
rm -f pyproject.toml.backup

e2e_test:
.buildscripts/e2e.sh
Expand Down
2 changes: 1 addition & 1 deletion posthog/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "4.4.0"
VERSION = "4.4.1"

if __name__ == "__main__":
print(VERSION, end="") # noqa: T201
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ dev = [
"pre-commit",
"pydantic",
"ruff",
"tomli",
"tomli_w",
]
test = [
"mock>=2.0.0",
Expand Down
35 changes: 34 additions & 1 deletion setup_analytics.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@
import os
import sys
import tomli
import tomli_w
import shutil

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

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


# Copy the original pyproject.toml as backup
shutil.copy("pyproject.toml", "pyproject.toml.backup")

# Read the original pyproject.toml
with open("pyproject.toml", "rb") as f:
config = tomli.load(f)

# Override specific values
config["project"]["name"] = "posthoganalytics"
config["tool"]["setuptools"]["dynamic"]["version"] = {
"attr": "posthoganalytics.version.VERSION"
}

# Rename packages from posthog.* to posthoganalytics.*
if "packages" in config["tool"]["setuptools"]:
new_packages = []
for package in config["tool"]["setuptools"]["packages"]:
if package == "posthog":
new_packages.append("posthoganalytics")
elif package.startswith("posthog."):
new_packages.append(package.replace("posthog.", "posthoganalytics.", 1))
else:
new_packages.append(package)
config["tool"]["setuptools"]["packages"] = new_packages

# Overwrite the original pyproject.toml
with open("pyproject.toml", "wb") as f:
tomli_w.dump(config, f)

long_description = """
PostHog is developer-friendly, self-hosted product analytics.
posthog-python is the python package.
Expand Down
13 changes: 13 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading