scjson 0.1.0__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of scjson might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scjson
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: A JSON-based serialization of SCXML (State Chart XML) for modern tooling, interoperability, and education.
5
5
  Author-email: Ira Abbott <ira@mycloud.blue>
6
6
  License: BSD-1-Clause
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "scjson"
3
- version = "0.1.0"
3
+ version = "0.1.2"
4
4
  description = "A JSON-based serialization of SCXML (State Chart XML) for modern tooling, interoperability, and education."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
@@ -8,6 +8,9 @@ license = {text = "BSD-1-Clause"}
8
8
  authors = [{name = "Ira Abbott", email = "ira@mycloud.blue"}]
9
9
  dependencies = ["pydantic", "lxml", "jsonschema", "click"] # optional
10
10
 
11
+ [project.scripts]
12
+ scjson = "scjson.__main__:main" # Optional: installs as `scjson` shell command
13
+
11
14
  [build-system]
12
15
  requires = ["setuptools>=61.0"]
13
16
  build-backend = "setuptools.build_meta"
@@ -0,0 +1 @@
1
+ """scjson conversion tools."""
@@ -1,15 +1,28 @@
1
1
  import click
2
2
  from pathlib import Path
3
3
  from .SCXMLDocumentHandler import SCXMLDocumentHandler
4
- from . import __version__, __description__, __progname__
5
-
4
+ from importlib.metadata import version, PackageNotFoundError
5
+
6
+ def _get_metadata(pkg="scjson"):
7
+ try:
8
+ return {
9
+ "version": version(pkg),
10
+ "progname": pkg,
11
+ "description": "SCJSON: SCXML ↔ JSON converter"
12
+ }
13
+ except PackageNotFoundError:
14
+ return {
15
+ "version": "unknown (not installed)",
16
+ "progname": pkg,
17
+ "description": "SCJSON (not installed)"
18
+ }
19
+ md = _get_metadata()
6
20
 
7
21
  def _splash() -> None:
8
22
  """Display program header."""
9
- click.echo(f"{__progname__} {__version__} - {__description__}")
10
-
23
+ click.echo(f"{md['progname']} {md['version']} - {md['description']}")
11
24
 
12
- @click.group(help=__description__, invoke_without_command=True)
25
+ @click.group(help=md["description"], invoke_without_command=True)
13
26
  @click.pass_context
14
27
  def main(ctx):
15
28
  """Command line interface for scjson conversions."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scjson
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: A JSON-based serialization of SCXML (State Chart XML) for modern tooling, interoperability, and education.
5
5
  Author-email: Ira Abbott <ira@mycloud.blue>
6
6
  License: BSD-1-Clause
@@ -7,6 +7,7 @@ scjson/cli.py
7
7
  scjson.egg-info/PKG-INFO
8
8
  scjson.egg-info/SOURCES.txt
9
9
  scjson.egg-info/dependency_links.txt
10
+ scjson.egg-info/entry_points.txt
10
11
  scjson.egg-info/requires.txt
11
12
  scjson.egg-info/top_level.txt
12
13
  scjson/dataclasses/__init__.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ scjson = scjson.__main__:main
@@ -1,7 +0,0 @@
1
- """scjson conversion tools."""
2
-
3
- __progname__ = "scjson"
4
- __description__ = "Convert between scjson and SCXML"
5
- __version__ = "0.1.0"
6
-
7
- __all__ = ["__progname__", "__description__", "__version__"]
File without changes
File without changes
File without changes
File without changes