File tree Expand file tree Collapse file tree 6 files changed +10
-9
lines changed
Expand file tree Collapse file tree 6 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 1+ ## 4.6.2 - 2025-06-09
2+
3+ - fix: replace ` import posthog ` with direct method imports
4+
15## 4.6.1 - 2025-06-09
26
37- fix: replace ` import posthog ` in ` posthoganalytics ` package
Original file line number Diff line number Diff line change @@ -18,15 +18,13 @@ release_analytics:
1818 cp -r posthog/* posthoganalytics/
1919 find ./posthoganalytics -type f -name " *.py" -exec sed -i.bak -e ' s/from posthog /from posthoganalytics /g' {} \;
2020 find ./posthoganalytics -type f -name " *.py" -exec sed -i.bak -e ' s/from posthog\./from posthoganalytics\./g' {} \;
21- find ./posthoganalytics -type f -name " *.py" -exec sed -i.bak -e ' s/import posthog/import posthoganalytics/g' {} \;
2221 find ./posthoganalytics -name " *.bak" -delete
2322 rm -rf posthog
2423 python setup_analytics.py sdist bdist_wheel
2524 twine upload dist/*
2625 mkdir posthog
2726 find ./posthoganalytics -type f -name " *.py" -exec sed -i.bak -e ' s/from posthoganalytics /from posthog /g' {} \;
2827 find ./posthoganalytics -type f -name " *.py" -exec sed -i.bak -e ' s/from posthoganalytics\./from posthog\./g' {} \;
29- find ./posthoganalytics -type f -name " *.py" -exec sed -i.bak -e ' s/import posthoganalytics/import posthog/g' {} \;
3028 find ./posthoganalytics -name " *.bak" -delete
3129 cp -r posthoganalytics/* posthog/
3230 rm -rf posthoganalytics
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def new_context(fresh=False):
3939 raise ValueError("Something went wrong")
4040
4141 """
42- import posthog
42+ from posthog import capture_exception
4343
4444 current_tags = _get_current_context ().copy ()
4545 current_stack = _context_stack .get ()
@@ -49,7 +49,7 @@ def new_context(fresh=False):
4949 try :
5050 yield
5151 except Exception as e :
52- posthog . capture_exception (e )
52+ capture_exception (e )
5353 raise
5454 finally :
5555 _context_stack .reset (token )
Original file line number Diff line number Diff line change 44from sentry_sdk .scope import add_global_event_processor
55from sentry_sdk .utils import Dsn
66
7- import posthog
7+ from posthog import capture , host
88from posthog .request import DEFAULT_HOST
99from posthog .sentry import POSTHOG_ID_TAG
1010
@@ -34,7 +34,7 @@ def processor(event, hint):
3434 if event .get ("tags" , {}).get (POSTHOG_ID_TAG ):
3535 posthog_distinct_id = event ["tags" ][POSTHOG_ID_TAG ]
3636 event ["tags" ]["PostHog URL" ] = (
37- f"{ posthog . host or DEFAULT_HOST } /person/{ posthog_distinct_id } "
37+ f"{ host or DEFAULT_HOST } /person/{ posthog_distinct_id } "
3838 )
3939
4040 properties = {
@@ -52,6 +52,6 @@ def processor(event, hint):
5252 f"{ PostHogIntegration .prefix } { PostHogIntegration .organization } /issues/?project={ project_id } &query={ event ['event_id' ]} "
5353 )
5454
55- posthog . capture (posthog_distinct_id , "$exception" , properties )
55+ capture (posthog_distinct_id , "$exception" , properties )
5656
5757 return event
Original file line number Diff line number Diff line change 1- import hashlib
21import time
32import unittest
43from datetime import datetime
Original file line number Diff line number Diff line change 1- VERSION = "4.6.1 "
1+ VERSION = "4.6.2 "
22
33if __name__ == "__main__" :
44 print (VERSION , end = "" ) # noqa: T201
You can’t perform that action at this time.
0 commit comments