From 66a9d08811e7362e4bb7dc68d7ace590f332521b Mon Sep 17 00:00:00 2001 From: Jared Casey Date: Thu, 18 Jul 2024 17:43:23 -0500 Subject: [PATCH] Small change for wheel packaging --- MANIFEST.in | 3 ++- couchbase_columnar/common/core/_certificates.py | 3 +++ .../common/core/nonprod_certificates/__init__.py | 0 setup.py | 8 ++++---- 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 couchbase_columnar/common/core/nonprod_certificates/__init__.py diff --git a/MANIFEST.in b/MANIFEST.in index 49ce75b..963c96e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ include *.txt LICENSE CONTRIBUTING.md BUILDING.md CMakeLists.txt pyproject.toml couchbase_columnar_version.py pycbcc_build_setup.py -include couchbase-sdk-python-black-duck-manifest.yaml +include columnar-sdk-python-black-duck-manifest.yaml +include couchbase_columnar/common/core/nonprod_certificates/*.pem recursive-include couchbase_columnar *.py recursive-include acouchbase_columnar *.py recursive-include src *.[ch]xx diff --git a/couchbase_columnar/common/core/_certificates.py b/couchbase_columnar/common/core/_certificates.py index c793e07..17c870e 100644 --- a/couchbase_columnar/common/core/_certificates.py +++ b/couchbase_columnar/common/core/_certificates.py @@ -30,11 +30,14 @@ def get_nonprod_certificates() -> List[str]: Returns: List[str]: List of nonprod Capella certificates. """ + import os import warnings from pathlib import Path warnings.warn('Only use non-prod certificate in DEVELOPMENT environments.', ResourceWarning) nonprod_cert_dir = Path(Path(__file__).resolve().parent, 'nonprod_certificates') nonprod_certs: List[str] = [] for cert in nonprod_cert_dir.iterdir(): + if os.path.isdir(cert): + continue nonprod_certs.append(cert.read_text()) return nonprod_certs diff --git a/couchbase_columnar/common/core/nonprod_certificates/__init__.py b/couchbase_columnar/common/core/nonprod_certificates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index 94d2a60..3b27d7a 100644 --- a/setup.py +++ b/setup.py @@ -35,11 +35,11 @@ PYCBCC_VERSION = couchbase_columnar_version.get_version() -package_data = {} +package_data = {'couchbase_columnar.common.core.nonprod_certificates': ['*.pem']} # some more Windows tomfoolery... -# TODO: verify this works w/ cb2 updates if platform.system() == 'Windows': - package_data = {'couchbase_columnar.protocol': ['pycbcc_core.pyd']} + package_data.update(**{'couchbase_columnar.protocol': ['pycbcc_core.pyd']}) + print(f'Python Columnar SDK version: {PYCBCC_VERSION}') @@ -47,7 +47,7 @@ version=PYCBCC_VERSION, ext_modules=[CMakeExtension('couchbase_columnar.protocol.pycbcc_core')], cmdclass={'build': BuildCommand, 'build_ext': CMakeBuildExt, 'configure_ext': CMakeConfigureExt}, - python_requires='>=3.7', + python_requires='>=3.8', packages=find_packages( include=['acouchbase_columnar', 'couchbase_columnar', 'acouchbase_columnar.*', 'couchbase_columnar.*'], exclude=['acouchbase_columnar.tests', 'couchbase_columnar.tests']),