From 105866db9f10ec5fc2e0367a3876e8ba9ff800fc Mon Sep 17 00:00:00 2001 From: juliannguyen4 <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 14 Oct 2022 12:28:20 -0700 Subject: [PATCH 1/6] Use pyproject.toml for static metadata --- pyproject.toml | 30 ++++++++++++++++++++++++++++++ setup.py | 24 ------------------------ 2 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..41475e8e0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "aerospike" +description="Aerospike Client Library for Python" +readme="README.rst" +authors=[ + {name="Aerospike, Inc.", email="info@aerospike.com"} +] +urls={Homepage="https://aerospike.com"} +license={text = "Apache Software License"} +keywords=["aerospike", "nosql", "database"] +classifiers=[ + "License :: OSI Approved :: Apache Software License", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS :: MacOS X", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Database" +] +dynamic = ["version"] + +[tool.setuptools] +zip-safe=false +include-package-data=true diff --git a/setup.py b/setup.py index 8c6fe7c89..beb8e38ad 100644 --- a/setup.py +++ b/setup.py @@ -213,31 +213,7 @@ def clean(): setup( - name='aerospike', version=version.strip(), - description='Aerospike Client Library for Python', - long_description=long_description, - author='Aerospike, Inc.', - author_email='info@aerospike.com', - url='http://aerospike.com', - license='Apache Software License', - keywords=['aerospike', 'nosql', 'database'], - classifiers=[ - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: POSIX :: Linux', - 'Operating System :: MacOS :: MacOS X', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Database' - ], - - # Package Data Files - zip_safe=False, - include_package_data=True, - # Data files ext_modules=[ Extension( From 4f06e51125a5209a16b41dd24d77c19b9eb7ec48 Mon Sep 17 00:00:00 2001 From: juliannguyen4 <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:09:54 -0700 Subject: [PATCH 2/6] Fix formatting and syntax --- pyproject.toml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 41475e8e0..79c1fb9b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,15 +4,14 @@ build-backend = "setuptools.build_meta" [project] name = "aerospike" -description="Aerospike Client Library for Python" -readme="README.rst" -authors=[ - {name="Aerospike, Inc.", email="info@aerospike.com"} +description = "Aerospike Client Library for Python" +authors = [ + {name = "Aerospike, Inc.", email = "info@aerospike.com"} ] -urls={Homepage="https://aerospike.com"} -license={text = "Apache Software License"} -keywords=["aerospike", "nosql", "database"] -classifiers=[ +readme = "README.rst" +license = {text = "Apache Software License"} +keywords = ["aerospike", "nosql", "database"] +classifiers = [ "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Operating System :: MacOS :: MacOS X", @@ -25,6 +24,9 @@ classifiers=[ ] dynamic = ["version"] +[project.urls] +"Homepage" = "https://aerospike.com" + [tool.setuptools] -zip-safe=false -include-package-data=true +zip-safe = false +include-package-data = true From a052218069bf59379d6ad762ba74125675d2ddbb Mon Sep 17 00:00:00 2001 From: juliannguyen4 <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:13:09 -0700 Subject: [PATCH 3/6] Use build package instead of running setup.py --- .github/workflows/tests.yml | 3 ++- BUILD.md | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 06198c4e7..18c985759 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,7 +68,8 @@ jobs: sphinx-build -b html . htmldir -W - name: Build client run: | - python setup.py build --force + python3 -m pip install build + python3 -m build - name: Install client run: | python setup.py install --force diff --git a/BUILD.md b/BUILD.md index afe17b672..e7e752aca 100644 --- a/BUILD.md +++ b/BUILD.md @@ -80,7 +80,11 @@ The dependencies can be installed through the macOS package manager [Homebrew](h # substitute the paths to your OpenSSL 1.1 library export SSL_LIB_PATH=/usr/local/Cellar/openssl@1.1/1.1.1l/lib/ export CPATH=/usr/local/Cellar/openssl@1.1/1.1.1l/include/ - python setup.py build --force + + pip install build + python3 -m build + + ### Troubleshooting macOS @@ -106,7 +110,7 @@ MACOSX_DEPLOYMENT_TARGET=10.12 python setup.py install --force Once the client is built: - python setup.py install --force + pip install . ### Troubleshooting macOS From 23bc33731e42396541b350120976a38147d26b00 Mon Sep 17 00:00:00 2001 From: juliannguyen4 <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:18:03 -0700 Subject: [PATCH 4/6] Install with pip --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 18c985759..18d323410 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,7 +72,7 @@ jobs: python3 -m build - name: Install client run: | - python setup.py install --force + pip install . - name: Run tests run: | cd test From cf997c251436c11ba9202b5eef430eebffe51b4a Mon Sep 17 00:00:00 2001 From: juliannguyen4 <109386615+juliannguyen4@users.noreply.github.com> Date: Mon, 17 Oct 2022 12:17:10 -0700 Subject: [PATCH 5/6] Remove mac osx 12 warnings and references to old cmd --- BUILD.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/BUILD.md b/BUILD.md index e7e752aca..0dedf7c15 100644 --- a/BUILD.md +++ b/BUILD.md @@ -91,7 +91,7 @@ The dependencies can be installed through the macOS package manager [Homebrew](h In some versions of macOS, Python 2.7 is installed as ``python`` with ``pip`` as its associated package manager, and Python 3 is installed as ``python3`` with ``pip3`` as the associated package manager. Make sure to use the ones that -map to Python 3, such as `python3 setup.py build --force`. +map to Python 3. Building on macOS versions >= 10.15 , may cause a few additional errors to be generated. If the build command fails with an error similar to: `error: could not create '/usr/local/aerospike/lua': Permission denied` there are a couple of options: @@ -99,13 +99,6 @@ error similar to: `error: could not create '/usr/local/aerospike/lua': Permissio - Rerun the build command with the additional command line flags `--user --prefix=` *Note that there are no charcters after the '='.* This will cause the library to only be installed for the current user, and store the library's data files in a user specific location. - rerun the command with sudo. -If an error similar to `ld: targeted OS version does not support use of thread local variables` appears, it can be fixed by temporarily setting the `MACOSX_DEPLOYMENT_TARGET` environment variable to `'10.12'` e.g. - -```sh -MACOSX_DEPLOYMENT_TARGET=10.12 python setup.py build --force -MACOSX_DEPLOYMENT_TARGET=10.12 python setup.py install --force -``` - ## Install Once the client is built: From 49414ce7e4a326e8546322064dd9f0ac48e8f955 Mon Sep 17 00:00:00 2001 From: juliannguyen4 <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 19 Oct 2022 15:08:56 -0700 Subject: [PATCH 6/6] Remove TODO --- BUILD.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/BUILD.md b/BUILD.md index 0dedf7c15..1300401b8 100644 --- a/BUILD.md +++ b/BUILD.md @@ -84,8 +84,6 @@ The dependencies can be installed through the macOS package manager [Homebrew](h pip install build python3 -m build - - ### Troubleshooting macOS In some versions of macOS, Python 2.7 is installed as ``python`` with