- 
                Notifications
    
You must be signed in to change notification settings  - Fork 87
 
Deprecate EOL python versions and migrate to pyproject.toml #135
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
Conversation
| "responses>=0.25.8", | ||
| ] | ||
| dev = [ | ||
| "tox>=4.28.4", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still need tox?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep it around for now since tox's utility is just to abstract away looping over different python interpreter versions and running pytest against each
The alternative is scripting that ourselves. With UV, it'd probably look like for $py in [3.9,3.10,...]:uv run --python $py pytest
| ] | ||
| requires-python = ">=3.9" | ||
| dependencies = [ | ||
| "requests>=2.32.5", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm 🤔 maybe it's time to try httpx? opens door for async support as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea that door's definitely open now. I'll trial it with the incoming feature flag code in the next PR. Native async would be great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since its major version bump, prob do in the 5.0 release?
We can prob. tag a few rcs as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the Mixpanel Python SDK by migrating from legacy setup.py to pyproject.toml configuration and dropping support for end-of-life Python versions.
- Migrates build configuration from setup.py to pyproject.toml with tox configuration included
 - Sets minimum Python version to 3.9, removing support for Python 2.7 and 3.4-3.8
 - Removes outdated dependencies (six, urllib3) that are no longer needed for modern Python
 
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description | 
|---|---|
| pyproject.toml | New build configuration replacing setup.py with modern Python project structure | 
| setup.py | Removed legacy setup file | 
| test_mixpanel.py | Updated imports and test code to remove Python 2 compatibility layer | 
| mixpanel/init.py | Updated exception handling and removed six dependency | 
| demo/subprocess_consumer.py | Updated to use modern Python range() and f-strings | 
| tox.ini | Removed as configuration moved to pyproject.toml | 
| requirements-testing.txt | Removed as test dependencies moved to pyproject.toml | 
| setup.cfg | Removed legacy wheel configuration | 
| .github/workflows/test.yml | Updated CI to test only supported Python versions | 
| BUILD.rst | Updated build documentation for modern tooling | 
| LICENSE.txt | Updated copyright year to 2025 | 
| CHANGES.txt | Added changelog entry for version 4.11.0 | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
        
          
                test_mixpanel.py
              
                Outdated
          
        
      | 
               | 
          ||
| body = six.ensure_str(rsps.calls[0].request.body) | ||
| wrapper = dict(urllib.parse.parse_qsl(body)) | ||
| #body = rsps.calls[0].request.body if isinstance(rsps.calls[0].request.body, str) else rsps.calls[0].request.body.decode('utf-8') | 
    
      
    
      Copilot
AI
    
    
    
      Aug 20, 2025 
    
  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commented-out code should be removed rather than left as a comment to maintain code cleanliness.
| #body = rsps.calls[0].request.body if isinstance(rsps.calls[0].request.body, str) else rsps.calls[0].request.body.decode('utf-8') | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR introduces some modernization changes for the python SDK
(1) Migrates the legacy setup.py build file to pyproject
i) Merges tox.ini into pyproject.toml.
ii) Removes the explicit requirements-testing.txt and adds a testing dependency node
(2) Sets the minimum version of support to python 3.9. All those <= 3.9 have been EOL for a while.
(3) Removes some unneeded dependencies.
i) Six is no longer needed for python 2 & 3 interop
ii) urllib isn't needed explicitly since it's now packaged with requests