Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --version #134

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ prun() { echo -e "\n$RED\$ $@ $NORMAL\n" ; "$@" ; }

prun cd example_pkg

prun spin --version
prun spin build

# Test spin run
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[project]
name = "spin"
version = "0.8rc0.dev0"
requires-python = ">=3.8"
description = "Developer tool for scientific Python libraries"
readme = "README.md"
Expand Down Expand Up @@ -28,6 +27,7 @@ dependencies = [
"tomli; python_version < '3.11'",
"colorama; platform_system == 'Windows'"
]
dynamic = ['version']

[project.scripts]
spin = "spin.__main__:main"
Expand All @@ -39,6 +39,9 @@ dev = ["changelist == 0.4"]
[project.urls]
homepage = "https://github.com/scientific-python/spin"

[tool.setuptools.dynamic.version]
attr = 'spin.__version__'

[tool.setuptools.packages.find]
include = ["spin*"]

Expand Down
2 changes: 2 additions & 0 deletions spin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Read more at https://github.com/scientific-python/spin
"""

__version__ = "0.8rc0.dev0"

from .cmds import util

__all__ = ["util"]
2 changes: 2 additions & 0 deletions spin/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import click

from spin import __version__
from spin import cmds as _cmds
from spin.color_format import ColorHelpFormatter
from spin.containers import DotDict
Expand Down Expand Up @@ -60,6 +61,7 @@ def load_toml(filename):
)

@click.group(help=f"Developer tool for {proj_name}", cls=SectionedHelpGroup)
@click.version_option(__version__, message="%(prog)s %(version)s")
@click.pass_context
def group(ctx):
ctx.meta["config"] = toml_config
Expand Down
Loading