diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4114fa08..9b101748 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,15 +97,12 @@ jobs: node-version: '18' - name: Setup - run: npm install -g semantic-release @semantic-release/github @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/git @semantic-release/release-notes-generator semantic-release-pypi + run: npm install - name: Set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.8 - - - name: Install setuptools - run: python -m pip install --upgrade setuptools wheel twine + python-version: 3.11 - name: Release env: diff --git a/.gitignore b/.gitignore index 47a276bb..0bf5f1c1 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,6 @@ _trial_temp # vscode .vscode + +# node +node_modules \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..20ac176e --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "devDependencies": { + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/git": "^10.0.1", + "semantic-release": "^22.0.5", + "semantic-release-pypi": "^3.0.0" + } +} diff --git a/pyproject.toml b/pyproject.toml index e34796ec..6222335d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,47 @@ +[project] +name = "casbin" +version = "1.32.0" +authors = [ + {name = "TechLee", email = "techlee@qq.com"}, +] +description = "An authorization library that supports access control models like ACL, RBAC, ABAC in Python" +readme = "README.md" +keywords = [ + "casbin", + "acl", + "rbac", + "abac", + "auth", + "authz", + "authorization", + "access control", + "permission", +] +dynamic = ["dependencies"] +requires-python = ">=3.3" +license = {text = "Apache 2.0"} +classifiers = [ + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", +] + +[project.urls] +"Home-page" = "https://github.com/casbin/pycasbin" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +exclude = ["tests", "tests.*"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + [tool.black] line-length = 120 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6ab4cba6..00000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[metadata] -version = 1.32.0 - diff --git a/setup.py b/setup.py deleted file mode 100644 index c81fcaac..00000000 --- a/setup.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2021 The casbin Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import setuptools -from os import path - -desc_file = "README.md" - -here = path.abspath(path.dirname(__file__)) - -with open(desc_file, "r", encoding="utf-8") as fh: - long_description = fh.read() - -# get the dependencies and installs -with open(path.join(here, "requirements.txt"), encoding="utf-8") as f: - all_reqs = f.read().split("\n") - -install_requires = [x.strip() for x in all_reqs if "git+" not in x] - -setuptools.setup( - name="casbin", - author="TechLee", - author_email="techlee@qq.com", - description="An authorization library that supports access control models like ACL, RBAC, ABAC in Python", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/casbin/pycasbin", - keywords=[ - "casbin", - "acl", - "rbac", - "abac", - "auth", - "authz", - "authorization", - "access control", - "permission", - ], - packages=setuptools.find_packages(exclude=("tests", "tests.*")), - install_requires=install_requires, - python_requires=">=3.3", - license="Apache 2.0", - classifiers=[ - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - ], -)