Skip to content

chore: upgrade to Python 3.8+ and modernize CI#329

Open
vaibhavchopra-wq wants to merge 7 commits into
masterfrom
chore/version-deps-ci-updates
Open

chore: upgrade to Python 3.8+ and modernize CI#329
vaibhavchopra-wq wants to merge 7 commits into
masterfrom
chore/version-deps-ci-updates

Conversation

@vaibhavchopra-wq

Copy link
Copy Markdown

Summary

  • Upgrade minimum Python version from 3.4 to 3.8
  • Update supported versions: 3.8, 3.9, 3.10, 3.11, 3.12
  • Update GitHub Actions from v2/v3 to v4/v5
  • Add CI matrix testing for multiple Python versions
  • Update setup.py classifiers to reflect current support
  • Mark package as Production/Stable status

Test plan

  • CI passes on Python 3.8, 3.9, 3.10, 3.11, 3.12
  • Existing tests continue to pass
  • Package builds and publishes correctly

🤖 Generated with Claude Code

vaibhavchopra-wq and others added 7 commits May 10, 2026 20:51
- Python: 3.4+ → >=3.8
- requests: any → >=2.28.0
- CI: test Python 3.8, 3.9, 3.10, 3.11, 3.12
- GitHub Actions: v2/v3 → v4/v5

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…duplicate workflow

- Remove pkg_resources fallback (deprecated in Python 3.12+, not needed for Python 3.8+)
- Use importlib.metadata directly (available since Python 3.8)
- Fix hardcoded fallback version 1.4.3 → 2.0.1
- Delete duplicate python.yml workflow (ci.yml is the primary)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Replace `python setup.py install` with `pip install .` (modern approach)
- Extract version from setup.py using grep instead of `setup.py --version`
- setuptools is not pre-installed in Python 3.12+ GitHub runners

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Don't change release status in chore PR - that's a release decision.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Raise minimum Python to 3.10 (3.8/3.9 are EOL)
- Add Python 3.13 to test matrix and classifiers
- Keep 3.9 in test matrix for broader compatibility testing
- Use robust regex for version extraction (handles single/double quotes)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Cannot test on 3.9 when python_requires='>=3.10'

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Minimum: >=3.11 (EOL Oct 2027, gives 1.5 years runway)
- Test matrix: 3.11, 3.12, 3.13, 3.14

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Comment thread razorpay/client.py
import importlib.metadata
version = importlib.metadata.version("razorpay")
except importlib.metadata.PackageNotFoundError: # pragma: no cover
version = "2.0.1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please check this once is it backward compatible or not ?

also check this PR why i had added these changes.

@vaibhavchopra-wq

Copy link
Copy Markdown
Author

Thanks for the review!

Re: backward compatibility of removing pkg_resources fallback

The change is backward compatible for our new minimum Python version (3.11+). Here's the reasoning:

  1. importlib.metadata has been in Python stdlib since 3.8 - so it's always available for Python 3.11+
  2. pkg_resources (from setuptools) is deprecated and generates runtime warnings
  3. The original PR fix: pkg_resources deprecation warning on runtime #307 added the fallback chain for older Python versions we no longer support

Since we're bumping minimum Python to 3.11, the pkg_resources fallback is dead code - importlib.metadata will always be available. Removing it:

  • Eliminates deprecated API usage
  • Simplifies the code
  • Removes the setuptools runtime dependency for version detection

The fallback to hardcoded version only triggers if importlib.metadata.version("razorpay") fails (e.g., editable install edge cases), which is unchanged behavior.

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