diff --git a/.github/workflows/ci_templates.yaml b/.github/workflows/ci_templates.yaml index 956623f1f..36e690c29 100644 --- a/.github/workflows/ci_templates.yaml +++ b/.github/workflows/ci_templates.yaml @@ -127,6 +127,7 @@ jobs: run: | export SUPERDUPER_TEMPLATE=${{ matrix.template }} export SUPERDUPER_DATA_BACKEND='mongomock://test_db' + cd superduper/templates && ln -s ../../templates/* . && ../../ pytest test/integration/template/test_template.py -s env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 91e34890d..ec35e8702 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Bug Fixes -## [0.3.0](https://github.com/superduper-io/superduper/compare/0.4.0...0.3.0]) (2024-Nov-02) +## [0.4.1](https://github.com/superduper-io/superduper/compare/0.4.1...0.4.0]) (2024-Nov-03) + +#### Changed defaults / behaviours + +#### New Features & Functionality + +#### Bug Fixes + +Include templates data in accessible directory + +## [0.4.0](https://github.com/superduper-io/superduper/compare/0.4.0...0.3.0]) (2024-Nov-02) #### Changed defaults / behaviours diff --git a/Makefile b/Makefile index dfc7408bb..8780def45 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ CURRENT_RELEASE=$(shell git describe --abbrev=0 --tags) CURRENT_COMMIT=$(shell git rev-parse --short HEAD) new_release: ## Release a new version of superduper.io - @python3 superduper/misc/release_tools.py + @python superduper/misc/release_tools.py @echo "** Releasing a version to $(PARENT) parent version" @echo "** Switching to branch release-$(RELEASE_VERSION)" @git checkout -b release-$(RELEASE_VERSION) diff --git a/VERSION b/VERSION index 1d0ba9ea1..267577d47 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.0 +0.4.1 diff --git a/superduper/__init__.py b/superduper/__init__.py index a9adcb11f..1d691c066 100644 --- a/superduper/__init__.py +++ b/superduper/__init__.py @@ -9,7 +9,7 @@ logging = logger.Logging -__version__ = '0.4.0' +__version__ = '0.4.1' from .base.decorators import code diff --git a/superduper/cli/main.py b/superduper/cli/main.py index 81963e24b..de133aa8f 100644 --- a/superduper/cli/main.py +++ b/superduper/cli/main.py @@ -58,7 +58,7 @@ def start( @command(help='Display a template') def inspect(template: str): """Display a template.""" - root = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) + root = os.path.dirname(os.path.dirname(__file__)) from pygments import formatters, highlight, lexers path = f'{root}/templates/{template}/component.json' @@ -98,7 +98,7 @@ def bootstrap( db = superduper(data_backend) existing = db.show('template') if destination is not None: - root = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) + root = os.path.dirname(os.path.dirname(__file__)) template_directory = os.path.join(root, f'templates/{template}') print(template_directory) import shutil diff --git a/superduper/templates/__init__.py b/superduper/templates/__init__.py index 18d3edff5..7d6f03b6b 100644 --- a/superduper/templates/__init__.py +++ b/superduper/templates/__init__.py @@ -3,21 +3,21 @@ from superduper import Template -PARENT = Path(__file__).resolve().parent.parent.parent +PARENT = Path(__file__).resolve().parent def ls(): """List all available templates.""" return [ x.split('.')[0] - for x in os.listdir(PARENT / "templates") - if not x.startswith('.') + for x in os.listdir(PARENT) + if not x.startswith('.') and not x.startswith('__') ] def __getattr__(name: str): - t = Template.read(str(PARENT / "templates" / f"{name}")) - requirements_path = str(PARENT / "templates" / f"{name}" / "requirements.txt") + t = Template.read(str(PARENT / f"{name}")) + requirements_path = str(PARENT / f"{name}" / "requirements.txt") if os.path.exists(requirements_path): with open(requirements_path, 'r') as f: t.requirements = [x.strip() for x in f.read().split('\n') if x]