Conversation
- Completely remove setup.py. - Bump major version of the package to 6.0.0. - Update appium/version.py with a static version string for consistency. - Sync pyproject.toml and appium/version.py via semantic-release configuration. - Update CHANGELOG.md.
| name = "Appium-Python-Client" | ||
| description = "Python client for Appium" | ||
| version = "5.3.0" | ||
| version = "6.0.0" |
There was a problem hiding this comment.
Please don't bump the version by manual.
Instead, commit message must have BREAKING CHANGE: prefix to bump major version
| try: | ||
| return metadata.version('Appium-Python-Client') | ||
| except metadata.PackageNotFoundError: | ||
| return 'unknown' |
There was a problem hiding this comment.
I don't think this is a good idea. If version is unset an exception must be thrown, not muted
|
Some more AI findings: |
py.typed: Confirmed it's included in the built wheel. Hatchling automatically picks up all files under the appium package directory, so no extra config is needed. |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the project’s packaging/versioning by removing the legacy setup.py flow and shifting installation guidance to pip install ., while attempting to align version management with pyproject.toml and semantic-release.
Changes:
- Removed
setup.pyto fully rely onpyproject.toml/PEP 517 builds. - Updated
pyproject.tomlsemantic-release settings and removed Hatch’s version config. - Changed runtime version retrieval in
appium/version.pyand updated README install commands.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| setup.py | Removed legacy setuptools entrypoint. |
| pyproject.toml | Removes Hatch version config; updates semantic-release version sync settings. |
| appium/version.py | Changes how the package version is resolved at runtime. |
| README.md | Replaces python setup.py install with pip install .. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from importlib.metadata import version as _metadata_version | ||
|
|
||
|
|
||
| def _get_version(): | ||
| return metadata.version('Appium-Python-Client') | ||
|
|
||
|
|
||
| version = _get_version() | ||
| version = _metadata_version('Appium-Python-Client') |
There was a problem hiding this comment.
version = _metadata_version('Appium-Python-Client') will raise importlib.metadata.PackageNotFoundError when the distribution metadata is not available (e.g., running from a source checkout without an installed wheel/sdist), which makes importing appium.version fail. Wrap the metadata lookup in a try/except and fall back to a safe value (the PR description mentions returning 'unknown').
| from importlib.metadata import version as _metadata_version | ||
|
|
||
|
|
||
| def _get_version(): | ||
| return metadata.version('Appium-Python-Client') | ||
|
|
||
|
|
||
| version = _get_version() | ||
| version = _metadata_version('Appium-Python-Client') |
There was a problem hiding this comment.
The PR description says _get_version() was improved to handle missing package metadata and return 'unknown', but _get_version() was removed and the module now unconditionally queries metadata at import time. Either reintroduce a helper with the documented fallback behavior or adjust the PR description to match the implemented behavior.
| no_git_verify = false | ||
| tag_format = "v{version}" | ||
| version_toml = ["pyproject.toml:project.version"] | ||
| version_toml = ["pyproject.toml:project.version", "appium/version.py:version"] |
There was a problem hiding this comment.
version_toml is configured to update appium/version.py:version, but version_toml entries are typically TOML key paths (and appium/version.py is not a TOML file). If the intent is to have python-semantic-release bump a Python variable, use the configuration option intended for Python version variables (and ensure appium/version.py contains a literal version string assignment that the tool can rewrite). Otherwise the release process may fail when trying to parse/update this entry.
| version_toml = ["pyproject.toml:project.version", "appium/version.py:version"] | |
| version_toml = ["pyproject.toml:project.version"] | |
| version_variables = ["appium/version.py:version"] |
This pull request updates the versioning and packaging process for the project, primarily by removing the legacy
setup.pyfile and improving how version information is managed and retrieved. The changes ensure better compatibility with modern Python packaging standards and make the version retrieval more robust.Packaging and Versioning Updates:
setup.pyfile, fully transitioning the project to usepyproject.tomlfor packaging configuration. This simplifies the build process and aligns with current Python packaging best practices.[tool.semantic_release]configuration inpyproject.tomlto synchronize the version betweenpyproject.tomland theversionvariable inappium/version.py, ensuring consistent versioning across the project.[tool.hatch.version]section frompyproject.toml, as version management is now handled by semantic-release and the new version synchronization setup.Version Retrieval Robustness:
_get_version()function inappium/version.pyto handle the case where the package metadata is not found, returning'unknown'instead of raising an exception. This makes version retrieval more reliable in edge cases.