Skip to content

Commit 0237110

Browse files
fruchdkropachev
authored andcommitted
setup.py: introduce pyproject.toml
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
1 parent 6b495fa commit 0237110

File tree

2 files changed

+82
-58
lines changed

2 files changed

+82
-58
lines changed

pyproject.toml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
[project]
2+
name = "scylla-driver"
3+
description = "Scylla Driver for Apache Cassandra"
4+
authors = [
5+
{name = "ScyllaDB"},
6+
]
7+
keywords = ["cassandra", "cql", "orm", "dse", "graph"]
8+
classifiers = [
9+
'Development Status :: 5 - Production/Stable',
10+
'Intended Audience :: Developers',
11+
'License :: OSI Approved :: Apache Software License',
12+
'Natural Language :: English',
13+
'Operating System :: OS Independent',
14+
'Programming Language :: Python',
15+
'Programming Language :: Python :: 3',
16+
'Programming Language :: Python :: 3.7',
17+
'Programming Language :: Python :: 3.8',
18+
'Programming Language :: Python :: 3.9',
19+
'Programming Language :: Python :: 3.10',
20+
'Programming Language :: Python :: 3.11',
21+
'Programming Language :: Python :: 3.12',
22+
'Programming Language :: Python :: 3.13',
23+
'Programming Language :: Python :: Implementation :: CPython',
24+
'Programming Language :: Python :: Implementation :: PyPy',
25+
'Topic :: Software Development :: Libraries :: Python Modules'
26+
]
27+
dependencies = [
28+
'geomet>=0.1,<0.3',
29+
'pyyaml > 5.0'
30+
]
31+
dynamic = ["version", "readme"]
32+
33+
[project.urls]
34+
"Homepage" = "https://github.com/scylladb/python-driver"
35+
"Documentation" = "https://scylladb.github.io/python-driver/"
36+
"Source" = "https://github.com/scylladb/python-driver/"
37+
"Issues" = "https://github.com/scylladb/python-driver/issues"
38+
39+
[project.optional-dependencies]
40+
graph = ['gremlinpython==3.4.6']
41+
cle = ['cryptography>=35.0']
42+
test = [
43+
"pytest",
44+
"mock>=2.0.0",
45+
"PyYAML",
46+
"pytz",
47+
"sure",
48+
"scales",
49+
"pure-sasl",
50+
"twisted[tls]; python_version >= '3.5'",
51+
"twisted[tls]==19.2.1; python_version < '3.5'",
52+
"gevent>=1.0; python_version < '3.13' and platform_machine != 'i686' and platform_machine != 'win32'",
53+
"gevent==23.9.0; python_version < '3.13' and (platform_machine == 'i686' or platform_machine == 'win32')",
54+
"eventlet>=0.33.3; python_version < '3.13'",
55+
"cython",
56+
"packaging",
57+
"futurist; python_version >= '3.7'",
58+
"asynctest; python_version >= '3.5'",
59+
"pyyaml",
60+
]
61+
62+
[tool.setuptools]
63+
include-package-data = true
64+
packages=[
65+
'cassandra', 'cassandra.io', 'cassandra.cqlengine', 'cassandra.graph',
66+
'cassandra.datastax', 'cassandra.datastax.insights', 'cassandra.datastax.graph',
67+
'cassandra.datastax.graph.fluent', 'cassandra.datastax.cloud', 'cassandra.scylla',
68+
'cassandra.column_encryption'
69+
]
70+
71+
[tool.setuptools.dynamic]
72+
version = {attr = "cassandra.__version__"} # any module attribute compatible with ast.literal_eval
73+
readme = {file = "README.rst", content-type = "text/x-rst"}
74+
75+
[build-system]
76+
requires = [
77+
"setuptools>=42",
78+
"Cython",
79+
]
80+
81+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@
4444
except ImportError:
4545
has_subprocess = False
4646

47-
from cassandra import __version__
48-
49-
long_description = ""
50-
with open("README.rst") as f:
51-
long_description = f.read()
52-
53-
5447
try:
5548
from nose.commands import nosetests
5649
except ImportError:
@@ -94,6 +87,7 @@ def run(self):
9487
path = "docs/_build/doctest"
9588
mode = "doctest"
9689
else:
90+
from cassandra import __version__
9791
path = "docs/_build/%s" % __version__
9892
mode = "html"
9993

@@ -434,59 +428,8 @@ def run_setup(extensions):
434428
else:
435429
sys.stderr.write("Bypassing Cython setup requirement\n")
436430

437-
dependencies = [
438-
'geomet>=0.1,<0.3',
439-
'pyyaml > 5.0'
440-
]
441-
442-
_EXTRAS_REQUIRE = {
443-
'graph': ['gremlinpython==3.4.6'],
444-
'cle': ['cryptography>=35.0']
445-
}
446-
447431
setup(
448-
name='scylla-driver',
449-
version=__version__,
450-
description='Scylla Driver for Apache Cassandra',
451-
long_description=long_description,
452-
long_description_content_type='text/x-rst',
453-
url='https://github.com/scylladb/python-driver',
454-
project_urls={
455-
'Documentation': 'https://scylladb.github.io/python-driver/',
456-
'Source': 'https://github.com/scylladb/python-driver/',
457-
'Issues': 'https://github.com/scylladb/python-driver/issues',
458-
},
459-
author='ScyllaDB',
460-
packages=[
461-
'cassandra', 'cassandra.io', 'cassandra.cqlengine', 'cassandra.graph',
462-
'cassandra.datastax', 'cassandra.datastax.insights', 'cassandra.datastax.graph',
463-
'cassandra.datastax.graph.fluent', 'cassandra.datastax.cloud', 'cassandra.scylla',
464-
'cassandra.column_encryption'
465-
],
466-
keywords='cassandra,cql,orm,dse,graph',
467-
include_package_data=True,
468-
install_requires=dependencies,
469-
extras_require=_EXTRAS_REQUIRE,
470432
tests_require=['nose', 'mock>=2.0.0', 'PyYAML', 'pytz', 'sure'],
471-
classifiers=[
472-
'Development Status :: 5 - Production/Stable',
473-
'Intended Audience :: Developers',
474-
'License :: OSI Approved :: Apache Software License',
475-
'Natural Language :: English',
476-
'Operating System :: OS Independent',
477-
'Programming Language :: Python',
478-
'Programming Language :: Python :: 3',
479-
'Programming Language :: Python :: 3.7',
480-
'Programming Language :: Python :: 3.8',
481-
'Programming Language :: Python :: 3.9',
482-
'Programming Language :: Python :: 3.10',
483-
'Programming Language :: Python :: 3.11',
484-
'Programming Language :: Python :: 3.12',
485-
'Programming Language :: Python :: 3.13',
486-
'Programming Language :: Python :: Implementation :: CPython',
487-
'Programming Language :: Python :: Implementation :: PyPy',
488-
'Topic :: Software Development :: Libraries :: Python Modules'
489-
],
490433
**kw)
491434

492435

0 commit comments

Comments
 (0)