Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into alternative-table-style
Browse files Browse the repository at this point in the history
  • Loading branch information
nealkruis committed Jan 6, 2025
2 parents e577428 + 274f18c commit 915fd77
Show file tree
Hide file tree
Showing 8 changed files with 871 additions and 767 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
schedule:
- cron: "0 9 * * SUN"
workflow_dispatch:

jobs:
build:
Expand All @@ -12,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
defaults:
run:
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9"]
python-version: ["3.10"]
defaults:
run:
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions lattice/docs/mkdocs_web.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Build web documentation"""

from pathlib import Path
from distutils.dir_util import copy_tree # pylint: disable=deprecated-module
from shutil import copytree
import shutil
from urllib.parse import urlparse
from typing import List
Expand Down Expand Up @@ -345,7 +345,7 @@ def make_specification_page(
# Process template
process_template(template_path, output_path, schema_dir=schema_dir_path)
else:
copy_tree(template_path, output_path)
copytree(template_path, output_path)

title = get_file_basename(template_path, depth=2)

Expand Down
6 changes: 3 additions & 3 deletions lattice/docs/process_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import traceback

from jinja2 import Environment, FileSystemLoader, select_autoescape, TemplateNotFound
from lattice.file_io import load
import yaml

from .schema_table import load_structure_from_object, write_data_model, create_table_from_list
Expand Down Expand Up @@ -135,8 +136,7 @@ def load_yaml_source(schema_dir, source, args_str):
src_path = os.path.join(schema_dir, source + ".schema.yaml")
if not os.path.exists(src_path):
return (make_error_string(f'Schema source "{source}" ("{src_path}") doesn\'t exist!', args_str), None)
with open(src_path, encoding="utf-8", mode="r") as input_file:
data = yaml.load(input_file, Loader=yaml.FullLoader)
data = load(src_path)
return (None, data)


Expand Down Expand Up @@ -221,7 +221,7 @@ def make_add_yaml_table():
"""

def add_yaml_table(content, caption=None):
table_data = yaml.load(content, Loader=yaml.FullLoader)
table_data = yaml.load(content, Loader=yaml.CLoader)
columns = table_data["Headers"]
data = {}
for i, column in enumerate(columns):
Expand Down
2 changes: 1 addition & 1 deletion lattice/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def load(input_file_path) -> dict:
return cbor2.load(input_file)
elif ext in [".yaml", ".yml"]:
with open(input_file_path, "r", encoding="utf-8") as input_file:
return yaml.load(input_file, Loader=yaml.FullLoader)
return yaml.load(input_file, Loader=yaml.CLoader)
else:
raise ValueError(f'Unsupported input "{ext}".')

Expand Down
3 changes: 1 addition & 2 deletions lattice/meta_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ def __init__(self, schema_path):
self.validator = jsonschema.Draft7Validator(json.load(meta_schema_file), resolver=resolver)

def validate(self, instance_path):
with open(os.path.join(instance_path), "r") as input_file:
instance = yaml.load(input_file, Loader=yaml.FullLoader)
instance = load(instance_path)
errors = sorted(self.validator.iter_errors(instance), key=lambda e: e.path)
file_name = os.path.basename(instance_path)
if len(errors) == 0:
Expand Down
1,604 changes: 853 additions & 751 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ keywords = ["data-modeling", "schema", "lattice"]
repository = "https://github.com/bigladder/lattice"

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.10"
jsonschema = "*"
pyyaml = "*"
cbor2 = "*"
Jinja2 = "^3.1.4"
stringcase = "1.2.0"
pygit2 = "^1.13.0"
Jinja2 = ">=3.1.4"
stringcase = ">=1.2.0"
pygit2 = ">=1.15.1"
mkdocs-material = "*"
markdown-grid-tables = "*"

[tool.poetry.group.dev.dependencies]
pytest = "^7.1.3"
pytest = ">=7.1.3"
doit = "*"
pylint = "*"
black = "*"
tomli = "2.0.1"

[tool.poetry.group.extras.dependencies]
pyinstrument = "*"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit 915fd77

Please sign in to comment.