From c9967b0d407b55c9bafe800d0e7fb3aea6873657 Mon Sep 17 00:00:00 2001 From: Andrew Brookins Date: Fri, 22 Oct 2021 06:36:15 -0700 Subject: [PATCH] Rename to redis_om --- Makefile | 2 +- README.md | 18 +++++++++--------- pyproject.toml | 4 ++-- {redis_developer => redis_om}/__init__.py | 0 {redis_developer => redis_om}/connections.py | 0 .../model/__init__.py | 0 .../model/cli/__init__.py | 0 .../model/cli/migrate.py | 4 ++-- .../model/encoders.py | 0 .../model/migrations/__init__.py | 0 .../model/migrations/migrator.py | 4 ++-- {redis_developer => redis_om}/model/model.py | 2 +- {redis_developer => redis_om}/model/models.py | 6 +++--- .../model/query_resolver.py | 2 +- .../model/render_tree.py | 0 .../model/token_escaper.py | 0 tests/conftest.py | 4 ++-- tests/test_hash_model.py | 6 +++--- tests/test_json_model.py | 6 +++--- 19 files changed, 29 insertions(+), 29 deletions(-) rename {redis_developer => redis_om}/__init__.py (100%) rename {redis_developer => redis_om}/connections.py (100%) rename {redis_developer => redis_om}/model/__init__.py (100%) rename {redis_developer => redis_om}/model/cli/__init__.py (100%) rename {redis_developer => redis_om}/model/cli/migrate.py (72%) rename {redis_developer => redis_om}/model/encoders.py (100%) rename {redis_developer => redis_om}/model/migrations/__init__.py (100%) rename {redis_developer => redis_om}/model/migrations/migrator.py (97%) rename {redis_developer => redis_om}/model/model.py (99%) rename {redis_developer => redis_om}/model/models.py (75%) rename {redis_developer => redis_om}/model/query_resolver.py (97%) rename {redis_developer => redis_om}/model/render_tree.py (100%) rename {redis_developer => redis_om}/model/token_escaper.py (100%) diff --git a/Makefile b/Makefile index fa06195..9c88b0b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -NAME := redis_developer +NAME := redis_om INSTALL_STAMP := .install.stamp POETRY := $(shell command -v poetry 2> /dev/null) diff --git a/README.md b/README.md index 246dfd4..950ad06 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Check out this example: import datetime from typing import Optional -from redis_developer.model import ( +from redis_om.model import ( EmbeddedJsonModel, JsonModel, Field, @@ -172,9 +172,9 @@ Don't want to run Redis yourself? RediSearch and RedisJSON are also available on We'd love your contributions! -**Bug reports** are especially helpful at this stage of the project. [You can open a bug report on GitHub](https://github.com/redis-developer/redis-developer-python/issues/new). +**Bug reports** are especially helpful at this stage of the project. [You can open a bug report on GitHub](https://github.com/redis-om/redis-om-python/issues/new). -You can also **contribute documentation** -- or just let us know if something needs more detail. [Open an issue on GitHub](https://github.com/redis-developer/redis-developer-python/issues/new) to get started. +You can also **contribute documentation** -- or just let us know if something needs more detail. [Open an issue on GitHub](https://github.com/redis-om/redis-om-python/issues/new) to get started. ## License @@ -184,17 +184,17 @@ Redis OM is [MIT licensed][license-url]. [version-svg]: https://img.shields.io/pypi/v/redis-om?style=flat-square [package-url]: https://pypi.org/project/redis-om/ -[ci-svg]: https://img.shields.io/github/workflow/status/redis-developer/redis-developer-python/python?style=flat-square -[ci-url]: https://github.com/redis-developer/redis-developer-python/actions/workflows/build.yml +[ci-svg]: https://img.shields.io/github/workflow/status/redis-om/redis-om-python/python?style=flat-square +[ci-url]: https://github.com/redis-om/redis-om-python/actions/workflows/build.yml [license-image]: http://img.shields.io/badge/license-MIT-green.svg?style=flat-square [license-url]: LICENSE -[redis-developer-website]: https://developer.redis.com -[redis-om-js]: https://github.com/redis-developer/redis-om-js -[redis-om-dotnet]: https://github.com/redis-developer/redis-om-dotnet -[redis-om-spring]: https://github.com/redis-developer/redis-om-spring +[redis-om-website]: https://developer.redis.com +[redis-om-js]: https://github.com/redis-om/redis-om-js +[redis-om-dotnet]: https://github.com/redis-om/redis-om-dotnet +[redis-om-spring]: https://github.com/redis-om/redis-om-spring [redisearch-url]: https://oss.redis.com/redisearch/ [redis-json-url]: https://oss.redis.com/redisjson/ [pydantic-url]: https://github.com/samuelcolvin/pydantic diff --git a/pyproject.toml b/pyproject.toml index 4f56fe3..601cf08 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "redis-developer" +name = "redis-om" version = "0.1.0" description = "A high-level library containing useful Redis abstractions and tools, like an ORM and leaderboard." authors = ["Andrew Brookins "] @@ -33,7 +33,7 @@ pytest-xdist = "^2.4.0" [tool.poetry.scripts] -migrate = "redis_developer.orm.cli.migrate:migrate" +migrate = "redis_om.orm.cli.migrate:migrate" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/redis_developer/__init__.py b/redis_om/__init__.py similarity index 100% rename from redis_developer/__init__.py rename to redis_om/__init__.py diff --git a/redis_developer/connections.py b/redis_om/connections.py similarity index 100% rename from redis_developer/connections.py rename to redis_om/connections.py diff --git a/redis_developer/model/__init__.py b/redis_om/model/__init__.py similarity index 100% rename from redis_developer/model/__init__.py rename to redis_om/model/__init__.py diff --git a/redis_developer/model/cli/__init__.py b/redis_om/model/cli/__init__.py similarity index 100% rename from redis_developer/model/cli/__init__.py rename to redis_om/model/cli/__init__.py diff --git a/redis_developer/model/cli/migrate.py b/redis_om/model/cli/migrate.py similarity index 72% rename from redis_developer/model/cli/migrate.py rename to redis_om/model/cli/migrate.py index 28880c0..5c3c442 100644 --- a/redis_developer/model/cli/migrate.py +++ b/redis_om/model/cli/migrate.py @@ -1,10 +1,10 @@ import click -from redis_developer.model.migrations.migrator import Migrator +from redis_om.model.migrations.migrator import Migrator @click.command() -@click.option("--module", default="redis_developer") +@click.option("--module", default="redis_om") def migrate(module): migrator = Migrator(module) diff --git a/redis_developer/model/encoders.py b/redis_om/model/encoders.py similarity index 100% rename from redis_developer/model/encoders.py rename to redis_om/model/encoders.py diff --git a/redis_developer/model/migrations/__init__.py b/redis_om/model/migrations/__init__.py similarity index 100% rename from redis_developer/model/migrations/__init__.py rename to redis_om/model/migrations/__init__.py diff --git a/redis_developer/model/migrations/migrator.py b/redis_om/model/migrations/migrator.py similarity index 97% rename from redis_developer/model/migrations/migrator.py rename to redis_om/model/migrations/migrator.py index 027a6c3..daf4c47 100644 --- a/redis_developer/model/migrations/migrator.py +++ b/redis_om/model/migrations/migrator.py @@ -6,8 +6,8 @@ from typing import Optional from redis import ResponseError -from redis_developer.connections import get_redis_connection -from redis_developer.model.model import model_registry +from redis_om.connections import get_redis_connection +from redis_om.model.model import model_registry redis = get_redis_connection() diff --git a/redis_developer/model/model.py b/redis_om/model/model.py similarity index 99% rename from redis_developer/model/model.py rename to redis_om/model/model.py index 168f49c..84f6c9c 100644 --- a/redis_developer/model/model.py +++ b/redis_om/model/model.py @@ -521,7 +521,7 @@ class FindQuery: # this is not going to work. log.warning( "Your query against the field %s is for a single character, %s, " - "that is used internally by redis-developer-python. We must ignore " + "that is used internally by redis-om-python. We must ignore " "this portion of the query. Please review your query to find " "an alternative query that uses a string containing more than " "just the character %s.", diff --git a/redis_developer/model/models.py b/redis_om/model/models.py similarity index 75% rename from redis_developer/model/models.py rename to redis_om/model/models.py index c6c1a5c..81655e5 100644 --- a/redis_developer/model/models.py +++ b/redis_om/model/models.py @@ -1,17 +1,17 @@ import abc from typing import Optional -from redis_developer.model.model import HashModel, JsonModel +from redis_om.model.model import HashModel, JsonModel class BaseJsonModel(JsonModel, abc.ABC): class Meta: - global_key_prefix = "redis-developer" + global_key_prefix = "redis-om" class BaseHashModel(HashModel, abc.ABC): class Meta: - global_key_prefix = "redis-developer" + global_key_prefix = "redis-om" # class AddressJson(BaseJsonModel): diff --git a/redis_developer/model/query_resolver.py b/redis_om/model/query_resolver.py similarity index 97% rename from redis_developer/model/query_resolver.py rename to redis_om/model/query_resolver.py index 8616c92..f27fc36 100644 --- a/redis_developer/model/query_resolver.py +++ b/redis_om/model/query_resolver.py @@ -1,7 +1,7 @@ from collections import Sequence from typing import Any, Dict, List, Mapping, Union -from redis_developer.model.model import Expression +from redis_om.model.model import Expression class LogicalOperatorForListOfExpressions(Expression): diff --git a/redis_developer/model/render_tree.py b/redis_om/model/render_tree.py similarity index 100% rename from redis_developer/model/render_tree.py rename to redis_om/model/render_tree.py diff --git a/redis_developer/model/token_escaper.py b/redis_om/model/token_escaper.py similarity index 100% rename from redis_developer/model/token_escaper.py rename to redis_om/model/token_escaper.py diff --git a/tests/conftest.py b/tests/conftest.py index 807deb3..5269b4c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,7 @@ import random import pytest from redis import Redis -from redis_developer.connections import get_redis_connection +from redis_om.connections import get_redis_connection @pytest.fixture @@ -21,7 +21,7 @@ def _delete_test_keys(prefix: str, conn: Redis): @pytest.fixture def key_prefix(redis): - key_prefix = f"redis-developer:{random.random()}" + key_prefix = f"redis-om:{random.random()}" yield key_prefix _delete_test_keys(key_prefix, redis) diff --git a/tests/test_hash_model.py b/tests/test_hash_model.py index 3705a84..e67a42e 100644 --- a/tests/test_hash_model.py +++ b/tests/test_hash_model.py @@ -8,9 +8,9 @@ from unittest import mock import pytest from pydantic import ValidationError -from redis_developer.model import Field, HashModel -from redis_developer.model.migrations.migrator import Migrator -from redis_developer.model.model import ( +from redis_om.model import Field, HashModel +from redis_om.model.migrations.migrator import Migrator +from redis_om.model.model import ( NotFoundError, QueryNotSupportedError, RedisModelError, diff --git a/tests/test_json_model.py b/tests/test_json_model.py index ffa6594..5cd20af 100644 --- a/tests/test_json_model.py +++ b/tests/test_json_model.py @@ -8,9 +8,9 @@ from unittest import mock import pytest from pydantic import ValidationError -from redis_developer.model import EmbeddedJsonModel, Field, JsonModel -from redis_developer.model.migrations.migrator import Migrator -from redis_developer.model.model import ( +from redis_om.model import EmbeddedJsonModel, Field, JsonModel +from redis_om.model.migrations.migrator import Migrator +from redis_om.model.model import ( NotFoundError, QueryNotSupportedError, RedisModelError,