diff --git a/.github/workflows/test-jans-pycloudlib.yml b/.github/workflows/test-jans-pycloudlib.yml index 3fbc7398b00..3603b64f320 100644 --- a/.github/workflows/test-jans-pycloudlib.yml +++ b/.github/workflows/test-jans-pycloudlib.yml @@ -47,14 +47,3 @@ jobs: run: | cd ./jans-pycloudlib tox - - name: Upload coverage to Codecov - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - with: - file: ./jans-pycloudlib/coverage.xml - files: ./jans-pycloudlib/coverage1.xml,./jans-pycloudlib/coverage2.xml - directory: ./jans-pycloudlib/coverage/reports/ - flags: unittests - env_vars: OS,PYTHON - name: codecov-umbrella - fail_ci_if_error: true - verbose: true diff --git a/jans-pycloudlib/pyproject.toml b/jans-pycloudlib/pyproject.toml index e84b430f00b..6902e583cbe 100644 --- a/jans-pycloudlib/pyproject.toml +++ b/jans-pycloudlib/pyproject.toml @@ -1,3 +1,93 @@ +[build-system] +requires = [ + # The minimum setuptools version is specific to the PEP 517 backend, + # and may be stricter than the version required in `setup.cfg` + "setuptools>=40.6.0,!=60.9.0", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "jans-pycloudlib" +dynamic = ["version"] +description = "Utilities for Janssen cloud-native deployment" +readme = "README.md" +license = {file = "LICENSE"} +authors = [ + {name = "JanssenProject"} +] +maintainers = [ + {name = "Isman Firmansyah", email = "isman@gluu.org"} +] +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Topic :: Software Development :: Libraries :: Python Modules", + "Programming Language :: Python", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12" +] +dependencies = [ + "requests>=2.22.0", + "python-consul>=1.0.1", + "hvac>=0.7.0", + "kubernetes>=11.0", + + # the ldap3 library is not removed for the following reasons: + # + # - it's still used by `jans.pycloudlib.utils.ldap_encode` (hashed function) + # - it's still used by `jans.pycloudlib.persistence.sql.doc_id_from_dn` (parse_dn function) + # - vendoring hashed and parse_dn functions from ldap3 library will need testcases, which we can avoid by reusing the original functions + # - LDAP/LDIF DN is still used heavily in Janssen data design + # + "ldap3>=2.5", + + "backoff>=2.1.2", + "docker>=3.7.2", + "requests-toolbelt>=0.9.1", + "cryptography>=2.8", + "google-cloud-secret-manager>=2.2.0", + "pymysql>=1.0.2", + "sqlalchemy>=1.3,<1.4", + "psycopg2>=2.8.6", + "Click>=6.7", + "ldif>=4.1.1", + + # handle CVE-2022-36087 + "oauthlib>=3.2.1", + + "boto3", + "sprig-aes>=0.4.0", + "marshmallow>=3.21.2", + "apispec[marshmallow]>=6.6.1", + "fqdn>=1.5.1", + "pem>=23.1.0", + + # extra dependency for google-cloud-secret-manager + "grpc-interceptor>=0.15.4" +] +requires-python = ">=3.9" + +[project.scripts] +jans-pycloudlib = "jans.pycloudlib.cli:cli" + +[project.urls] +"Homepage" = "https://github.com/JanssenProject/jans/tree/main/jans-pycloudlib" + +[tool.setuptools] +include-package-data = true +zip-safe = false + +[tool.setuptools.packages.find] +include = ["jans*"] +# disable scanning PEP 420 namespaces +namespaces = false + +[tool.setuptools.dynamic] +version = {attr = "jans.pycloudlib.version.__version__"} + [tool.pydocstyle] convention = "google" inherit = false diff --git a/jans-pycloudlib/setup.py b/jans-pycloudlib/setup.py index 69661bb2bc7..cd1a1ef0295 100644 --- a/jans-pycloudlib/setup.py +++ b/jans-pycloudlib/setup.py @@ -1,83 +1,4 @@ -import codecs -import os -import re +# handle compatibility from setuptools import setup -from setuptools import find_packages - -def find_version(*file_paths): - here = os.path.abspath(os.path.dirname(__file__)) - with codecs.open(os.path.join(here, *file_paths), 'r') as f: - version_file = f.read() - version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", - version_file, re.M) - if version_match: - return version_match.group(1) - raise RuntimeError("Unable to find version string.") - - -setup( - name="jans-pycloudlib", - version=find_version("jans", "pycloudlib", "version.py"), - url="", - license="Apache", - author="Janssen", - author_email="isman@gluu.org", - description="", - long_description=__doc__, - packages=find_packages(), - zip_safe=False, - install_requires=[ - "requests>=2.22.0", - "python-consul>=1.0.1", - "hvac>=0.7.0", - "kubernetes>=11.0", - - # the ldap3 library is not removed for the following reasons: - # - # - it's still used by `jans.pycloudlib.utils.ldap_encode` (hashed function) - # - it's still used by `jans.pycloudlib.persistence.sql.doc_id_from_dn` (parse_dn function) - # - vendoring hashed and parse_dn functions from ldap3 library will need testcases, which we can avoid by reusing the original functions - # - LDAP/LDIF DN is still used heavily in Janssen data design - # - "ldap3>=2.5", - - "backoff>=2.1.2", - "docker>=3.7.2", - "requests-toolbelt>=0.9.1", - "cryptography>=2.8", - "google-cloud-secret-manager>=2.2.0", - "pymysql>=1.0.2", - "sqlalchemy>=1.3,<1.4", - "psycopg2>=2.8.6", - "Click>=6.7", - "ldif>=4.1.1", - # handle CVE-2022-36087 - "oauthlib>=3.2.1", - "boto3", - "sprig-aes>=0.4.0", - "marshmallow>=3.21.2", - "apispec[marshmallow]>=6.6.1", - "fqdn>=1.5.1", - "pem>=23.1.0", - # extra dependency for google-cloud-secret-manager - "grpc-interceptor>=0.15.4", - ], - classifiers=[ - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Topic :: Software Development :: Libraries :: Python Modules", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - ], - include_package_data=True, - entry_points={ - "console_scripts": ["jans-pycloudlib=jans.pycloudlib.cli:cli"], - }, - package_data={ - "jans.pycloudlib": ["py.typed"], - }, - python_requires=">=3.9", -) +setup()