Skip to content

Remove version exports from Python packages for consistency with TypeScript - #130

Merged
hzhangxyz merged 2 commits into
mainfrom
copilot/remove-version-field-python-package
Dec 20, 2025
Merged

Remove version exports from Python packages for consistency with TypeScript#130
hzhangxyz merged 2 commits into
mainfrom
copilot/remove-version-field-python-package

Conversation

Copilot AI commented Dec 20, 2025

Copy link
Copy Markdown
Contributor

Python packages were exporting __version__ while TypeScript packages do not, creating API inconsistency.

Changes

  • apyds package: Removed __version__ from __all__ exports and deleted version.py module
  • pyproject.toml files: Removed version_file configuration from [tool.setuptools_scm] sections in both root and bnf/ directories
  • gitignore: Removed _version.py entry from apyds/.gitignore

Version metadata remains accessible via importlib.metadata.version() but is no longer part of the public API surface.

Original prompt

This section details on the original issue you should resolve

<issue_title>python包删除version字段</issue_title>
<issue_description>python包保持和ts包的一致性,只导出内容,不再导出version。

setuptools scm不要再write version file。

/和/bnf下面和有一个包,都需要这么做

相关目录下的gitignore可能需要修改</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 20, 2025
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove version field from Python package for consistency Remove version exports from Python packages for consistency with TypeScript Dec 20, 2025
Copilot AI requested a review from hzhangxyz December 20, 2025 04:46
@hzhangxyz
hzhangxyz marked this pull request as ready for review December 20, 2025 05:11
Copilot AI review requested due to automatic review settings December 20, 2025 05:11
@hzhangxyz
hzhangxyz merged commit dec465b into main Dec 20, 2025
63 checks passed

Copilot AI left a comment

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.

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_file configuration 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.

Comment thread apyds/.gitignore
@@ -1 +1 @@
_version.py

Copilot AI Dec 20, 2025

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
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.

python包删除version字段

3 participants