Skip to content

Commit 6bfb322

Browse files
authored
initial addition of files
1 parent de8a947 commit 6bfb322

File tree

10 files changed

+325
-0
lines changed

10 files changed

+325
-0
lines changed

.github/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
changelog:
2+
exclude:
3+
authors: [github-actions, pre-commit-ci]
4+
categories:
5+
- title: 💥 Incompatible API Changes
6+
labels: [breaking, refactor]
7+
- title: 💡 Added Functionalities (Backward Compatible)
8+
labels: [feature, enhancement, DX, UX, docs, tests]
9+
- title: 🛠 Backward Compatible Bug Fixes And Minor Changes (Backward Compatible)
10+
labels: [dependencies, fix, datamodel, pkg]

.github/workflows/actions.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Installing and Testing
2+
on: [push]
3+
4+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
5+
# `contents` is for permission to the contents of the repository.
6+
# `pull-requests` is for permission to pull request
7+
permissions:
8+
contents: write
9+
checks: write
10+
pull-requests: write
11+
12+
env:
13+
UV_SYSTEM_PYTHON: true
14+
15+
jobs:
16+
install-and-test:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python_version: ["3.10", "3.11", "3.12"]
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up Python ${{matrix.python_version}}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{matrix.python_version}}
28+
- name: Install uv
29+
run: |
30+
curl -LsSf https://astral.sh/uv/install.sh | sh
31+
- name: Install dependencies
32+
run: |
33+
pip install --upgrade pip
34+
uv pip install -e '.[dev]'
35+
- name: Test with pytest
36+
run: |
37+
python -m pytest -sv tests
38+
build-and-install:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Set up Python 3.12
43+
uses: actions/setup-python@v5
44+
with:
45+
python-version: 3.12
46+
- name: Install uv
47+
run: |
48+
curl -LsSf https://astral.sh/uv/install.sh | sh
49+
- name: Build the package
50+
run: |
51+
uv pip install build
52+
python -m build --sdist
53+
- name: Install the package
54+
run: |
55+
uv pip install dist/*.tar.gz
56+
ruff-linting:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: chartboost/ruff-action@v1
61+
with:
62+
args: "check ."
63+
ruff-formatting:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: chartboost/ruff-action@v1
68+
with:
69+
args: "format . --check --verbose"

.github/workflows/coveralls.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Testing with coveralls Report
2+
on: [push]
3+
4+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
5+
# `contents` is for permission to the contents of the repository.
6+
# `pull-requests` is for permission to pull request
7+
permissions:
8+
contents: write
9+
checks: write
10+
pull-requests: write
11+
12+
env:
13+
UV_SYSTEM_PYTHON: true
14+
15+
jobs:
16+
coveralls-test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Python 3.12
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.12
24+
- name: Install uv
25+
run: |
26+
curl -LsSf https://astral.sh/uv/install.sh | sh
27+
- name: Install dependencies
28+
run: |
29+
uv pip install -e '.[dev]'
30+
uv pip install coveralls
31+
- name: Build coverage file
32+
run: |
33+
pytest --cov-config=.coveragerc --junitxml=pytest.xml --cov=backend tests | tee pytest-coverage.txt
34+
- name: Pytest coverage comment
35+
uses: MishaKav/pytest-coverage-comment@main
36+
with:
37+
pytest-coverage-path: pytest-coverage.txt
38+
junitxml-path: pytest.xml
39+
- name: Submit to coveralls
40+
continue-on-error: true
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: |
44+
coveralls --service=github

.vscode/settings.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"python.defaultInterpreterPath": ".venv/bin/python",
3+
"python.terminal.activateEnvInCurrentTerminal": true,
4+
"editor.rulers": [90],
5+
"editor.renderWhitespace": "all",
6+
"editor.tabSize": 4,
7+
"[javascript]": {
8+
"editor.tabSize": 2
9+
},
10+
"files.trimTrailingWhitespace": true,
11+
"files.watcherExclude": {
12+
"${workspaceFolder}/.venv/**": true
13+
},
14+
"files.exclude": {
15+
"\"**/*.pyc\": {\"when\": \"$(basename).py\"}": true,
16+
"**/__pycache__": true,
17+
"**/node_modules": true
18+
},
19+
"python.testing.pytestPath": "pytest",
20+
"python.testing.pytestArgs": ["tests"],
21+
"python.testing.unittestEnabled": false,
22+
"editor.defaultFormatter": "charliermarsh.ruff",
23+
"editor.formatOnSave": true,
24+
"editor.codeActionsOnSave": {
25+
"source.organizeImports.ruff": "always",
26+
"source.fixAll.ruff": "always",
27+
},
28+
"launch": {
29+
"version": "0.2.0",
30+
"configurations": [
31+
{
32+
"name": "jsoned Python",
33+
"type": "debugpy",
34+
"request": "launch",
35+
"console": "integratedTerminal",
36+
"justMyCode": false,
37+
"program": "${workspaceFolder}/backend/script.py", // path to your entry point Python module
38+
},
39+
]
40+
},
41+
}

NOTICE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The following files are excluded from the MIT license:
2+
- ./bam_masterdata/datamodel/*
3+
4+
These are proprietary and subject to separate CC BY 4.0 licensing (see ./LICENSE.datamodel).
5+
6+
The main contributors of the datamodel are:
7+
8+
- Angela Ariza de Schellenberger
9+
- Ingo Bressler
10+
- Rukeia El-Athman
11+
- Çağtay Fabry
12+
- Tobias Fritsch
13+
- Ralf Herrmann
14+
- Zoltán Konthur
15+
- Julius Kruse
16+
- Pavlina Kruzikova
17+
- Tarakeshwar Lakshmipathy
18+
- Julien Lecompagnon
19+
- Jan Lisec
20+
- José M. Pizarro
21+
- Mathias Röllig
22+
- Bastian Rühle

backend/__init__.py

Whitespace-only changes.

backend/datamodel.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from pydantic import BaseModel
2+
3+
4+
class SchemaDefinition(BaseModel):
5+
id: str
6+
name: str
7+
version: str
8+
content: dict # JSON schema
9+
updated_at: datetime

pyproject.toml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0.0", "setuptools-scm>=8.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
classifiers = [
7+
"Natural Language :: English",
8+
"Intended Audience :: Science/Research",
9+
"Operating System :: OS Independent",
10+
"Programming Language :: Python",
11+
"Programming Language :: Python :: 3.10",
12+
"Programming Language :: Python :: 3.11",
13+
"Programming Language :: Python :: 3.12",
14+
]
15+
name = "jsoned"
16+
description = "A full-stack application to visualize and edit entities and their relations defined in JSON Schema."
17+
dynamic = ["version"]
18+
readme = "README.md"
19+
requires-python = ">=3.10"
20+
authors = [
21+
{ name = "BAM Data Store", email = "datastore@bam.de" },
22+
]
23+
maintainers = [
24+
{ name = "Jose M. Pizarro", email = "jose.pizarro-blanco@bam.de" },
25+
]
26+
license = { file = "LICENSE" }
27+
dependencies = [
28+
"pydantic~=2.10.5",
29+
"python-decouple",
30+
"structlog==24.4.0",
31+
]
32+
33+
[project.urls]
34+
"Homepage" = "https://github.com/BAMresearch/jsoned"
35+
"Bug Tracker" = "https://github.com/BAMresearch/jsoned/issues"
36+
37+
[project.optional-dependencies]
38+
dev = [
39+
"mypy==1.0.1",
40+
"ruff",
41+
"pytest",
42+
"pytest-timeout",
43+
"pytest-cov",
44+
]
45+
46+
[tool.ruff]
47+
# Exclude a variety of commonly ignored directories.
48+
include = ["backend/*.py", "tests/*.py"]
49+
exclude = [
50+
".bzr",
51+
".direnv",
52+
".eggs",
53+
".git",
54+
".git-rewrite",
55+
".hg",
56+
".mypy_cache",
57+
".nox",
58+
".pants.d",
59+
".pytype",
60+
".ruff_cache",
61+
".svn",
62+
".tox",
63+
".venv",
64+
"__pypackages__",
65+
"_build",
66+
"buck-out",
67+
"build",
68+
"dist",
69+
"node_modules",
70+
"venv",
71+
"dependencies",
72+
"gui",
73+
]
74+
# Same as Black.
75+
line-length = 88
76+
indent-width = 4
77+
78+
[tool.ruff.lint]
79+
select = [
80+
"E", # pycodestyle
81+
"PL", # pylint
82+
"F", # Pyflakes
83+
"UP", # pyupgrade
84+
"I", # isort
85+
]
86+
ignore = [
87+
"F401", # Module imported but unused
88+
"E501", # Line too long ({width} > {limit} characters)
89+
"E701", # Multiple statements on one line (colon)
90+
"E731", # Do not assign a lambda expression, use a def
91+
"E402", # Module level import not at top of file
92+
"PLR0911", # Too many return statements
93+
"PLR0912", # Too many branches
94+
"PLR0913", # Too many arguments in function definition
95+
"PLR0915", # Too many statements
96+
"PLR2004", # Magic value used instead of constant
97+
"PLW0603", # Using the global statement
98+
"PLW2901", # redefined-loop-name
99+
"PLR1714", # consider-using-in
100+
"PLR5501", # else-if-used
101+
]
102+
fixable = ["ALL"]
103+
# Allow unused variables when underscore-prefixed.
104+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
105+
# this is entirely optional, you can remove this if you wish to
106+
[tool.ruff.format]
107+
# use double quotes for strings.
108+
quote-style = "double"
109+
# indent with spaces, rather than tabs.
110+
indent-style = "space"
111+
# Like Black, respect magic trailing commas.
112+
skip-magic-trailing-comma = false
113+
# Like Black, automatically detect the appropriate line ending.
114+
line-ending = "auto"
115+
116+
[tool.mypy]
117+
strict = false
118+
ignore_missing_imports = true
119+
follow_imports = "silent"
120+
no_strict_optional = true
121+
disable_error_code = "import, annotation-unchecked"
122+
123+
[tool.setuptools.packages.find]
124+
where = ["."]
125+
namespaces = false
126+
127+
[tool.setuptools_scm]
128+
write_to = "backend/_version.py"

tests/__init__.py

Whitespace-only changes.

tests/test_dummy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_dummy():
2+
assert True

0 commit comments

Comments
 (0)