Skip to content

v2.0.0

Compare
Choose a tag to compare
@maxtepkeev maxtepkeev released this 10 Apr 21:07

This version brings a lot of new features and changes, some of them are backward-incompatible, so please look carefully at the changelog below to find out what needs to be changed in your code to make it work with this version. Also Python-Redmine now comes in 2 editions: Standard and Pro, please have a look at this document for more details. Documentation was also significantly rewritten, so it is recommended to reread it even if you are an experienced Python-Redmine user.

New Features:

  • RedmineUP Checklist plugin support
  • Request Engines support. It is now possible to create engines to define how requests to Redmine are made, e.g. synchronous (one by one) or asynchronous using threads or processes etc.
  • redmine.session() context manager which allows to temporary redefine engine's behaviour
  • Search API support (Issue #138)
  • Export functionality (Issue #58)
  • REDMINE_USE_EXTERNAL_REQUESTS environmental variable for emergency cases which allows to use external requests instead of bundled one even if external requests version is lower than the bundled one
  • Wrong HTTP protocol usage detector, e.g. one use HTTP when HTTPS should be used

Improvements:

  • ResourceSet objects were completely rewritten:

    • ResourceSet object that was already sliced now supports reslicing
    • ResourceSet object's delete(), update(), filter() and get() methods have been optimized for speed
    • ResourceSet object's delete() and update() methods now call the corresponding Resource's pre_*() and post_*() methods
    • ResourceSet object's get() and filter() methods now supports non-integer id's, e.g. WikiPage's title can now be used with it
    • ValuesResourceSet class has been removed
    • ResourceSet.values() method now returns an iterable of dicts instead of ValuesResourceSet object
    • ResourceSet.values_list() method has been added which returns an iterable of tuples with Resource values or single values if flattened, i.e. flat=True
  • New Resource object methods:

    • delete() deletes current resource from Redmine
    • pre_delete() and post_delete() can be used to execute tasks that should be done before/after deleting the resource through delete() method
    • bulk_decode(), bulk_encode(), decode() and encode() which are used to translate attributes of the resource to/from Python/Redmine
  • Attachment delete() method support (requires Redmine >= 3.3.0)

  • RedmineUP CRM Note resource now provides type attribute which shows text representation of type_id

  • RedmineUP CRM DealStatus resource now provides status attribute which shows text representation of status_type

  • WikiPage resource now provides project_id attribute

  • Unicode handling was significantly rewritten and shouldn't cause any more troubles

  • UnknownError exception now contains status_code attribute which can be used to handle the exception instead of parsing code from exception's text

  • Sync engine's speed improved to 8-12% depending on the amount of resources fetched

Changes:

  • Renamed package name from redmine to redminelib
  • Resource class attributes that were previously tuples are now lists
  • _Resource class renamed to Resource
  • Redmine.custom_resource_paths keyword argument renamed to resource_paths
  • Redmine.download() method now returns a requests.Response object directly instead of iter_content() method if a savepath param wasn't provided, this gives user even more control over response data
  • Resource.refresh() now really refreshes itself instead of returning a new refreshed resource, to get the previous behaviour use itself param, e.g. Resource.refresh(itself=False)
  • Removed Python 3.2 support
  • Removed container_filter, container_create and container_update attributes on Resource object in favor of container_many attribute
  • Removed Resource.translate_params() and ResourceManager.prepare_params() in favor of Resource.bulk_decode()
  • Removed is_unicode(), is_string() and to_string() from redminelib.utilities
  • Updated bundled requests library to v2.13.0

Bugfixes:

  • Infinite loop when uploading zero-length files (Issue #152)
  • Unsupported Redmine resource error while trying to use Python-Redmine without installation (Issue #156)
  • It was impossible to set data, params and headers via requests keyword argument on Redmine object
  • Calling str() or repr() on a Resource was giving incorrect results if exception raising was turned off for a resource

Documentation:

  • Switched to the alabaster theme

  • Added new sections:

  • Added info about Issue Journals (Issue #120)

  • Added note about open/closed issues (Issue #136)

  • Added note about regexp custom field filter (Issue #164)

  • Added some new information here and there