Skip to content

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.

3 participants