Skip to content

Commit

Permalink
Added version var; fixed script main call
Browse files Browse the repository at this point in the history
  • Loading branch information
dave3d committed Feb 28, 2024
1 parent c09c3aa commit 6107d16
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
7 changes: 0 additions & 7 deletions dicom2stl/__init__.py~

This file was deleted.

13 changes: 13 additions & 0 deletions dicom2stl/utils/parseargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

import argparse

from importlib.metadata import version, PackageNotFoundError

__version__ = "unknown"

try:
__version__ = version("dicom2stl")
except PackageNotFoundError:
# package is not installed
pass


class disableFilter(argparse.Action):
def __call__(self, parser, args, values, option_string=None):
Expand Down Expand Up @@ -104,6 +114,9 @@ def createParser():
help="Dicom series search string",
)

parser.add_argument("--version", action="version", version=f"{__version__}")


# Options that apply to the volumetric portion of the pipeline
vol_group = parser.add_argument_group("Volume options")

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ dynamic = ["dependencies", "version"]
dependencies = {file = ["requirements.txt"]}

[tool.setuptools.packages.find]
exclude = ["docs*", "tests*", "binder*", "utils*", "examples*"]
exclude = ["docs*", "tests*", "binder*", "utils*", "examples*", "tmp*"]

[project.scripts]
dicom2stl = "Dicom2STL:main"
dicom2stl = "dicom2stl.Dicom2STL:main"

[tool.setuptools_scm]
local_scheme = "dirty-tag"
Expand Down

0 comments on commit 6107d16

Please sign in to comment.