8000 fix: makefile for posthog_analytics release by pauldambra · Pull Request #248 · PostHog/posthog-python · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: makefile for posthog_analytics release #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 9, 2025
Merged

Conversation

pauldambra
Copy link
Member

the posthog_analytics release was broken in the recent reorganisation of files

  • update setup_analytics.py to change values in pyproject.toml instead of having the info duplicated in the 2 setup files
  • update the makefile to tidy up a little more
  • update the makefile so it can run if there's a pycache directory present

Copy link
Contributor
@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Updates the release process for the posthoganalytics package by improving the build system and file handling. These changes enhance reliability and maintainability.

  • Modifies setup_analytics.py to dynamically update package metadata in pyproject.toml instead of duplicating configuration
  • Adds handling for __pycache__ directories in Makefile to prevent common build failures
  • Implements proper backup and restoration of pyproject.toml during the analytics release process
  • Improves cleanup of build artifacts to ensure clean releases

2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +19 to +20
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' {} \;
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

@pauldambra pauldambra requested a review from a team June 9, 2025 07:09
@pauldambra pauldambra enabled auto-merge (squash) June 9, 2025 07:31
@pauldambra pauldambra requested a review from veryayskiy June 9, 2025 08:31
@pauldambra pauldambra merged commit 3171193 into master Jun 9, 2025
6 checks passed
@pauldambra pauldambra deleted the fix/makefile branch June 9, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0