commit 6c9f6ccdd4d6cd0dbf81f893eceac9d2baae66fead35cf04f1f25cc50742b2ef Author: Sebastian Wagner Date: Thu Jan 1 10:25:06 2026 +0000 - Update to version v3.4.0: - Added - Added functionality for some of the asset endpoints (get, create, edit, search, get history) - Added functionality for the get catalog endpoint - Update to version v3.3.9: - Fixes - In debug mode, where content may be dumped, said content may not decode correctly if it is not utf-8. Ignore errors as we don't care about that in debug mode anyways (fixes #113) - Update to version v3.3.8: - Added - Allow for specifying a custom RT JSON filter when querying for attachments for a ticket (#110). This solved the issue with not returning attachment IDs in case an attachment file name is empty as the default query explicitely excludes those. - Changes - Remove unused noqa directives - Do not use len() in asset when no comparison is being done - Add quotes to type expression in `typing.cast()` - Update to version v3.3.7: - Changes - Use RT v6 based docker image for tests - Fixes - Fix optional return types (#111) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rt?expand=0&rev=51 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-rt.changes b/python-rt.changes new file mode 100644 index 0000000..1ed79d1 --- /dev/null +++ b/python-rt.changes @@ -0,0 +1,263 @@ +------------------------------------------------------------------- +Thu Jan 1 10:24:10 UTC 2026 - Sebastian Wagner + +- Update to version v3.4.0: + - Added + - Added functionality for some of the asset endpoints (get, create, edit, search, get history) + - Added functionality for the get catalog endpoint +- Update to version v3.3.9: + - Fixes + - In debug mode, where content may be dumped, said content may not decode correctly if it is not utf-8. Ignore errors as we don't care about that in debug mode anyways (fixes #113) +- Update to version v3.3.8: + - Added + - Allow for specifying a custom RT JSON filter when querying for attachments for a ticket (#110). This solved the issue with not returning attachment IDs in + case an attachment file name is empty as the default query explicitely excludes those. + - Changes + - Remove unused noqa directives + - Do not use len() in asset when no comparison is being done + - Add quotes to type expression in `typing.cast()` +- Update to version v3.3.7: + - Changes + - Use RT v6 based docker image for tests + - Fixes + - Fix optional return types (#111) + +------------------------------------------------------------------- +Fri Sep 5 20:03:55 UTC 2025 - Dirk Müller + +- update to 3.3.6: + * Catch *TransportError* from httpx and re-raise as + *ConnectionError* so that httpx transport error exceptions do + not leak (fixes #109). + * There was still a comparison issue, fix bad date comparison + (fixes #107) + +------------------------------------------------------------------- +Mon Mar 10 14:25:56 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 3.3.4 + * Remove requirements section. this can be easily reviewed + in pyproject.toml + * Fix bad date comparison; fixes (#107) +- Use Python 3.11 on SLE-15 by default + +------------------------------------------------------------------- +Tue Jan 7 10:32:07 UTC 2025 - Sebastian Wagner + +- switch to github tarball, as there's no longer an sdist on pypi +- update to version v3.3.3: + - Changes + - Starting with version 0.28.0 of httpx, *verify* should be either a bool or an *SSL Context*. +- update to version 3.3.2: + - Fixes + - Replace the removed httpx parameter of *proxies* by *proxy* (fixes #102) + - Pin dependencies to supported relative upstream versions. + - Remove the now obsolete *setup.py*. +- update to version 3.3.1: + - Fixes + - Fix str(bytes) warning (*BytesWarning: str() on a bytes instance*) (#1074) + - Changes + - Set included files for ruff + - Switch to hatchling + - Set ignores for tests files + - Ignore uv.lock +- update to version 3.3.0: + - Removed + - Remove support for now EoL Python 3.8. +- update to version 3.2.0: + - Added + - 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) + +------------------------------------------------------------------- +Mon Sep 23 09:20:54 UTC 2024 - Dirk Müller + +- update to 3.2.0: + * 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) + +------------------------------------------------------------------- +Thu Mar 14 08:56:09 UTC 2024 - Dirk Müller + +- update to 3.1.4: + * Add a workaround for a breaking change introduced in RT5.0.5 + which returns undefined pages variable for non-superusers + +------------------------------------------------------------------- +Fri Dec 8 16:08:22 UTC 2023 - Dirk Müller + +- update to 3.1.3: + * Fix an issue where no e-mail was sent on ticket creation due + to suggesting to use **Requestors** instead of **Requestor** + * Revert breaking change for python3.8 + (collections.abc.AsyncIterator is not subscriptable). + * In AsyncRt, instead of returning sequences, return + AsyncIterators. + * Replace *requests* with *httpx* for the REST2 part. + * Add a new *AsyncRt* class which implements the RT REST2 API + in asnyc. + * Adapt tests to include thew new async parts of this library. + +------------------------------------------------------------------- +Fri Aug 11 07:39:10 UTC 2023 - Sebastian Wagner + +- update to version 3.0.7: + - Fix sorting when using search() method (#90) + +------------------------------------------------------------------- +Tue Jul 18 18:39:29 UTC 2023 - Antonio Teixeira + +- Update to version 3.0.6: + * Added support for specifying custom fields on user creation/edit (#82). + * Fixed bug in rest1 (#86). + +------------------------------------------------------------------- +Sat Dec 3 00:27:47 UTC 2022 - Yogalakshmi Arunachalam + +- Update to version 3.0.4: + * Workaround for parsing issues with tickets with only 1 attachment (#80), due to probably an upstream bug. + +------------------------------------------------------------------- +Fri Jul 8 09:36:12 UTC 2022 - Duarte Pousa + +- fix regression in version 3.0.3: + - Temporary revert to setup.cfg from 3.0.2, due to: https://github.com/pypa/setuptools/issues/3269 + +------------------------------------------------------------------- +Tue Jun 21 08:49:07 UTC 2022 - Sebastian Wagner + +- update to version 3.0.3: + - Move package metadata and configuration from setup.cfg to pyproject.toml. +- update to version 3.0.2: + - Fix edit_user() response handling in case a user_id name (str) was passed instead of a number. + +------------------------------------------------------------------- +Fri May 27 06:53:41 UTC 2022 - Sebastian Wagner + +- update to version 3.0.1: + - Fixes + - Make sure to include _hyperlinks in history items + - On edit ticket, raise exception if user/queue does not exist + - Added + - Add helper method for deleting tickets + - Add tests + +------------------------------------------------------------------- +Sun May 22 10:18:29 UTC 2022 - Sebastian Wagner + +- update to version 3.0.0 + - The following is a major release of the `rt` library. + - There is support for the REST API version 1 as well as version 2. + - Please note that this release contains breaking changes and requires adaptations to existing code, even if you are sticking to version 1 of the API. + - These changes were necessary in order to properly support both API versions. + - Added + - RT REST2 support was added and is mostly on par with the REST1 support (differences are a result of the REST2 API implementation differences in RT). + - REST2 is a modern API based on JSON exchanges and thus the complex parsing of responses and request construction are no longer needed. + - Changes + - Existing exception classes were renamed to adhere to the naming convention (https://peps.python.org/pep-0008/#exception-names). + - In case you do catch specific `rt` exceptions, a simple search/replace will do, see the changelog page in the documentation for details. + - Importing the `rt` class changed in order to better accommodate the new `rest2` implementation. + - Where one use to be able to import `rt` using: + `from rt import Rt` + you now have to use the following syntax: + `from rt.rest1 import Rt` + - Importing the `rt` module does no longer import all exceptions but only the core `RtError` exception. + - If you require other exceptions, please import them from `rt.exceptions`. + - Use pytest instead of nose. + +------------------------------------------------------------------- +Sat Apr 9 07:30:39 UTC 2022 - Sebastian Wagner + +- Update to version 2.2.2: + - Fix bug in the get_ticket would omit certain fields in case they were empty instead of returning an empty list as was the previous behavior (#70). + - Add tests for verifying correct return result for AdminCc, Cc and Requestor fields. + +------------------------------------------------------------------- +Sat Nov 27 10:11:12 UTC 2021 - Sebastian Wagner + +- Update to version 2.2.1: + - Fix bug in get_attachment_content which was a workaround for a bug in RT <=4.2 (trailing new-lines) but which was fixed in RT >=4.2. This made tests fail and return falsely stripped attachment content. + +------------------------------------------------------------------- +Mon Nov 15 20:53:35 UTC 2021 - Sebastian Wagner + +- Update to version 2.2.0: + - Search has a parameter fields that can be used to return only particular fields for tickets. In some cases I noticed it will improve the speed of the query completion if you only need specific fields (#65 by @kimmoal). + +------------------------------------------------------------------- +Thu Apr 8 11:38:15 UTC 2021 - Sebastian Wagner + +- Update to version 2.1.1: + - Fix support for custom field values containing newlines in API responses (#10, #11) + (the previous change in v1.0.11 fixed API requests) (#64) + +------------------------------------------------------------------- +Thu Feb 25 19:44:00 UTC 2021 - Sebastian Wagner + +- Update to version 2.1.0: + - Add the possibility to provide cookies as dict to authenticate (#60) + - Add IS and IS NOT operators to search (#57) + +------------------------------------------------------------------- +Sun Aug 16 15:54:38 UTC 2020 - Sebastian Wagner + +- Remove Requires for nose, not used. + +------------------------------------------------------------------- +Sat Aug 8 12:16:55 UTC 2020 - Sebastian Wagner + +- update to version 2.0.1: + - Documentation: add search example + - edit_ticket: handle empty responses + - fix UnicodeDecodeError in logging code for non-text attachments + +------------------------------------------------------------------- +Sun Mar 15 10:43:52 UTC 2020 - Sebastian Wagner + +- update to version 2.0.0: + - Drop Python2 support + - Adjust Travis tests for Python3-only, and add v3.8 + - Add inline typing + - Remove "debug_mode" parameter + - Add "logging" support (basically replacing "debug_mode" and the various "print"s) + - Fix "no-else-after-return" and "no-else-after-raise" + - Fix "startswitch" typos / bugs + - Removed deprecated "basic_auth" and "digest_auth" paramters. The same functionality is given by specifying the + "http_auth" with an instance of either object. This allows for more flexibility with various other alternative + authentication methods. +- update to version 1.0.13: + - Add deprecation warning for in the next major release unsupported parameters (basic_auth, digest_auth). + They are now replaced with http_auth. + - Fix problematic default method parameters ("{}" and "[]"). + +------------------------------------------------------------------- +Tue Nov 26 14:36:32 UTC 2019 - Sebastian Wagner + +- update to version 1.0.12: + - Travis CI Docker tests + - RT 4.4 fixes + - Support multiline CF values in create_ticket and edit_ticket. + - Fix support for custom field names containing colons + - In search(), replace splitlines() with lines array split on \n. + - Add debug_mode flag for response logging + - Add platform independent url joining / Allow testing on Windows + - Add numerical_id to get_ticket result + +------------------------------------------------------------------- +Tue Dec 4 12:53:59 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Sun Jul 29 17:34:16 UTC 2018 - sebix+novell.com@sebix.at + +- update to version 1.0.11: + - Added parameter to set the content type in reply() and comment() (#12). + - Added parameter Format to search() (#17). + - Tests: Update to new demo instance, fixing tests. + +------------------------------------------------------------------- +Mon Mar 12 19:42:10 UTC 2018 - sebix+novell.com@sebix.at + +- initial package for version 1.0.10 diff --git a/python-rt.spec b/python-rt.spec new file mode 100644 index 0000000..e5376d7 --- /dev/null +++ b/python-rt.spec @@ -0,0 +1,66 @@ +# +# spec file for package python-rt +# +# Copyright (c) 2026 SUSE LLC and contributors +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-rt +Version: 3.4.0 +Release: 0 +Summary: Python interface to Request Tracker API +License: GPL-3.0-only +Group: Development/Languages/Python +URL: https://github.com/CZ-NIC/python-rt +Source: https://github.com/python-rt/python-rt/archive/refs/tags/v%{version}.tar.gz#/rt-%{version}.tar.gz +Source1: setup.cfg +BuildRequires: %{python_module base >= 3.9} +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-httpx >= 0.28 +Requires: python-requests +BuildArch: noarch + +%python_subpackages + +%description +Python implementation of Request Tracker (a ticketing system) REST API described here: https://rt-wiki.bestpractical.com/wiki/REST + +%prep +%setup -q -n python-rt-%{version} +cp %{SOURCE1} setup.cfg +sed -i 's/^dynamic = \["version"]/version = "%{version}"/' pyproject.toml + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# Tests require internet connection + +%files %{python_files} +%doc AUTHORS CHANGELOG.md README.rst +%license LICENSE +%{python_sitelib}/rt-%{version}*-info* +%{python_sitelib}/rt/ + +%changelog diff --git a/rt-3.3.6.tar.gz b/rt-3.3.6.tar.gz new file mode 100644 index 0000000..ad43270 --- /dev/null +++ b/rt-3.3.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa8f1a55a1745dfcde91de75cb8ee5a9bd605f10dea3bc3d62e32dd6fbd81f3f +size 72647 diff --git a/rt-3.4.0.tar.gz b/rt-3.4.0.tar.gz new file mode 100644 index 0000000..5ace747 --- /dev/null +++ b/rt-3.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb47e3ab1eca6d8037c3bf5a2c2f5184e3b6dab7f6f0be274b7047f858a53190 +size 75330 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..250311e --- /dev/null +++ b/setup.cfg @@ -0,0 +1,77 @@ +[bdist_wheel] +universal = 0 + +[metadata] +name = rt +description = Python interface to Request Tracker API +long_description = file: README.rst +long_description_content_type = text/x-rst +license = GNU General Public License v3 (GPLv3) +license_file = LICENSE +author = Georges Toth +author_email = georges.toth@govcert.etat.lu +url = https://github.com/python-rt/python-rt +classifiers = + Development Status :: 5 - Production/Stable + Environment :: Console + Intended Audience :: Developers + License :: OSI Approved :: GNU General Public License v3 (GPLv3) + Operating System :: POSIX + Programming Language :: Python + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3 + Topic :: Software Development :: Libraries :: Python Modules +project_urls = + Documentation = https://python-rt.readthedocs.io/ + Source = https://github.com/python-rt/python-rt + Tracker = https://github.com/python-rt/python-rt/issues + Changelog = https://github.com/python-rt/python-rt/blob/master/CHANGELOG.md + +[options] +zip_safe = False +packages = rt +include_package_data = True +python_requires = >= 3.7 +install_requires = + requests + requests_toolbelt + typing-extensions ; python_version < "3.8" + +[options.packages.find] +exclude = + tests + +[options.package_data] +rt = py.typed + +[options.extras_require] +docs = + sphinx + sphinx-autodoc-typehints + sphinx-rtd-theme + furo + sphinx-copybutton +dev = + pycodestyle + pylint + mypy + flake8 + flake8-bandit + flake8-comprehensions + flake8-docstrings + pep8-naming + types-requests + codespell +test = + pytest + coverage + + +[pycodestyle] +filename = rt/rt.py +ignore = E501, W503, E124, E126 + + +[flake8] +max-line-length = 240 +ignore = D210, D400, W503, D205, D209, D401, E126, E124, N803