From a0a0592eb96e88d40b19d1291932fcb2fd101522 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Tue, 12 Nov 2024 10:11:06 +0800 Subject: [PATCH] feat: update path --- .coveragerc | 2 +- CHANGELOG.md | 28 +++++++++---------- README.md | 16 +++++------ pyproject.toml | 6 ++-- .../__init__.py | 0 .../options.py | 0 .../watcher.py | 2 +- tests/test_redis_watcher.py | 2 +- 8 files changed, 28 insertions(+), 28 deletions(-) rename {casbin_redis_watcher => redis_watcher}/__init__.py (100%) rename {casbin_redis_watcher => redis_watcher}/options.py (100%) rename {casbin_redis_watcher => redis_watcher}/watcher.py (99%) diff --git a/.coveragerc b/.coveragerc index 239f2f4..a9307d0 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,2 @@ [run] -include = casbin_redis_watcher/* \ No newline at end of file +include = redis_watcher/* \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c7504d3..63cf139 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,50 +1,50 @@ # Semantic Versioning Changelog -# [1.3.0](https://github.com/pycasbin/redis-watcher/compare/v1.2.0...v1.3.0) (2024-03-29) +# [1.3.0](https://github.com/officialpycasbin/redis-watcher/compare/v1.2.0...v1.3.0) (2024-03-29) ### Features -* upgrade CI Node.js version to 20 ([13ee383](https://github.com/pycasbin/redis-watcher/commit/13ee383b78114b2c7edddb087c4df4d4e3704644)) +* upgrade CI Node.js version to 20 ([13ee383](https://github.com/officialpycasbin/redis-watcher/commit/13ee383b78114b2c7edddb087c4df4d4e3704644)) -# [1.2.0](https://github.com/pycasbin/redis-watcher/compare/v1.1.1...v1.2.0) (2023-10-30) +# [1.2.0](https://github.com/officialpycasbin/redis-watcher/compare/v1.1.1...v1.2.0) (2023-10-30) ### Features -* migrate from setup.py to pyproject.toml ([#12](https://github.com/pycasbin/redis-watcher/issues/12)) ([4bc0a3a](https://github.com/pycasbin/redis-watcher/commit/4bc0a3a3d9d43ca5413ba30c8912d7be5d207a8b)) +* migrate from setup.py to pyproject.toml ([#12](https://github.com/officialpycasbin/redis-watcher/issues/12)) ([4bc0a3a](https://github.com/officialpycasbin/redis-watcher/commit/4bc0a3a3d9d43ca5413ba30c8912d7be5d207a8b)) -## [1.1.1](https://github.com/pycasbin/redis-watcher/compare/v1.1.0...v1.1.1) (2023-04-08) +## [1.1.1](https://github.com/officialpycasbin/redis-watcher/compare/v1.1.0...v1.1.1) (2023-04-08) ### Bug Fixes -* compatibility with later casbin patches ([#11](https://github.com/pycasbin/redis-watcher/issues/11)) ([f5dba83](https://github.com/pycasbin/redis-watcher/commit/f5dba836b9397fb6bf8b97b47c81b156ed2ec04f)) +* compatibility with later casbin patches ([#11](https://github.com/officialpycasbin/redis-watcher/issues/11)) ([f5dba83](https://github.com/officialpycasbin/redis-watcher/commit/f5dba836b9397fb6bf8b97b47c81b156ed2ec04f)) -# [1.1.0](https://github.com/pycasbin/redis-watcher/compare/v1.0.1...v1.1.0) (2023-03-22) +# [1.1.0](https://github.com/officialpycasbin/redis-watcher/compare/v1.0.1...v1.1.0) (2023-03-22) ### Features -* Add ssl option ([#10](https://github.com/pycasbin/redis-watcher/issues/10)) ([b025d29](https://github.com/pycasbin/redis-watcher/commit/b025d29c798249394eb9611e7d3611a3df6c53a7)) +* Add ssl option ([#10](https://github.com/officialpycasbin/redis-watcher/issues/10)) ([b025d29](https://github.com/officialpycasbin/redis-watcher/commit/b025d29c798249394eb9611e7d3611a3df6c53a7)) -## [1.0.1](https://github.com/pycasbin/redis-watcher/compare/v1.0.0...v1.0.1) (2022-08-07) +## [1.0.1](https://github.com/officialpycasbin/redis-watcher/compare/v1.0.0...v1.0.1) (2022-08-07) ### Bug Fixes -* add publish watcher and small fix ([#9](https://github.com/pycasbin/redis-watcher/issues/9)) ([9319159](https://github.com/pycasbin/redis-watcher/commit/93191590ef16f403a52b92571420bec2e515b687)) +* add publish watcher and small fix ([#9](https://github.com/officialpycasbin/redis-watcher/issues/9)) ([9319159](https://github.com/officialpycasbin/redis-watcher/commit/93191590ef16f403a52b92571420bec2e515b687)) # 1.0.0 (2022-07-25) ### Bug Fixes -* change the lint config ([22df8c7](https://github.com/pycasbin/redis-watcher/commit/22df8c7ab672ab1bff000ed20720058e783a8e83)) +* change the lint config ([22df8c7](https://github.com/officialpycasbin/redis-watcher/commit/22df8c7ab672ab1bff000ed20720058e783a8e83)) ### Features -* add functions to watcher ([#5](https://github.com/pycasbin/redis-watcher/issues/5)) ([705ba31](https://github.com/pycasbin/redis-watcher/commit/705ba31a82ba5661b3fad901726f688af869595c)) -* add semantic release, lint and small fix ([b2f0f6c](https://github.com/pycasbin/redis-watcher/commit/b2f0f6c189e7c0e5ec9e6a8781a4b65d75720078)) -* build main functions, add unit test and add readme ([#6](https://github.com/pycasbin/redis-watcher/issues/6)) ([416f6e3](https://github.com/pycasbin/redis-watcher/commit/416f6e3596fcac4fa36845670c35d2259756635f)) +* add functions to watcher ([#5](https://github.com/officialpycasbin/redis-watcher/issues/5)) ([705ba31](https://github.com/officialpycasbin/redis-watcher/commit/705ba31a82ba5661b3fad901726f688af869595c)) +* add semantic release, lint and small fix ([b2f0f6c](https://github.com/officialpycasbin/redis-watcher/commit/b2f0f6c189e7c0e5ec9e6a8781a4b65d75720078)) +* build main functions, add unit test and add readme ([#6](https://github.com/officialpycasbin/redis-watcher/issues/6)) ([416f6e3](https://github.com/officialpycasbin/redis-watcher/commit/416f6e3596fcac4fa36845670c35d2259756635f)) diff --git a/README.md b/README.md index f7a945a..c4f45ec 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,25 @@ # redis-watcher -[![GitHub Action](https://github.com/pycasbin/redis-watcher/workflows/build/badge.svg?branch=master)](https://github.com/pycasbin/redis-watcher/actions) -[![Coverage Status](https://coveralls.io/repos/github/pycasbin/redis-watcher/badge.svg)](https://coveralls.io/github/pycasbin/redis-watcher) -[![Version](https://img.shields.io/pypi/v/casbin-redis-watcher.svg)](https://pypi.org/project/casbin-redis-watcher/) -[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin-redis-watcher.svg)](https://pypi.org/project/casbin-redis-watcher/) -[![Pyversions](https://img.shields.io/pypi/pyversions/casbin-redis-watcher.svg)](https://pypi.org/project/casbin-redis-watcher/) -[![Download](https://img.shields.io/pypi/dm/casbin-redis-watcher.svg)](https://pypi.org/project/casbin-redis-watcher/) +[![GitHub Action](https://github.com/officialpycasbin/redis-watcher/workflows/build/badge.svg?branch=master)](https://github.com/officialpycasbin/redis-watcher/actions) +[![Coverage Status](https://coveralls.io/repos/github/officialpycasbin/redis-watcher/badge.svg)](https://coveralls.io/github/officialpycasbin/redis-watcher) +[![Version](https://img.shields.io/pypi/v/redis-watcher.svg)](https://pypi.org/project/redis-watcher/) +[![PyPI - Wheel](https://img.shields.io/pypi/wheel/redis-watcher.svg)](https://pypi.org/project/redis-watcher/) +[![Pyversions](https://img.shields.io/pypi/pyversions/redis-watcher.svg)](https://pypi.org/project/redis-watcher/) +[![Download](https://img.shields.io/pypi/dm/redis-watcher.svg)](https://pypi.org/project/redis-watcher/) [![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/S5UjpzGZjN) redis-watcher is the [Redis](https://github.com/redis/redis) watcher for [pycasbin](https://github.com/casbin/pycasbin). With this library, Casbin can synchronize the policy with the database in multiple enforcer instances. ## Installation - pip install casbin-redis-watcher + pip install redis-watcher ## Simple Example ```python import os import casbin -from casbin_redis_watcher import new_watcher, WatcherOptions +from redis_watcher import new_watcher, WatcherOptions def callback_function(event): print("update for remove filtered policy callback, event: {}".format(event)) diff --git a/pyproject.toml b/pyproject.toml index 3298c9a..9684b58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [project] -name = "casbin-redis-watcher" +name = "redis-watcher" version = "1.3.0" authors = [ - {name = "nekotoxin", email = "nekotoxin@gmail.com"}, + {name = "Casbin", email = "admin@casbin.org"}, ] description = "Casbin role watcher to be used for monitoring updates to policies for PyCasbin" readme = "README.md" @@ -18,7 +18,7 @@ classifiers = [ ] [project.urls] -"Home-page" = "https://github.com/pycasbin/redis-watcher" +"Home-page" = "https://github.com/officialpycasbin/redis-watcher" [build-system] requires = ["setuptools"] diff --git a/casbin_redis_watcher/__init__.py b/redis_watcher/__init__.py similarity index 100% rename from casbin_redis_watcher/__init__.py rename to redis_watcher/__init__.py diff --git a/casbin_redis_watcher/options.py b/redis_watcher/options.py similarity index 100% rename from casbin_redis_watcher/options.py rename to redis_watcher/options.py diff --git a/casbin_redis_watcher/watcher.py b/redis_watcher/watcher.py similarity index 99% rename from casbin_redis_watcher/watcher.py rename to redis_watcher/watcher.py index 869e6b2..4c049b4 100644 --- a/casbin_redis_watcher/watcher.py +++ b/redis_watcher/watcher.py @@ -19,7 +19,7 @@ from casbin.model import Model from redis.client import Redis, PubSub -from casbin_redis_watcher.options import WatcherOptions +from redis_watcher.options import WatcherOptions class RedisWatcher: diff --git a/tests/test_redis_watcher.py b/tests/test_redis_watcher.py index ffba488..69f2fd1 100644 --- a/tests/test_redis_watcher.py +++ b/tests/test_redis_watcher.py @@ -19,7 +19,7 @@ import casbin import redis -from casbin_redis_watcher import WatcherOptions, new_watcher, new_publish_watcher +from redis_watcher import WatcherOptions, new_watcher, new_publish_watcher def get_examples(path):