From c6a7efe346b482b4eedc34504f304de147206925 Mon Sep 17 00:00:00 2001 From: Berislav Lopac Date: Fri, 3 Feb 2023 20:58:15 +0000 Subject: [PATCH] prepare release --- .gitignore | 3 ++- .semaphore/create-release.yml | 1 + momoa/model.py | 4 ++-- pyproject.toml | 3 +-- release-notes/0.2.0.md | 5 +++++ 5 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 release-notes/0.2.0.md diff --git a/.gitignore b/.gitignore index f66a295..e786b08 100644 --- a/.gitignore +++ b/.gitignore @@ -97,8 +97,9 @@ Pipfile.lock poetry.lock pdm.lock -# PEP 582; used by e.g. github.com/David-OConnor/pyflow +# PEP 582; used by e.g. pyflow and PDM __pypackages__/ +.pdm.toml # Celery stuff celerybeat-schedule diff --git a/.semaphore/create-release.yml b/.semaphore/create-release.yml index 0668b55..138f694 100644 --- a/.semaphore/create-release.yml +++ b/.semaphore/create-release.yml @@ -20,6 +20,7 @@ blocks: jobs: - name: Collect package details and create GitHub release commands: + - python -m pdm config python.use_venv false - RELEASE_VERSION=$(python -m pdm show --version) - 'RELEASE_NOTES_FILE="release-notes/${RELEASE_VERSION}.md"' - 'if [ ! -f "$RELEASE_NOTES_FILE" ]; then echo "The release notes file \"${RELEASE_NOTES_FILE}\" does not exist."; exit 1; fi' diff --git a/momoa/model.py b/momoa/model.py index e35f458..68443c2 100644 --- a/momoa/model.py +++ b/momoa/model.py @@ -78,7 +78,7 @@ def serialize(self): """Validates data and serializes it into JSON-ready format.""" return _serialize_schema_value(self._instance) - @staticmethod + @staticmethod # pragma: no mutate def make_model(schema_class: meta.ObjectMeta) -> Type[Model]: """ Constructs a Model subclass based on the class derived from JSONSchema. @@ -93,7 +93,7 @@ def make_model(schema_class: meta.ObjectMeta) -> Type[Model]: return cast(Type[Model], type(name, (Model,), {"_schema_class": schema_class})) -ModelFactory = Callable[[meta.ObjectMeta], Type[Model]] +ModelFactory = Callable[[meta.ObjectMeta], Type[Model]] # pragma: no mutate def _serialize_schema_value(value: Any) -> Any: diff --git a/pyproject.toml b/pyproject.toml index 118bc98..9992538 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "momoa" -version = "0.1.2" +version = "0.2.0" description = "A library for definition, validation and serialisation of Python objects based on JSONSchema specifications." readme = "README.md" license = {text = "MIT"} @@ -32,7 +32,6 @@ test = [ "mutmut>=2.4.3", "tox>=3.28.0", "tox-pdm>=0.6.1", - "hypothesis-jsonschema>=0.22.0", ] checks = [ "black>=22.12.0", diff --git a/release-notes/0.2.0.md b/release-notes/0.2.0.md new file mode 100644 index 0000000..c4c76e2 --- /dev/null +++ b/release-notes/0.2.0.md @@ -0,0 +1,5 @@ +* support custom model factory +* dev environment improvements: + * use `ruff` instead of `pylint` + * use `pdm` instead of `poetry` + * improve tests using `mutmut`