Skip to content

Commit

Permalink
modernize package setup
Browse files Browse the repository at this point in the history
move to pyproject.toml that supports PEP517/518
this would help us use isolated build env, and avoid
all the fragile situation we have with Cython installation dependcy
missing in some CI variation
  • Loading branch information
fruch committed Jan 23, 2025
1 parent c459906 commit 4a069aa
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 58 deletions.
81 changes: 81 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[project]
name = "scylla-driver"
description = "Scylla Driver for Apache Cassandra"
authors = [
{name = "ScyllaDB"},
]
keywords = ["cassandra", "cql", "orm", "dse", "graph"]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules'
]
dependencies = [
'geomet>=0.1,<0.3',
'pyyaml > 5.0'
]
dynamic = ["version", "readme"]

[project.urls]
"Homepage" = "https://github.com/scylladb/python-driver"
"Documentation" = "https://scylladb.github.io/python-driver/"
"Source" = "https://github.com/scylladb/python-driver/"
"Issues" = "https://github.com/scylladb/python-driver/issues"

[project.optional-dependencies]
graph = ['gremlinpython==3.4.6']
cle = ['cryptography>=35.0']
test = [
"pytest",
"mock>=2.0.0",
"PyYAML",
"pytz",
"sure",
"scales",
"pure-sasl",
"twisted[tls]; python_version >= '3.5'",
"twisted[tls]==19.2.1; python_version < '3.5'",
"gevent>=1.0; python_version < '3.13' and platform_machine != 'i686' and platform_machine != 'win32'",
"gevent==23.9.0; python_version < '3.13' and (platform_machine == 'i686' or platform_machine == 'win32')",
"eventlet>=0.33.3; python_version < '3.13'",
"cython",
"packaging",
"futurist; python_version >= '3.7'",
"asynctest; python_version >= '3.5'",
"pyyaml",
]

[tool.setuptools]
include-package-data = true
packages=[
'cassandra', 'cassandra.io', 'cassandra.cqlengine', 'cassandra.graph',
'cassandra.datastax', 'cassandra.datastax.insights', 'cassandra.datastax.graph',
'cassandra.datastax.graph.fluent', 'cassandra.datastax.cloud', 'cassandra.scylla',
'cassandra.column_encryption'
]

[tool.setuptools.dynamic]
version = {attr = "cassandra.__version__"} # any module attribute compatible with ast.literal_eval
readme = {file = "README.rst", content-type = "text/x-rst"}

[build-system]
requires = [
"setuptools>=42",
"Cython",
]

build-backend = "setuptools.build_meta"
59 changes: 1 addition & 58 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@
except ImportError:
has_subprocess = False

from cassandra import __version__

long_description = ""
with open("README.rst") as f:
long_description = f.read()


try:
from nose.commands import nosetests
except ImportError:
Expand Down Expand Up @@ -92,6 +85,7 @@ def run(self):
path = "docs/_build/doctest"
mode = "doctest"
else:
from cassandra import __version__
path = "docs/_build/%s" % __version__
mode = "html"

Expand Down Expand Up @@ -425,59 +419,8 @@ def run_setup(extensions):
else:
sys.stderr.write("Bypassing Cython setup requirement\n")

dependencies = [
'geomet>=0.1,<0.3',
'pyyaml > 5.0'
]

_EXTRAS_REQUIRE = {
'graph': ['gremlinpython==3.4.6'],
'cle': ['cryptography>=35.0']
}

setup(
name='scylla-driver',
version=__version__,
description='Scylla Driver for Apache Cassandra',
long_description=long_description,
long_description_content_type='text/x-rst',
url='https://github.com/scylladb/python-driver',
project_urls={
'Documentation': 'https://scylladb.github.io/python-driver/',
'Source': 'https://github.com/scylladb/python-driver/',
'Issues': 'https://github.com/scylladb/python-driver/issues',
},
author='ScyllaDB',
packages=[
'cassandra', 'cassandra.io', 'cassandra.cqlengine', 'cassandra.graph',
'cassandra.datastax', 'cassandra.datastax.insights', 'cassandra.datastax.graph',
'cassandra.datastax.graph.fluent', 'cassandra.datastax.cloud', 'cassandra.scylla',
'cassandra.column_encryption'
],
keywords='cassandra,cql,orm,dse,graph',
include_package_data=True,
install_requires=dependencies,
extras_require=_EXTRAS_REQUIRE,
tests_require=['nose', 'mock>=2.0.0', 'PyYAML', 'pytz', 'sure'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules'
],
**kw)


Expand Down

0 comments on commit 4a069aa

Please sign in to comment.