csh-ldap 2.3.1.dev4__tar.gz → 2.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. csh_ldap-2.5.1/.github/workflows/python.yaml +30 -0
  2. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/.pylintrc +13 -17
  3. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/AUTHORS +5 -0
  4. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/ChangeLog +24 -1
  5. csh_ldap-2.5.1/PKG-INFO +25 -0
  6. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/csh_ldap/__init__.py +7 -12
  7. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/csh_ldap/group.py +6 -7
  8. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/csh_ldap/member.py +5 -8
  9. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/csh_ldap/utility.py +5 -2
  10. csh_ldap-2.5.1/csh_ldap.egg-info/PKG-INFO +25 -0
  11. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/csh_ldap.egg-info/SOURCES.txt +2 -2
  12. csh_ldap-2.5.1/csh_ldap.egg-info/pbr.json +1 -0
  13. csh_ldap-2.5.1/csh_ldap.egg-info/requires.txt +2 -0
  14. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/requirements-test.txt +1 -1
  15. csh_ldap-2.5.1/requirements.txt +2 -0
  16. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/setup.cfg +4 -4
  17. csh_ldap-2.3.1.dev4/.travis.yml +0 -13
  18. csh_ldap-2.3.1.dev4/PKG-INFO +0 -13
  19. csh_ldap-2.3.1.dev4/csh_ldap.egg-info/PKG-INFO +0 -13
  20. csh_ldap-2.3.1.dev4/csh_ldap.egg-info/pbr.json +0 -1
  21. csh_ldap-2.3.1.dev4/csh_ldap.egg-info/requires.txt +0 -2
  22. csh_ldap-2.3.1.dev4/requirements.txt +0 -2
  23. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/LICENSE +0 -0
  24. /csh_ldap-2.3.1.dev4/README.rst → /csh_ldap-2.5.1/README.md +0 -0
  25. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/csh_ldap.egg-info/dependency_links.txt +0 -0
  26. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/csh_ldap.egg-info/not-zip-safe +0 -0
  27. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/csh_ldap.egg-info/top_level.txt +0 -0
  28. {csh_ldap-2.3.1.dev4 → csh_ldap-2.5.1}/setup.py +0 -0
@@ -0,0 +1,30 @@
1
+ name: Python Linting
2
+
3
+ on:
4
+ push:
5
+ branches: [master, develop]
6
+ pull_request:
7
+ branches: [master, develop]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
15
+ steps:
16
+ - name: Install ldap dependencies
17
+ run: sudo apt-get update && sudo apt-get install libldap2-dev libsasl2-dev
18
+ - uses: actions/checkout@v2
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v2
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ - name: Install dependencies
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
27
+ if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
28
+ - name: Lint with pylint
29
+ run: |
30
+ pylint csh_ldap
@@ -1,33 +1,29 @@
1
1
  [MASTER]
2
- ignore = ,input
2
+ ignore-paths=input
3
3
  persistent = yes
4
4
 
5
5
  [MESSAGES CONTROL]
6
6
  disable =
7
7
  missing-docstring,
8
- fixme,
9
- duplicate-code,
10
- no-member,
11
- parse-error,
12
- bad-continuation,
13
- too-few-public-methods,
14
- global-statement,
15
- cyclic-import,
16
- locally-disabled,
17
- file-ignored,
8
+ fixme,
9
+ duplicate-code,
10
+ no-member,
11
+ parse-error,
12
+ too-few-public-methods,
13
+ global-statement,
14
+ cyclic-import,
15
+ locally-disabled,
16
+ file-ignored,
18
17
  import-error,
19
18
  unused-import
20
19
 
21
20
  [REPORTS]
22
21
  output-format = text
23
- files-output = no
24
22
  reports = no
25
23
 
26
24
  [FORMAT]
27
25
  max-line-length = 120
28
- max-statement-lines = 75
29
26
  single-line-if-stmt = no
30
- no-space-check = trailing-comma,dict-separator
31
27
  max-module-lines = 1000
32
28
  indent-string = ' '
33
29
 
@@ -75,8 +71,8 @@ good-names=logger,id,ID
75
71
  # Bad variable names which should always be refused, separated by a comma
76
72
  bad-names=foo,bar,baz,toto,tutu,tata
77
73
 
78
- # List of builtins function names that should not be used, separated by a comma
79
- bad-functions=apply,input
74
+ # Note: bad-functions option was removed in modern pylint versions
75
+ # Use specific pylint checks instead
80
76
 
81
77
 
82
78
  [DESIGN]
@@ -92,4 +88,4 @@ min-public-methods = 2
92
88
  max-public-methods = 20
93
89
 
94
90
  [EXCEPTIONS]
95
- overgeneral-exceptions = Exception
91
+ overgeneral-exceptions = builtins.Exception
@@ -1,8 +1,13 @@
1
1
  Adam Brewer <adamhb321@gmail.com>
2
+ Cole Stowell <121599022+costowell@users.noreply.github.com>
3
+ Cole Stowell <cole@stowell.pro>
2
4
  Devin Matte <devinmatte@gmail.com>
5
+ Galen Guyer <galen@galenguyer.com>
3
6
  Jordan Rodgers <com6056@gmail.com>
4
7
  Liam Middlebrook <liammiddlebrook@gmail.com>
5
8
  Marc Billow <mbillow@me.com>
6
9
  Max Meinhold <mxmeinhold@gmail.com>
7
10
  Michael Francis <mikefrancis95@gmail.com>
11
+ Tyler Allen <tyler@tallen.me>
8
12
  William Stevens <contact@wastevensv.com>
13
+ dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@@ -1,7 +1,30 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
- * 3.3.1 and README update
4
+ 2.5.1
5
+ -----
6
+
7
+ * bump: 2.5.1
8
+ * fix: \_get\_attr -> \_\_getattr\_\_
9
+
10
+ v2.5.0
11
+ ------
12
+
13
+ * Bump to 2.5.0
14
+ * Bump python-ldap from 3.4.0 to 3.4.4
15
+ * fix: bump pylint and python version in CI
16
+
17
+ 2.4.0
18
+ -----
19
+
20
+ * Bump to 2.4.0
21
+ * Bump python-ldap from 3.0.0 to 3.4.0
22
+ * swap from travis to github actions
23
+
24
+ 2.3.1
25
+ -----
26
+
27
+ * Version 2.3.1 Bump
5
28
  * Fix infinite recursion in reconnect\_on\_fail
6
29
  * Circular import hotfix
7
30
 
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: csh_ldap
3
+ Version: 2.5.1
4
+ Summary: CSH LDAP ORM
5
+ Home-page: https://github.com/liam-middlebrook/csh_ldap
6
+ Author: Liam Middlebrook
7
+ Author-email: liammiddlebrook@gmail.com
8
+ License: MIT
9
+ Classifier: Natural Language :: English
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ License-File: AUTHORS
14
+ Requires-Dist: python-ldap==3.4.4
15
+ Requires-Dist: srvlookup==2.0.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: license
21
+ Dynamic: license-file
22
+ Dynamic: requires-dist
23
+ Dynamic: summary
24
+
25
+ file: README.md
@@ -11,7 +11,7 @@ class CSHLDAP:
11
11
  __domain__ = "csh.rit.edu"
12
12
 
13
13
  @reconnect_on_fail
14
- def __init__(self, bind_dn, bind_pw, batch_mods=False,
14
+ def __init__(self, bind_dn, bind_pw, *, batch_mods=False,
15
15
  sasl=False, ro=False):
16
16
  """Handler for bindings to CSH LDAP.
17
17
 
@@ -74,7 +74,7 @@ class CSHLDAP:
74
74
  members = self.__con__.search_s(
75
75
  CSHMember.__ldap_user_ou__,
76
76
  ldap.SCOPE_SUBTREE,
77
- "(ibutton=%s)" % val,
77
+ f"(ibutton={val})",
78
78
  ['ipaUniqueID'])
79
79
  if members:
80
80
  return CSHMember(
@@ -96,7 +96,7 @@ class CSHLDAP:
96
96
  members = self.__con__.search_s(
97
97
  CSHMember.__ldap_user_ou__,
98
98
  ldap.SCOPE_SUBTREE,
99
- "(slackuid=%s)" % slack,
99
+ f"(slackuid={slack})",
100
100
  ['ipaUniqueID'])
101
101
  if members:
102
102
  return CSHMember(
@@ -132,7 +132,7 @@ class CSHLDAP:
132
132
  res = self.__con__.search_s(
133
133
  __ldap_group_ou__,
134
134
  ldap.SCOPE_SUBTREE,
135
- "(cn=eboard-%s)" % val,
135
+ f"(cn=eboard-{val})",
136
136
  ['member'])
137
137
 
138
138
  ret = []
@@ -176,19 +176,14 @@ class CSHLDAP:
176
176
  mod_str = "ADD"
177
177
  else:
178
178
  mod_str = "REPLACE"
179
- print("{} VALUE {} = {} FOR {}".format(mod_str,
180
- mod[1],
181
- mod[2],
182
- dn))
179
+ print(f"{mod_str} VALUE {mod[1]} = {mod[2]} FOR {dn}")
183
180
  else:
184
181
  self.__con__.modify_s(dn, self.__mod_queue__[dn])
185
182
  except ldap.TYPE_OR_VALUE_EXISTS:
186
- print("Error! Conflicting Batch Modification: %s"
187
- % str(self.__mod_queue__[dn]))
183
+ print(f"Error! Conflicting Batch Modification: {self.__mod_queue__[dn]}")
188
184
  continue
189
185
  except ldap.NO_SUCH_ATTRIBUTE:
190
- print("Error! Conflicting Batch Modification: %s"
191
- % str(self.__mod_queue__[dn]))
186
+ print(f"Error! Conflicting Batch Modification: {self.__mod_queue__[dn]}")
192
187
  continue
193
188
  self.__mod_queue__[dn] = None
194
189
  self.__pending_mod_dn__ = []
@@ -21,7 +21,7 @@ class CSHGroup:
21
21
  res = self.__con__.search_s(
22
22
  self.__ldap_group_ou__,
23
23
  ldap.SCOPE_SUBTREE,
24
- "(cn=%s)" % search_val,
24
+ f"(cn={search_val})",
25
25
  ['cn'])
26
26
 
27
27
  if res:
@@ -35,7 +35,7 @@ class CSHGroup:
35
35
  res = self.__con__.search_s(
36
36
  self.__ldap_base_dn__,
37
37
  ldap.SCOPE_SUBTREE,
38
- "(memberof=%s)" % self.__dn__,
38
+ f"(memberof={self.__dn__})",
39
39
  ['uid'])
40
40
 
41
41
  ret = []
@@ -69,13 +69,13 @@ class CSHGroup:
69
69
  res = self.__con__.search_s(
70
70
  self.__dn__,
71
71
  ldap.SCOPE_BASE,
72
- "(member=%s)" % dn,
72
+ f"(member={dn})",
73
73
  ['ipaUniqueID'])
74
74
  else:
75
75
  res = self.__con__.search_s(
76
76
  self.__dn__,
77
77
  ldap.SCOPE_BASE,
78
- "(member=%s)" % member.get_dn(),
78
+ f"(member={member.get_dn()})",
79
79
  ['ipaUniqueID'])
80
80
  return len(res) > 0
81
81
 
@@ -105,7 +105,7 @@ class CSHGroup:
105
105
  mod_attrs = [mod]
106
106
  self.__con__.modify_s(self.__dn__, mod_attrs)
107
107
  else:
108
- print("ADD VALUE member = {} FOR {}".format(mod[2], self.__dn__))
108
+ print(f"ADD VALUE member = {mod[2]} FOR {self.__dn__}")
109
109
 
110
110
  @reconnect_on_fail
111
111
  def del_member(self, member, dn=False):
@@ -133,5 +133,4 @@ class CSHGroup:
133
133
  mod_attrs = [mod]
134
134
  self.__con__.modify_s(self.__dn__, mod_attrs)
135
135
  else:
136
- print("DELETE VALUE member = {} FOR {}".format(mod[2],
137
- self.__dn__))
136
+ print(f"DELETE VALUE member = {mod[2]} FOR {self.__dn__}")
@@ -24,13 +24,13 @@ class CSHMember:
24
24
  res = self.__con__.search_s(
25
25
  self.__ldap_user_ou__,
26
26
  ldap.SCOPE_SUBTREE,
27
- "(uid=%s)" % search_val,
27
+ f"(uid={search_val})",
28
28
  ['ipaUniqueID'])
29
29
  else:
30
30
  res = self.__con__.search_s(
31
31
  self.__ldap_user_ou__,
32
32
  ldap.SCOPE_SUBTREE,
33
- "(ipaUniqueID=%s)" % search_val,
33
+ f"(ipaUniqueID={search_val})",
34
34
  ['uid'])
35
35
 
36
36
  if res:
@@ -51,7 +51,7 @@ class CSHMember:
51
51
  def __repr__(self):
52
52
  """Generate a str representation of the bound CSH LDAP member object.
53
53
  """
54
- return "CSH Member(dn: %s)" % self.__dn__
54
+ return f"CSH Member(dn: {self.__dn__})"
55
55
 
56
56
  def get(self, key):
57
57
  """Get an attribute from the bound CSH LDAP member object.
@@ -59,7 +59,7 @@ class CSHMember:
59
59
  Arguments:
60
60
  key -- the attribute to get the value of
61
61
  """
62
- return self.__getattr__(key, as_list=True)
62
+ return self.__getattr__(key, as_list=True) # pylint: disable=unnecessary-dunder-call
63
63
 
64
64
  @reconnect_on_fail
65
65
  def groups(self):
@@ -153,7 +153,4 @@ class CSHMember:
153
153
  mod_str = "ADD"
154
154
  else:
155
155
  mod_str = "REPLACE"
156
- print("{} FIELD {} WITH {} FOR {}".format(mod_str,
157
- key,
158
- value,
159
- self.__dn__))
156
+ print(f"{mod_str} FIELD {key} WITH {value} FOR {self.__dn__}")
@@ -25,12 +25,14 @@ def reconnect_on_fail(method):
25
25
  :return: result of method call
26
26
  """
27
27
  max_reconnects = MAX_RECONNECTS
28
- is_cshldap = lambda arg: any(
28
+
29
+ def is_cshldap(arg):
30
+ return any(
29
31
  filter(
30
32
  lambda t: t.__name__ == 'CSHLDAP',
31
33
  type(arg).__mro__
32
- )
33
34
  )
35
+ )
34
36
  ldap_obj = next(filter(is_cshldap, method_args)) \
35
37
  if any(filter(is_cshldap, method_args)) \
36
38
  else method_args[0].__lib__
@@ -55,5 +57,6 @@ def reconnect_on_fail(method):
55
57
  max_reconnects -= 1
56
58
  if max_reconnects == 0:
57
59
  raise
60
+ return None
58
61
 
59
62
  return wrapper
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: csh_ldap
3
+ Version: 2.5.1
4
+ Summary: CSH LDAP ORM
5
+ Home-page: https://github.com/liam-middlebrook/csh_ldap
6
+ Author: Liam Middlebrook
7
+ Author-email: liammiddlebrook@gmail.com
8
+ License: MIT
9
+ Classifier: Natural Language :: English
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ License-File: AUTHORS
14
+ Requires-Dist: python-ldap==3.4.4
15
+ Requires-Dist: srvlookup==2.0.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: license
21
+ Dynamic: license-file
22
+ Dynamic: requires-dist
23
+ Dynamic: summary
24
+
25
+ file: README.md
@@ -1,13 +1,13 @@
1
1
  .pylintrc
2
- .travis.yml
3
2
  AUTHORS
4
3
  ChangeLog
5
4
  LICENSE
6
- README.rst
5
+ README.md
7
6
  requirements-test.txt
8
7
  requirements.txt
9
8
  setup.cfg
10
9
  setup.py
10
+ .github/workflows/python.yaml
11
11
  csh_ldap/__init__.py
12
12
  csh_ldap/group.py
13
13
  csh_ldap/member.py
@@ -0,0 +1 @@
1
+ {"git_version": "29461a1", "is_release": false}
@@ -0,0 +1,2 @@
1
+ python-ldap==3.4.4
2
+ srvlookup==2.0.0
@@ -1,2 +1,2 @@
1
1
  pycodestyle==2.4.0
2
- pylint==2.5.2
2
+ pylint==3.3.8
@@ -0,0 +1,2 @@
1
+ python-ldap==3.4.4
2
+ srvlookup==2.0.0
@@ -1,13 +1,13 @@
1
1
  [metadata]
2
2
  name = csh_ldap
3
3
  author = Liam Middlebrook
4
- author-email = liammiddlebrook@gmail.com
4
+ author_email = liammiddlebrook@gmail.com
5
5
  url = https://github.com/liam-middlebrook/csh_ldap
6
6
  description = CSH LDAP ORM
7
- long_description = file: README.rst
8
- long_description_content_type = text/x-rst
7
+ long_description = file: README.md
8
+ long_description_content_type = text/markdown
9
9
  license = MIT
10
- version = 2.3.1
10
+ version = 2.5.1
11
11
  classifier =
12
12
  Natural Language :: English
13
13
  Operating System :: POSIX :: Linux
@@ -1,13 +0,0 @@
1
- language: python
2
- python:
3
- - "3.5"
4
- - "3.6"
5
- - "3.7"
6
- - "3.8"
7
-
8
- install:
9
- - "pip install -r requirements.txt"
10
- - "pip install -r requirements-test.txt"
11
- script:
12
- - "pycodestyle csh_ldap"
13
- - "pylint csh_ldap"
@@ -1,13 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: csh_ldap
3
- Version: 2.3.1.dev4
4
- Summary: CSH LDAP ORM
5
- Home-page: https://github.com/liam-middlebrook/csh_ldap
6
- Author: Liam Middlebrook
7
- Author-email: liammiddlebrook@gmail.com
8
- License: MIT
9
- Description: CSH LDAP ORM
10
- Platform: UNKNOWN
11
- Classifier: Natural Language :: English
12
- Classifier: Operating System :: POSIX :: Linux
13
- Description-Content-Type: text/x-rst
@@ -1,13 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: csh-ldap
3
- Version: 2.3.1.dev4
4
- Summary: CSH LDAP ORM
5
- Home-page: https://github.com/liam-middlebrook/csh_ldap
6
- Author: Liam Middlebrook
7
- Author-email: liammiddlebrook@gmail.com
8
- License: MIT
9
- Description: CSH LDAP ORM
10
- Platform: UNKNOWN
11
- Classifier: Natural Language :: English
12
- Classifier: Operating System :: POSIX :: Linux
13
- Description-Content-Type: text/x-rst
@@ -1 +0,0 @@
1
- {"git_version": "08a337f", "is_release": false}
@@ -1,2 +0,0 @@
1
- python-ldap==3.0.0
2
- srvlookup==2.0.0
@@ -1,2 +0,0 @@
1
- python-ldap==3.0.0
2
- srvlookup==2.0.0
File without changes
File without changes