Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtepkeev committed Nov 26, 2015
1 parent b1a431d commit f634e65
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog
++++++++++++++++++

- Added: Documented support for new fields and field values in User, Issue and IssueRelation resources
- Added: `Issue #109 <https://github.com/maxtepkeev/python-redmine/issues/109>`__ (Smart imports for
vendored packages (see `docs <http://python-redmine.readthedocs.org/installation.html#dependencies>`__
for details)
- Added: `Issue #115 <https://github.com/maxtepkeev/python-redmine/issues/115>`__ (File upload support
for WikiPage resource)

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
recursive-include tests *.py
include .coveragerc README.rst CHANGELOG.rst LICENSE NOTICE
include .coveragerc README.rst CHANGELOG.rst LICENSE NOTICE redmine/packages/requests/cacert.pem
15 changes: 15 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
Installation
============

Dependencies
------------

Python Redmine relies heavily on great `Requests <http://docs.python-requests.org>`_ library by Kenneth Reitz
for all the http(s) calls. To provide better user experience, Python-Redmine vendors Requests (i.e. embeds it
inside itself) and uses a so-called "smart imports" strategy to identify whether it should use the vendored
version or the global one. It works like this, at the first import time Python-Redmine checks if there is a
global Requests installed and if it's version is greater than the vendored Requests, Python-Redmine will use
global Requests and if not, the vendored one. This strategy provides you with the following benefits:

* no external dependencies are installed together with Python-Redmine
* no more conflicts with other libraries that depend on other version of Requests
* always the latest version of Requests available at the release time of Python-Redmine
* use newer versions of Requests in case of the immediate upgrade need absolutely automatically

Conflicts
---------

Expand Down
9 changes: 9 additions & 0 deletions redmine/packages/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from . import requests

try:
external_requests = __import__('requests', level=0)
except ImportError:
pass
else:
if requests.__build__ < external_requests.__build__:
requests = external_requests
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def run_tests(self):
name='python-redmine',
version=globals()['__version__'],
packages=find_packages(exclude=('tests',)),
package_data={'requests': ['*.pem']},
include_package_data=True,
url='https://github.com/maxtepkeev/python-redmine',
license=open('LICENSE').read(),
author='Max Tepkeev',
Expand Down

0 comments on commit f634e65

Please sign in to comment.