Skip to content

Add version option to cli and dynamic versioning #144

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

Merged
merged 2 commits into from
Aug 19, 2024
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
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ lxml = ">=4.9.1"
llm = ">=0.12"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "pep440"

[tool.poetry.scripts]
schemauto = "schema_automator.cli:main"
Expand Down
8 changes: 8 additions & 0 deletions schema_automator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from importlib import metadata

from schema_automator.annotators import *
from schema_automator.importers import *
from schema_automator.generalizers import *

try:
__version__ = metadata.version(__package__)
except metadata.PackageNotFoundError:
# package is not installed
__version__ = "0.0.0" # pragma: no cover
2 changes: 2 additions & 0 deletions schema_automator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from schema_automator.importers.sql_import_engine import SqlImportEngine
from schema_automator.importers.tabular_import_engine import TableImportEngine
from schema_automator.utils.schemautils import write_schema
from schema_automator import __version__

input_option = click.option(
"-i",
Expand Down Expand Up @@ -80,6 +81,7 @@
help="Set the level of verbosity")
@click.option("-q", "--quiet",
help="Silence all diagnostics")
@click.version_option(__version__, "-V", "--version")
def main(verbose: int, quiet: bool):
"""Run the LinkML Schema Automator Command Line.

Expand Down
Loading