Skip to content

Extract version information to subunit/version.py - #105

Closed
rossburton wants to merge 1 commit into
testing-cabal:masterfrom
rossburton:version
Closed

rossburton wants to merge 1 commit into
testing-cabal:masterfrom
rossburton:version

Conversation

@rossburton

Copy link
Copy Markdown

Move the version number from init.py to a new file, version.py.

This allows setuptools to fetch the version from the module without having to be able to import the main module (and thus have the runtime dependencies present at build time). As such, also remove the no longer needed build dependencies on iso8601 and testtools.

Move the version number from __init__.py to a new file, version.py.

This allows setuptools to fetch the version from the module without
having to be able to import the main module (and thus have the runtime
dependencies present at build time). As such, also remove the no longer
needed build dependencies on iso8601 and testtools.
@rossburton

Copy link
Copy Markdown
Author

Ping?


__version__ = (1, 4, 6, "final", 0)

version_string = ".".join(map(str, __version__[:3]))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

version_string was previously importable as subunit.version_string (it's what pyproject.toml referenced before this PR). This PR only re-exports __version__.

Comment thread python/subunit/version.py
@@ -0,0 +1,32 @@
#

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

perhaps _version.py since so we don't make this part of the public API?

Comment thread python/subunit/version.py
# If the releaselevel is 'final', then the tarball will be major.minor.micro.
# Otherwise it is major.minor.micro~$(revno).

__version__ = (1, 4, 6, "final", 0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you also set this to (1, 4, 7, "dev", 0) while we're changing this?

@rossburton

Copy link
Copy Markdown
Author

It was pointed out to me yesterday that this doesn't actually work, as any importing in subunit will cause the __init__.py to be ran, and that does the imports I was trying to avoid.

As such, closing.

@rossburton rossburton closed this Nov 11, 2026
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