From 8c08e6a2221f556a2c821a6f820d0024504cde11 Mon Sep 17 00:00:00 2001 From: Andreas Bichinger Date: Mon, 30 Oct 2023 16:20:58 +0100 Subject: [PATCH 1/4] chore: migrate from setup.py to pyproject.toml --- pyproject.toml | 31 +++++++++++++++++++++++++++++++ setup.cfg | 3 --- setup.py | 37 ------------------------------------- 3 files changed, 31 insertions(+), 40 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py 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", - ], -) From feb7bc7c195d05844b778cf7e219f176d45efcd0 Mon Sep 17 00:00:00 2001 From: Andreas Bichinger Date: Mon, 30 Oct 2023 16:23:20 +0100 Subject: [PATCH 2/4] chore: set major version of semantic release --- .github/workflows/release.yml | 13 +++++-------- .gitignore | 3 +++ .releaserc.json | 2 +- package.json | 8 ++++++++ 4 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 package.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa75992..1fc1ed1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,16 +89,13 @@ jobs: node-version: '16' - 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" + } +} From f255af0b922d2797c5f58fa1b7861c2cf6b37a2e Mon Sep 17 00:00:00 2001 From: Andreas Bichinger Date: Mon, 30 Oct 2023 16:35:00 +0100 Subject: [PATCH 3/4] ci: update python versions --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1fc1ed1..591205b 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: From c68501ef4ca39737407b1d6b72f738f6e3c7370e Mon Sep 17 00:00:00 2001 From: Andreas Bichinger Date: Mon, 30 Oct 2023 16:38:15 +0100 Subject: [PATCH 4/4] ci: update node version --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 591205b..da38b87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,9 +84,9 @@ 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