rt 3.1.3__tar.gz → 3.2.0__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 (42) hide show
  1. {rt-3.1.3 → rt-3.2.0}/.editorconfig +1 -1
  2. {rt-3.1.3 → rt-3.2.0}/CHANGELOG.md +8 -0
  3. {rt-3.1.3 → rt-3.2.0}/PKG-INFO +3 -9
  4. {rt-3.1.3 → rt-3.2.0}/doc/changelog.rst +12 -0
  5. rt-3.2.0/noxfile.py +16 -0
  6. rt-3.2.0/pyproject.toml +190 -0
  7. {rt-3.1.3 → rt-3.2.0}/rt/exceptions.py +14 -15
  8. {rt-3.1.3 → rt-3.2.0}/rt/rest1.py +245 -198
  9. {rt-3.1.3 → rt-3.2.0}/rt/rest2.py +585 -339
  10. {rt-3.1.3 → rt-3.2.0}/rt.egg-info/PKG-INFO +3 -9
  11. {rt-3.1.3 → rt-3.2.0}/rt.egg-info/SOURCES.txt +2 -2
  12. {rt-3.1.3 → rt-3.2.0}/rt.egg-info/requires.txt +2 -8
  13. rt-3.2.0/run_nox.sh +11 -0
  14. {rt-3.1.3 → rt-3.2.0}/tests/conftest.py +2 -0
  15. {rt-3.1.3 → rt-3.2.0}/tests/test_basic.py +30 -9
  16. {rt-3.1.3 → rt-3.2.0}/tests/test_basic_async.py +33 -10
  17. {rt-3.1.3 → rt-3.2.0}/tests/test_rest1.py +20 -19
  18. {rt-3.1.3 → rt-3.2.0}/tests/test_tickets.py +8 -4
  19. {rt-3.1.3 → rt-3.2.0}/tests/test_tickets_async.py +11 -5
  20. rt-3.1.3/.flake8 +0 -3
  21. rt-3.1.3/.pylintrc +0 -576
  22. rt-3.1.3/pyproject.toml +0 -170
  23. {rt-3.1.3 → rt-3.2.0}/.codespell_ignore +0 -0
  24. {rt-3.1.3 → rt-3.2.0}/AUTHORS +0 -0
  25. {rt-3.1.3 → rt-3.2.0}/LICENSE +0 -0
  26. {rt-3.1.3 → rt-3.2.0}/MANIFEST.in +0 -0
  27. {rt-3.1.3 → rt-3.2.0}/README.rst +0 -0
  28. {rt-3.1.3 → rt-3.2.0}/doc/Makefile +0 -0
  29. {rt-3.1.3 → rt-3.2.0}/doc/conf.py +0 -0
  30. {rt-3.1.3 → rt-3.2.0}/doc/exceptions.rst +0 -0
  31. {rt-3.1.3 → rt-3.2.0}/doc/glossary.rst +0 -0
  32. {rt-3.1.3 → rt-3.2.0}/doc/index.rst +0 -0
  33. {rt-3.1.3 → rt-3.2.0}/doc/rest1.rst +0 -0
  34. {rt-3.1.3 → rt-3.2.0}/doc/rest2.rst +0 -0
  35. {rt-3.1.3 → rt-3.2.0}/doc/usage.rst +0 -0
  36. {rt-3.1.3 → rt-3.2.0}/rt/__init__.py +0 -0
  37. {rt-3.1.3 → rt-3.2.0}/rt/py.typed +0 -0
  38. {rt-3.1.3 → rt-3.2.0}/rt.egg-info/dependency_links.txt +0 -0
  39. {rt-3.1.3 → rt-3.2.0}/rt.egg-info/top_level.txt +0 -0
  40. {rt-3.1.3 → rt-3.2.0}/setup.cfg +0 -0
  41. {rt-3.1.3 → rt-3.2.0}/setup.py +0 -0
  42. {rt-3.1.3 → rt-3.2.0}/tests/__init__.py +0 -0
@@ -8,7 +8,7 @@ indent_style = space
8
8
  [{*.pyw,*.py}]
9
9
  indent_size = 4
10
10
  tab_width = 4
11
- max_line_length = 240
11
+ max_line_length = 140
12
12
  ij_continuation_indent_size = 4
13
13
  ij_python_blank_line_at_file_end = true
14
14
 
@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [v3.2.0], 2024-09-06
7
+ ## Added
8
+ - Added option for custom list of fields to be populated for search "query_format" param to avoid unnecessary round trips to get fields like Told, Starts, Resolved, etc by returning the required fields during search. (see #97 @nerdfirefighter)
9
+
10
+ ## [v3.1.4], 2024-02-16
11
+ ### Fixes
12
+ - Add a workaround for a breaking change introduced in RT5.0.5 which returns undefined pages variable for non-superusers (see #93 #94).
13
+
6
14
  ## [v3.1.3], 2023-10-10
7
15
  ### Fixes
8
16
  - Fix an issue where no e-mail was sent on ticket creation due to suggesting to use **Requestors** instead of **Requestor** (https://github.com/python-rt/python-rt/pull/92).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rt
3
- Version: 3.1.3
3
+ Version: 3.2.0
4
4
  Summary: Python interface to Request Tracker API
5
5
  Author-email: Georges Toth <georges.toth@govcert.etat.lu>
6
6
  License: GNU General Public License v3 (GPLv3)
@@ -31,17 +31,11 @@ Requires-Dist: sphinx-rtd-theme; extra == "docs"
31
31
  Requires-Dist: furo; extra == "docs"
32
32
  Requires-Dist: sphinx-copybutton; extra == "docs"
33
33
  Provides-Extra: dev
34
- Requires-Dist: pycodestyle; extra == "dev"
35
- Requires-Dist: pylint; extra == "dev"
36
34
  Requires-Dist: mypy; extra == "dev"
37
- Requires-Dist: flake8; extra == "dev"
38
- Requires-Dist: flake8-bandit; extra == "dev"
39
- Requires-Dist: flake8-comprehensions; extra == "dev"
40
- Requires-Dist: flake8-docstrings; extra == "dev"
41
- Requires-Dist: pep8-naming; extra == "dev"
35
+ Requires-Dist: ruff; extra == "dev"
42
36
  Requires-Dist: types-requests; extra == "dev"
43
37
  Requires-Dist: codespell; extra == "dev"
44
- Requires-Dist: ruff; extra == "dev"
38
+ Requires-Dist: bandit; extra == "dev"
45
39
  Provides-Extra: test
46
40
  Requires-Dist: pytest; extra == "test"
47
41
  Requires-Dist: pytest-asyncio; extra == "test"
@@ -1,6 +1,18 @@
1
1
  Change Log
2
2
  ==========
3
3
 
4
+ Version 3.2.0 (2024-09-06)
5
+ ----------------------------
6
+ Added
7
+ ^^^^^
8
+ - Added option for custom list of fields to be populated for search "query_format" param to avoid unnecessary round trips to get fields like Told, Starts, Resolved, etc by returning the required fields during search. (see #97 @nerdfirefighter)
9
+
10
+ Version 3.1.4 (2024-02-16)
11
+ ----------------------------
12
+ Fixes
13
+ ^^^^^
14
+ - Add a workaround for a breaking change introduced in RT5.0.5 which returns undefined pages variable for non-superusers (see #93 #94).
15
+
4
16
  Version 3.1.3 (2023-10-10)
5
17
  ----------------------------
6
18
  Fixes
rt-3.2.0/noxfile.py ADDED
@@ -0,0 +1,16 @@
1
+ """Used for testing against multiple version of Python."""
2
+
3
+ import nox
4
+
5
+
6
+ @nox.session(python=['3.8', '3.9', '3.10', '3.11'])
7
+ def test_and_typing(session):
8
+ session.install('.[test,dev]')
9
+ session.run('pytest', 'tests')
10
+ session.run('mypy', 'rt')
11
+
12
+
13
+ @nox.session()
14
+ def lint(session):
15
+ session.install(".[test,dev]")
16
+ session.run('ruff', 'rt')
@@ -0,0 +1,190 @@
1
+ [build-system]
2
+ requires = ["setuptools>=65", "setuptools_scm[toml]>=7.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rt"
7
+ description = "Python interface to Request Tracker API"
8
+ readme = "README.rst"
9
+ license = { text = "GNU General Public License v3 (GPLv3)" }
10
+ authors = [{ name = "Georges Toth", email = "georges.toth@govcert.etat.lu" }]
11
+ classifiers = [
12
+ "Development Status :: 5 - Production/Stable",
13
+ "Environment :: Console",
14
+ "Intended Audience :: Developers",
15
+ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
16
+ "Operating System :: POSIX",
17
+ "Programming Language :: Python",
18
+ "Programming Language :: Python :: 3 :: Only",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Software Development :: Libraries :: Python Modules",
21
+ ]
22
+ requires-python = ">= 3.8"
23
+ dependencies = [
24
+ "requests",
25
+ "httpx",
26
+ ]
27
+ dynamic = ["version"]
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/python-rt/python-rt"
31
+ Documentation = "https://python-rt.readthedocs.io/"
32
+ Source = "https://github.com/python-rt/python-rt"
33
+ Tracker = "https://github.com/python-rt/python-rt/issues"
34
+ Changelog = "https://github.com/python-rt/python-rt/blob/master/CHANGELOG.md"
35
+
36
+ [project.optional-dependencies]
37
+ docs = [
38
+ "sphinx",
39
+ "sphinx-autodoc-typehints",
40
+ "sphinx-rtd-theme",
41
+ "furo",
42
+ "sphinx-copybutton",
43
+ ]
44
+ dev = [
45
+ "mypy",
46
+ "ruff",
47
+ "types-requests",
48
+ "codespell",
49
+ "bandit",
50
+ ]
51
+ test = [
52
+ "pytest",
53
+ "pytest-asyncio",
54
+ "coverage",
55
+ ]
56
+
57
+ [tool.setuptools]
58
+ include-package-data = true
59
+
60
+ [tool.setuptools.packages.find]
61
+ exclude = ["tests"]
62
+ namespaces = false
63
+
64
+ [tool.pycodestyle]
65
+ filename = "rt/rt.py"
66
+ ignore = "E501, W503, E124, E126"
67
+
68
+ [tool.setuptools_scm]
69
+
70
+ [tool.mypy]
71
+ show_error_codes = true
72
+ show_error_context = true
73
+ show_column_numbers = true
74
+ ignore_missing_imports = true
75
+ disallow_incomplete_defs = true
76
+ disallow_untyped_defs = true
77
+ disallow_untyped_calls = false
78
+ warn_no_return = true
79
+ warn_redundant_casts = true
80
+ warn_unused_ignores = true
81
+ strict_optional = true
82
+ check_untyped_defs = false
83
+
84
+ files = [
85
+ "rt/**/*.py"
86
+ ]
87
+
88
+ [tool.pytest.ini_options]
89
+ minversion = "6.0"
90
+ testpaths = [
91
+ "tests"
92
+ ]
93
+
94
+ [tool.ruff]
95
+ line-length = 140
96
+ indent-width = 4
97
+ target-version = "py38"
98
+
99
+ [tool.ruff.lint]
100
+ select = [
101
+ "E", # pycodestyle errors
102
+ "W", # pycodestyle warnings
103
+ "F", # pyflakes
104
+ "I", # isort
105
+ "C", # flake8-comprehensions
106
+ "B", # flake8-bugbear
107
+ "D", # pydocstyle
108
+ "N", # pep8-naming
109
+ "UP", # pyupgrade
110
+ "YTT", # flake8-2020
111
+ "ANN", # flake8-annotations
112
+ "ASYNC", # flake8-async
113
+ "S", # flake8-bandit
114
+ "BLE", # flake8-blind-except
115
+ "B", # flake8-bugbear
116
+ "A", # flake8-builtins
117
+ "COM", # flake8-commas
118
+ "C4", # flake8-comprehensions
119
+ "DTZ", # flake8-datetimez
120
+ "EM103", # flake8-errmsg - dot-format-in-exception
121
+ "EXE", # flake8-executable
122
+ "ISC", # flake8-implicit-str-concat
123
+ "ICN", # flake8-import-conventions
124
+ "G", # flake8-logging-format
125
+ "INP", # flake8-no-pep420
126
+ "PIE", # flake8-pie
127
+ "T20", # flake8-print
128
+ "PYI", # flake8-pyi
129
+ "RSE", # flake8-raise
130
+ "RET", # flake8-return
131
+ "SLF", # flake8-self
132
+ "SLOT", # flake8-slots
133
+ # "SIM", # flake8-simplify
134
+ "TID", # flake8-tidy-imports
135
+ "TCH", # flake8-type-checking
136
+ "PTH", # flake8-use-pathlib
137
+ "TD", # flake8-todos
138
+ "FIX", # flake8-fixme
139
+ "ERA", # eradicate
140
+ "PL", # Pylint
141
+ "PLC", # Convention
142
+ "PLE", # Error
143
+ "PLR", # Refactor
144
+ "PLW", # Warning
145
+ "B904", # reraise-no-cause
146
+ "FLY", # flynt
147
+ # "PERF", # Perflint
148
+ "RUF013", # implicit-optional
149
+ ]
150
+ unfixable = [
151
+ 'ERA001',
152
+ 'T201', # `print` found
153
+ ]
154
+ extend-select = ['Q', 'RUF100', 'C90']
155
+ flake8-quotes = { inline-quotes = 'single', multiline-quotes = 'single' }
156
+ ignore = [
157
+ "C901", # too complex
158
+ "E501", # line too long
159
+ "B008", # do not perform function call in argument defaults
160
+ "ANN101", # missing-type-self
161
+ "ANN401", # any-type
162
+ "ANN002", # missing-type-args
163
+ "ANN003", # missing-type-kwargs
164
+ "ANN102", # missing-type-cls
165
+ "PLR0913", # Too many arguments to function call
166
+ "PLR0915", # Too many statements
167
+ "PLR2004", # Magic value used in comparison
168
+ "PLW0603", # Using the global statement
169
+ "PLR0912", # Too many branches
170
+ "COM812", # missing-trailing-comma
171
+ "ISC001", # single-line-implicit-string-concatenation
172
+ "Q001", # bad-quotes-multiline-string
173
+ "RET504", # Unnecessary assignment before `return` statement
174
+ "D401", # First line of docstring should be in imperative mood
175
+ "D205", # 1 blank line required between summary line and description
176
+ ]
177
+
178
+ [tool.ruff.lint.per-file-ignores]
179
+ "tests/**" = [
180
+ "ANN", # Missing return type annotation
181
+ ]
182
+ "rt/rest1.py" = [
183
+ "N803", # Argument name should be lowercase
184
+ ]
185
+
186
+ [tool.ruff.format]
187
+ quote-style = "single"
188
+
189
+ [tool.ruff.lint.pydocstyle]
190
+ convention = "numpy"
@@ -4,33 +4,32 @@ import typing
4
4
 
5
5
 
6
6
  class RtError(Exception):
7
- """ Super class of all Rt Errors """
7
+ """Super class of all Rt Errors."""
8
8
 
9
9
 
10
10
  class AuthorizationError(RtError):
11
- """ Exception raised when module cannot access :term:`API` due to invalid
12
- or missing credentials. """
11
+ """Exception raised when module cannot access :term:`API` due to invalid or missing credentials."""
13
12
 
14
13
 
15
14
  class NotAllowedError(RtError):
16
- """ Exception raised when request cannot be finished due to
17
- insufficient privileges. """
15
+ """Exception raised when request cannot be finished due to insufficient privileges."""
18
16
 
19
17
 
20
18
  class UnexpectedResponseError(RtError):
21
- """ Exception raised when unexpected HTTP code is received. """
19
+ """Exception raised when unexpected HTTP code is received."""
22
20
 
23
21
  def __init__(self, message: str, status_code: typing.Optional[int] = None, response_message: typing.Optional[str] = None) -> None:
24
- """ Initialization."""
22
+ """Initialization."""
25
23
  super().__init__(message)
26
24
  self.status_code = status_code
27
25
  self.response_message = response_message
28
26
 
29
27
 
30
28
  class UnexpectedMessageFormatError(RtError):
31
- """ Exception raised when response has bad status code (not the HTTP code,
29
+ """Exception raised when response has bad status code (not the HTTP code,
32
30
  but code in the first line of the body as 200 in `RT/4.0.7 200 Ok`)
33
- or message parsing fails because of unexpected format. """
31
+ or message parsing fails because of unexpected format.
32
+ """
34
33
 
35
34
 
36
35
  class NotFoundError(RtError):
@@ -38,22 +37,22 @@ class NotFoundError(RtError):
38
37
 
39
38
 
40
39
  class APISyntaxError(RtError):
41
- """ Exception raised when syntax error is received. """
40
+ """Exception raised when syntax error is received."""
42
41
 
43
42
 
44
43
  class InvalidUseError(RtError):
45
- """ Exception raised when API method is not used correctly. """
44
+ """Exception raised when API method is not used correctly."""
46
45
 
47
46
 
48
47
  class BadRequestError(RtError):
49
- """ Exception raised when HTTP code 400 (Bad Request) is received. """
48
+ """Exception raised when HTTP code 400 (Bad Request) is received."""
50
49
 
51
50
 
52
51
  class ConnectionError(RtError):
53
- """ Encapsulation of various exceptions indicating network problems. """
52
+ """Encapsulation of various exceptions indicating network problems."""
54
53
 
55
54
  def __init__(self, message: str, cause: Exception) -> None:
56
- """ Initialization of exception extended by cause parameter.
55
+ """Initialization of exception extended by cause parameter.
57
56
 
58
57
  :keyword message: Exception details
59
58
  :keyword cause: Cause exception
@@ -63,4 +62,4 @@ class ConnectionError(RtError):
63
62
 
64
63
 
65
64
  class InvalidQueryError(RtError):
66
- """ Exception raised when attempting to search RT with an invalid raw query. """
65
+ """Exception raised when attempting to search RT with an invalid raw query."""