diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26e5f56..eead7f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,16 +6,19 @@ on: jobs: release: runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/3scale-api + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.11' - name: setup run: pip install wheel - name: build run: python setup.py --release-version ${GITHUB_REF#refs/tags/v} sdist bdist_wheel - - name: release + - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/setup.py b/setup.py index 5d838fb..1640d3f 100644 --- a/setup.py +++ b/setup.py @@ -12,45 +12,38 @@ VERSION = sys.argv.pop(1) assert re.match(r"[0-9]+\.[0-9]+\.[0-9]+", VERSION), "Version definition required as first arg" -requirements = ['requests', 'backoff'] +requirements = ["requests", "backoff"] -extra_requirements = { - 'dev': [ - 'pytest', - 'coverage', - 'python-dotenv', - 'responses' +extra_requirements = {"dev": ["pytest", "coverage", "python-dotenv", "responses"], "docs": ["sphinx"]} +setup( + name="3scale-api", + version=VERSION, + description="3scale API python client", + author="Peter Stanko", + author_email="stanko@mail.muni.cz", + maintainer="Matej Dujava", + maintainer_email="mdujava@redhat.com", + url="https://github.com/3scale-qe/3scale-api-python", + packages=find_packages(exclude=("tests",)), + long_description=long_description, + long_description_content_type="text/markdown", + include_package_data=True, + install_requires=requirements, + extras_require=extra_requirements, + entry_points={}, + classifiers=[ + "Operating System :: OS Independent", + "License :: OSI Approved :: Apache Software License", + "Intended Audience :: Developers", + "Topic :: Utilities", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ], - 'docs': ['sphinx'] -} - -setup(name='3scale-api', - version=VERSION, - description='3scale API python client', - author='Peter Stanko', - author_email='stanko@mail.muni.cz', - maintainer='Peter Stanko', - url='https://github.com/3scale-qe/3scale-api-python', - packages=find_packages(exclude=("tests",)), - long_description=long_description, - long_description_content_type='text/markdown', - include_package_data=True, - install_requires=requirements, - extras_require=extra_requirements, - entry_points={}, - classifiers=[ - "Operating System :: OS Independent", - "License :: OSI Approved :: Apache Software License", - 'Intended Audience :: Developers', - 'Topic :: Utilities', - "Programming Language :: Python :: 3", - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - ], - ) +) diff --git a/threescale_api/client.py b/threescale_api/client.py index aa44dc6..2356f63 100644 --- a/threescale_api/client.py +++ b/threescale_api/client.py @@ -257,7 +257,7 @@ def admin_portal_auth_providers(self) -> resources.AdminPortalAuthProviders: return self._admin_portal_auth_providers @property - def policy_registry(self) -> resources.PolicyRegistry: + def policy_registry(self) -> resources.PoliciesRegistry: return self._policy_registry @property