diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa75992..da38b87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ 3.6, 3.7, 3.8, 3.9 ] + python-version: ['3.7', '3.8', '3.9', '3.10'] os: [ ubuntu-latest ] services: casbin: @@ -84,21 +84,18 @@ jobs: fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '16' + 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: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 52ea1c1..6a2fdd3 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,6 @@ dmypy.json # Pyre type checker .pyre/ + +# node +node_modules \ No newline at end of file diff --git a/.releaserc.json b/.releaserc.json index 29366ab..bf82ff9 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -16,7 +16,7 @@ "@semantic-release/git", { "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}", - "assets": ["CHANGELOG.md", "setup.py", "setup.cfg"] + "assets": ["CHANGELOG.md", "pyproject.toml"] } ] ] diff --git a/package.json b/package.json new file mode 100644 index 0000000..20ac176 --- /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 e34796e..3d760b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,33 @@ +[project] +name = "casbin_etcd_watcher" +version = "1.0.2" +authors = [ + {name = "nekotoxin", email = "nekotoxin@gmail.com"}, +] +description = "Casbin role watcher to be used for monitoring updates to policies for PyCasbin" +readme = "README.md" +dynamic = ["dependencies"] +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", + "License :: OSI Approved :: Apache Software License", +] + +[project.urls] +"Home-page" = "https://github.com/pycasbin/etcd-watcher" + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +exclude = ["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 5da876c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[metadata] -version = 1.0.2 - diff --git a/setup.py b/setup.py deleted file mode 100644 index 2565b75..0000000 --- a/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2022 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. - -from setuptools import setup, find_packages - -with open("README.md", "r") as readme_file: - readme = readme_file.read() - -setup( - name="casbin_etcd_watcher", - author="nekotoxin", - author_email="nekotoxin@gmail.com", - description="Casbin role watcher to be used for monitoring updates to policies for PyCasbin", - long_description=readme, - long_description_content_type="text/markdown", - url="https://github.com/pycasbin/etcd-watcher", - install_requires=[x for x in open("requirements.txt").read().splitlines()], - packages=find_packages(), - classifiers=[ - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "License :: OSI Approved :: Apache Software License", - ], -)