Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLIENT-1863] Use pyproject.toml for static metadata #298

Merged
merged 6 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ 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
pip install .
- name: Run tests
run: |
cd test
Expand Down
17 changes: 7 additions & 10 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,30 @@ 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/[email protected]/1.1.1l/lib/
export CPATH=/usr/local/Cellar/[email protected]/1.1.1l/include/
python setup.py build --force

pip install build
python3 -m build

<!-- TODO: update all build cmds -->
dwelch-spike marked this conversation as resolved.
Show resolved Hide resolved

### Troubleshooting macOS

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:

- 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:

python setup.py install --force
pip install .

### Troubleshooting macOS

Expand Down
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "aerospike"
description = "Aerospike Client Library for Python"
authors = [
{name = "Aerospike, Inc.", email = "[email protected]"}
]
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",
"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"]

[project.urls]
"Homepage" = "https://aerospike.com"

[tool.setuptools]
zip-safe = false
include-package-data = true
24 changes: 0 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
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(
Expand Down