shacl2code 0.0.3__tar.gz → 0.0.4__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.
Files changed (28) hide show
  1. {shacl2code-0.0.3 → shacl2code-0.0.4}/.github/workflows/publish.yaml +9 -8
  2. {shacl2code-0.0.3 → shacl2code-0.0.4}/.github/workflows/test.yaml +1 -0
  3. {shacl2code-0.0.3 → shacl2code-0.0.4}/PKG-INFO +1 -1
  4. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/__init__.py +1 -0
  5. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/main.py +9 -0
  6. shacl2code-0.0.4/src/shacl2code/version.py +1 -0
  7. {shacl2code-0.0.3 → shacl2code-0.0.4}/tests/test_cli.py +15 -0
  8. shacl2code-0.0.3/src/shacl2code/version.py +0 -1
  9. {shacl2code-0.0.3 → shacl2code-0.0.4}/.gitignore +0 -0
  10. {shacl2code-0.0.3 → shacl2code-0.0.4}/LICENSE +0 -0
  11. {shacl2code-0.0.3 → shacl2code-0.0.4}/README.md +0 -0
  12. {shacl2code-0.0.3 → shacl2code-0.0.4}/conftest.py +0 -0
  13. {shacl2code-0.0.3 → shacl2code-0.0.4}/pyproject.toml +0 -0
  14. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/__main__.py +0 -0
  15. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/const.py +0 -0
  16. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/lang/__init__.py +0 -0
  17. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/lang/common.py +0 -0
  18. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/lang/lang.py +0 -0
  19. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/lang/python.py +0 -0
  20. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/lang/raw.py +0 -0
  21. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/model.py +0 -0
  22. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/templates/python.j2 +0 -0
  23. {shacl2code-0.0.3 → shacl2code-0.0.4}/src/shacl2code/templates/raw.j2 +0 -0
  24. {shacl2code-0.0.3 → shacl2code-0.0.4}/tests/data/spdx3-model.jsonld +0 -0
  25. {shacl2code-0.0.3 → shacl2code-0.0.4}/tests/expect/python/spdx3.py +0 -0
  26. {shacl2code-0.0.3 → shacl2code-0.0.4}/tests/expect/raw/spdx3.txt +0 -0
  27. {shacl2code-0.0.3 → shacl2code-0.0.4}/tests/test_python.py +0 -0
  28. {shacl2code-0.0.3 → shacl2code-0.0.4}/tests/test_raw.py +0 -0
@@ -1,10 +1,18 @@
1
1
  ---
2
2
  name: Upload Python Package
3
3
  on:
4
- - push
4
+ release:
5
+ types:
6
+ - published
5
7
 
6
8
  jobs:
9
+ test:
10
+ uses: ./.github/workflows/test.yaml
11
+
7
12
  deploy:
13
+ needs:
14
+ - test
15
+
8
16
  runs-on: ubuntu-latest
9
17
  permissions:
10
18
  id-token: write
@@ -25,12 +33,5 @@ jobs:
25
33
  - name: Build package
26
34
  run: python -m build
27
35
 
28
- - name: Publish distribution to Test PyPI
29
- uses: pypa/gh-action-pypi-publish@release/v1
30
- with:
31
- repository-url: https://test.pypi.org/legacy/
32
- skip-existing: true
33
-
34
36
  - name: Publish distribution to PyPI
35
- if: startsWith(github.ref, 'refs/tags')
36
37
  uses: pypa/gh-action-pypi-publish@release/v1
@@ -3,6 +3,7 @@ name: Test shacl2code
3
3
  on:
4
4
  - push
5
5
  - pull_request
6
+ - workflow_call
6
7
 
7
8
  jobs:
8
9
  build:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: shacl2code
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Convert SHACL model file to code bindings
5
5
  Project-URL: Homepage, https://github.com/JPEWdev/shacl2code
6
6
  Project-URL: Repository, https://github.com/JPEWdev/shacl2code.git
@@ -1,2 +1,3 @@
1
1
  from .model import Model
2
2
  from .main import main
3
+ from .version import VERSION
@@ -40,6 +40,12 @@ def main():
40
40
  else:
41
41
  print(f"{k:{width}} - {v.HELP}")
42
42
 
43
+ return 0
44
+
45
+ def handle_version(args):
46
+ print(VERSION)
47
+ return 0
48
+
43
49
  parser = argparse.ArgumentParser(
44
50
  description=f"Convert JSON-LD model to python. Version {VERSION}"
45
51
  )
@@ -79,6 +85,9 @@ def main():
79
85
  )
80
86
  list_parser.set_defaults(func=handle_list)
81
87
 
88
+ version_parser = command_subparser.add_parser("version", help="Show version")
89
+ version_parser.set_defaults(func=handle_version)
90
+
82
91
  args = parser.parse_args()
83
92
 
84
93
  return args.func(args)
@@ -0,0 +1 @@
1
+ VERSION = "0.0.4"
@@ -6,6 +6,7 @@
6
6
  import subprocess
7
7
 
8
8
  from shacl2code.lang import LANGUAGES
9
+ from shacl2code import VERSION
9
10
 
10
11
 
11
12
  def test_shacl2code_exists():
@@ -27,3 +28,17 @@ def test_lang_list():
27
28
  )
28
29
 
29
30
  assert sorted(p.stdout.splitlines()) == sorted(LANGUAGES.keys())
31
+
32
+
33
+ def test_version():
34
+ """
35
+ Tests that the version subcommand works
36
+ """
37
+ p = subprocess.run(
38
+ ["shacl2code", "version"],
39
+ check=True,
40
+ stdout=subprocess.PIPE,
41
+ encoding="utf-8",
42
+ )
43
+
44
+ assert p.stdout.rstrip() == VERSION
@@ -1 +0,0 @@
1
- VERSION = "0.0.3"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes