Remove version exports from Python packages for consistency with TypeScript - #130
Conversation
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR removes version exports from Python packages (apyds and apyds_bnf) to maintain API consistency with TypeScript packages. Version metadata remains accessible via importlib.metadata.version() but is no longer part of the public API surface.
Key changes:
- Removed
__version__from public API exports - Removed
version_fileconfiguration from setuptools_scm - Deleted version.py module and related gitignore entries
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Removed version_file = "apyds/_version.py" from setuptools_scm configuration |
| bnf/pyproject.toml | Removed version_file = "apyds_bnf/_version.py" from setuptools_scm configuration |
| apyds/version.py | Deleted entire version module that provided __version__ and version exports |
| apyds/init.py | Removed __version__ from __all__ exports and deleted version import statement |
| apyds/.gitignore | Removed _version.py entry, leaving file empty |
Note: The documentation files (docs/index.md and docs/getting-started/installation.md) still contain references to apyds.__version__ which will need to be updated separately. However, these files are not part of this PR's changes, so they should be addressed in a follow-up PR or issue. Users attempting to access apyds.__version__ as shown in the documentation will encounter an AttributeError after these changes are merged.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1 +1 @@ | |||
| _version.py | |||
|
|
|||
There was a problem hiding this comment.
This .gitignore file is now effectively empty after removing the _version.py entry. Consider removing this file entirely as an empty .gitignore serves no purpose and can be confusing for maintainers.
| # This .gitignore file is intentionally kept without any ignore patterns. | |
| # It documents that the apyds directory does not currently require | |
| # directory-specific ignore rules. Add patterns here in the future if needed. |
Python packages were exporting
__version__while TypeScript packages do not, creating API inconsistency.Changes
__version__from__all__exports and deletedversion.pymoduleversion_fileconfiguration from[tool.setuptools_scm]sections in both root andbnf/directories_version.pyentry fromapyds/.gitignoreVersion metadata remains accessible via
importlib.metadata.version()but is no longer part of the public API surface.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.