+#endif
+
+#define PYLDAP_FUNC(rtype) rtype
+#define PYLDAP_DATA(rtype) extern rtype
+
+PYLDAP_FUNC(PyObject *) LDAPerror_TypeError(const char *, PyObject *);
+
+PYLDAP_FUNC(void) LDAPadd_methods(PyObject *d, PyMethodDef *methods);
+
+#define PyNone_Check(o) ((o) == Py_None)
+
+/* *** berval *** */
+PYLDAP_FUNC(PyObject *) LDAPberval_to_object(const struct berval *bv);
+PYLDAP_FUNC(PyObject *) LDAPberval_to_unicode_object(const struct berval *bv);
+
+/* *** constants *** */
+PYLDAP_FUNC(int) LDAPinit_constants(PyObject *m);
+
+PYLDAP_DATA(PyObject *) LDAPexception_class;
+PYLDAP_FUNC(PyObject *) LDAPerror(LDAP *);
+PYLDAP_FUNC(PyObject *) LDAPraise_for_message(LDAP *, LDAPMessage *m);
+PYLDAP_FUNC(PyObject *) LDAPerr(int errnum);
+
+#ifndef LDAP_CONTROL_PAGE_OID
+#define LDAP_CONTROL_PAGE_OID "1.2.840.113556.1.4.319"
+#endif /* !LDAP_CONTROL_PAGE_OID */
+
+#ifndef LDAP_CONTROL_VALUESRETURNFILTER
+#define LDAP_CONTROL_VALUESRETURNFILTER "1.2.826.0.1.3344810.2.3" /* RFC 3876 */
+#endif /* !LDAP_CONTROL_VALUESRETURNFILTER */
+
+/* *** functions *** */
+PYLDAP_FUNC(void) LDAPinit_functions(PyObject *);
+
+/* *** ldapcontrol *** */
+PYLDAP_FUNC(void) LDAPinit_control(PyObject *d);
+PYLDAP_FUNC(void) LDAPControl_List_DEL(LDAPControl **);
+PYLDAP_FUNC(int) LDAPControls_from_object(PyObject *, LDAPControl ***);
+PYLDAP_FUNC(PyObject *) LDAPControls_to_List(LDAPControl **ldcs);
+
+/* *** ldapobject *** */
+typedef struct {
+ PyObject_HEAD LDAP *ldap;
+ PyThreadState *_save; /* for thread saving on referrals */
+ int valid;
+} LDAPObject;
+
+PYLDAP_DATA(PyTypeObject) LDAP_Type;
+PYLDAP_FUNC(LDAPObject *) newLDAPObject(LDAP *);
+
+/* macros to allow thread saving in the context of an LDAP connection */
+
+#define LDAP_BEGIN_ALLOW_THREADS( l ) \
+ { \
+ LDAPObject *lo = (l); \
+ if (lo->_save != NULL) \
+ Py_FatalError( "saving thread twice?" ); \
+ lo->_save = PyEval_SaveThread(); \
+ }
+
+#define LDAP_END_ALLOW_THREADS( l ) \
+ { \
+ LDAPObject *lo = (l); \
+ PyThreadState *_save = lo->_save; \
+ lo->_save = NULL; \
+ PyEval_RestoreThread( _save ); \
+ }
+
+/* *** messages *** */
+PYLDAP_FUNC(PyObject *)
+LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls,
+ int add_intermediates);
+
+/* *** options *** */
+PYLDAP_FUNC(int) LDAP_optionval_by_name(const char *name);
+PYLDAP_FUNC(int) LDAP_set_option(LDAPObject *self, int option,
+ PyObject *value);
+PYLDAP_FUNC(PyObject *) LDAP_get_option(LDAPObject *self, int option);
+PYLDAP_FUNC(void) set_timeval_from_double(struct timeval *tv, double d);
+
+#endif /* pythonldap_h */
diff --git a/pyproject.toml b/pyproject.toml
index dda8dbc1..75f7c06a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,3 @@
-[tool.black]
-line-length = 88
-target-version = ['py36', 'py37', 'py38']
-
[tool.isort]
line_length=88
known_first_party=['ldap', '_ldap', 'ldapurl', 'ldif', 'slapdtest']
diff --git a/setup.py b/setup.py
index 6da3f491..ea7364cd 100644
--- a/setup.py
+++ b/setup.py
@@ -86,13 +86,11 @@ class OpenLDAP2:
'Programming Language :: Python',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.6',
- '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',
# Note: when updating Python versions, also change tox.ini and .github/workflows/*
'Topic :: Database',
@@ -117,15 +115,8 @@ class OpenLDAP2:
'Modules/berval.c',
],
depends = [
- 'Modules/LDAPObject.h',
- 'Modules/berval.h',
- 'Modules/common.h',
+ 'Modules/pythonldap.h',
'Modules/constants_generated.h',
- 'Modules/constants.h',
- 'Modules/functions.h',
- 'Modules/ldapcontrol.h',
- 'Modules/message.h',
- 'Modules/options.h',
],
libraries = LDAP_CLASS.libs,
include_dirs = ['Modules'] + LDAP_CLASS.include_dirs,
@@ -166,6 +157,6 @@ class OpenLDAP2:
'pyasn1_modules >= 0.1.5',
],
zip_safe=False,
- python_requires='>=3.6',
+ python_requires='>=3.9',
test_suite = 'Tests',
)
diff --git a/tox.ini b/tox.ini
index beade024..0b284a4e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,22 +5,21 @@
[tox]
# Note: when updating Python versions, also change setup.py and .github/worlflows/*
-envlist = py{36,37,38,39,310,311,312},c90-py{36,37},py3-nosasltls,doc,py3-trace,pypy3.9
+envlist = py{39,310,311,312},py3-nosasltls,doc,py3-trace,pypy3.9
minver = 1.8
[gh-actions]
python =
- 3.6: py36
- 3.7: py37
- 3.8: py38, doc, py3-nosasltls
- 3.9: py39, py3-trace
+ 3.9: py39, py3-trace, doc, py3-nosasltls
3.10: py310
3.11: py311
3.12: py312
+ 3.13: py313
pypy3.9: pypy3.9
+ pypy3.10: pypy3.10
[testenv]
-deps =
+deps = setuptools
passenv = WITH_GCOV
# - Enable BytesWarning
# - Turn all warnings into exceptions.
@@ -98,6 +97,7 @@ deps =
markdown
sphinx
sphinxcontrib-spelling
+ setuptools
commands =
{envpython} setup.py check --restructuredtext --metadata --strict
{envpython} -m markdown README -f {envtmpdir}/README.html
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy