Skip to content

Commit

Permalink
refactor(jans-pycloudlib): move packaging details from setup.py to py…
Browse files Browse the repository at this point in the history
…project.toml (#10534)

* refactor(jans-pycloudlib): move packaging details from setup.py to pyproject.toml

Signed-off-by: iromli <[email protected]>

* fix(jans-pycloudlib): resolve namespaced package

Signed-off-by: iromli <[email protected]>

* fix(jans-pycloudlib): use explicit package discovery

Signed-off-by: iromli <[email protected]>

* fix: disable scanning PEP 420 namespaces

Signed-off-by: iromli <[email protected]>

* ci: fix test-jans-pycloudlib.yml

Signed-off-by: Mohammad Abudayyeh <[email protected]>

---------

Signed-off-by: iromli <[email protected]>
Signed-off-by: Mohammad Abudayyeh <[email protected]>
Co-authored-by: Mohammad Abudayyeh <[email protected]>
  • Loading branch information
iromli and moabu authored Jan 3, 2025
1 parent 4342517 commit 1951312
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 92 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/test-jans-pycloudlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
90 changes: 90 additions & 0 deletions jans-pycloudlib/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"}
]
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
Expand Down
83 changes: 2 additions & 81 deletions jans-pycloudlib/setup.py
Original file line number Diff line number Diff line change
@@ -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="[email protected]",
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()

0 comments on commit 1951312

Please sign in to comment.