From 7de8ac47040136e315878d45a76041c1993c2e8d Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sat, 26 Oct 2024 22:45:11 +0800 Subject: [PATCH] feat: update path --- .coveragerc | 2 +- MANIFEST.in | 2 ++ README.md | 16 ++++++++-------- setup.py | 2 +- .../__init__.py | 0 .../adapter.py | 0 tests/test_adapter.py | 8 ++++---- 7 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 MANIFEST.in rename {casbin_sqlalchemy_adapter => sqlalchemy_adapter}/__init__.py (100%) rename {casbin_sqlalchemy_adapter => sqlalchemy_adapter}/adapter.py (100%) diff --git a/.coveragerc b/.coveragerc index 9e0ae8f..0b95e1e 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,2 @@ [run] -include = casbin_sqlalchemy_adapter/* \ No newline at end of file +include = sqlalchemy_adapter/* \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..3d387c3 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include README.md +include requirements.txt \ No newline at end of file diff --git a/README.md b/README.md index 0e52269..a72ed81 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ SQLAlchemy Adapter for PyCasbin [![GitHub Actions](https://github.com/officialpycasbin/sqlalchemy-adapter/workflows/build/badge.svg?branch=master)](https://github.com/officialpycasbin/sqlalchemy-adapter/actions) [![Coverage Status](https://coveralls.io/repos/github/officialpycasbin/sqlalchemy-adapter/badge.svg)](https://coveralls.io/github/officialpycasbin/sqlalchemy-adapter) -[![Version](https://img.shields.io/pypi/v/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/) -[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/) -[![Pyversions](https://img.shields.io/pypi/pyversions/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/) -[![Download](https://img.shields.io/pypi/dm/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/) -[![License](https://img.shields.io/pypi/l/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/) +[![Version](https://img.shields.io/pypi/v/sqlalchemy-adapter.svg)](https://pypi.org/project/sqlalchemy-adapter/) +[![PyPI - Wheel](https://img.shields.io/pypi/wheel/sqlalchemy-adapter.svg)](https://pypi.org/project/sqlalchemy-adapter/) +[![Pyversions](https://img.shields.io/pypi/pyversions/sqlalchemy-adapter.svg)](https://pypi.org/project/sqlalchemy-adapter/) +[![Download](https://img.shields.io/pypi/dm/sqlalchemy-adapter.svg)](https://pypi.org/project/sqlalchemy-adapter/) +[![License](https://img.shields.io/pypi/l/sqlalchemy-adapter.svg)](https://pypi.org/project/sqlalchemy-adapter/) SQLAlchemy Adapter is the [SQLAlchemy](https://www.sqlalchemy.org) adapter for [PyCasbin](https://github.com/casbin/pycasbin). With this library, Casbin can load policy from SQLAlchemy supported database or save policy to it. @@ -24,16 +24,16 @@ Based on [Officially Supported Databases](http://www.sqlalchemy.org/), The curre ## Installation ``` -pip install casbin_sqlalchemy_adapter +pip install sqlalchemy_adapter ``` ## Simple Example ```python -import casbin_sqlalchemy_adapter +import sqlalchemy_adapter import casbin -adapter = casbin_sqlalchemy_adapter.Adapter('sqlite:///test.db') +adapter = sqlalchemy_adapter.Adapter('sqlite:///test.db') e = casbin.Enforcer('path/to/model.conf', adapter) diff --git a/setup.py b/setup.py index 24caaa4..7932e20 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ install_requires = [x.strip() for x in all_reqs if "git+" not in x] setup( - name="casbin_sqlalchemy_adapter", + name="sqlalchemy_adapter", author="Casbin", author_email="admin@casbin.org", description="SQLAlchemy Adapter for PyCasbin", diff --git a/casbin_sqlalchemy_adapter/__init__.py b/sqlalchemy_adapter/__init__.py similarity index 100% rename from casbin_sqlalchemy_adapter/__init__.py rename to sqlalchemy_adapter/__init__.py diff --git a/casbin_sqlalchemy_adapter/adapter.py b/sqlalchemy_adapter/adapter.py similarity index 100% rename from casbin_sqlalchemy_adapter/adapter.py rename to sqlalchemy_adapter/adapter.py diff --git a/tests/test_adapter.py b/tests/test_adapter.py index 726932e..cae16d5 100644 --- a/tests/test_adapter.py +++ b/tests/test_adapter.py @@ -5,10 +5,10 @@ from sqlalchemy import create_engine, Column, Integer, String from sqlalchemy.orm import sessionmaker -from casbin_sqlalchemy_adapter import Adapter -from casbin_sqlalchemy_adapter import Base -from casbin_sqlalchemy_adapter import CasbinRule -from casbin_sqlalchemy_adapter.adapter import Filter +from sqlalchemy_adapter import Adapter +from sqlalchemy_adapter import Base +from sqlalchemy_adapter import CasbinRule +from sqlalchemy_adapter.adapter import Filter def get_fixture(path):