This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 848b0659cffcf62ddb33393bf74f3744cef6d9b3
Merge: 9a47224 2df4a8a
Author: Tomaz Muraus <[email protected]>
AuthorDate: Sun Dec 6 15:05:56 2020 +0100

    Merge branch 'trunk' of http://gitbox.apache.org/repos/asf/libcloud into 
dimgal1-packet-rebranding

 .travis.yml                                        |    2 +-
 CHANGES.rst                                        |   40 +
 contrib/scrape-ec2-sizes.py                        |  107 +-
 docs/upgrade_notes.rst                             |   32 +
 libcloud/__init__.py                               |   20 +-
 libcloud/common/types.py                           |   13 +-
 libcloud/compute/base.py                           |    2 +-
 libcloud/compute/constants/__init__.py             |    0
 .../ec2_instance_types.py}                         | 4071 +-------------------
 .../constants/ec2_region_details_complete.py       | 4066 +++++++++++++++++++
 .../constants/ec2_region_details_partial.py        |  138 +
 libcloud/compute/drivers/ec2.py                    |   38 +-
 libcloud/pricing.py                                |   66 +-
 libcloud/test/compute/test_ec2.py                  |    4 +-
 libcloud/test/pricing_test.json                    |    8 +
 libcloud/test/test_pricing.py                      |   65 +
 libcloud/utils/py3.py                              |   19 +-
 requirements-tests.txt                             |    2 +-
 scripts/time_imports.sh                            |   57 +
 setup.cfg                                          |    2 +-
 tox.ini                                            |   25 +-
 21 files changed, 4667 insertions(+), 4110 deletions(-)

diff --cc docs/upgrade_notes.rst
index 59f20f7,7319796..c26abbc
--- a/docs/upgrade_notes.rst
+++ b/docs/upgrade_notes.rst
@@@ -8,30 -8,38 +8,62 @@@ preserve the old behavior when this is 
  Libcloud 3.3.0
  --------------
  
+ * ``libcloud.pricing.get_size_pricing()`` now only caches pricing data in
+   memory for the requested drivers.
+ 
+   This way we avoid unnecessary overhead of caching data in memory for all the
+   drivers.
+ 
+   If you want to revert to the old behavior (cache pricing data for all the
+   drivers in memory), you can do that by passing ``cache_all=True`` argument
+   to that function as shown below:
+ 
+   .. sourcecode:: python
+ 
+     from libcloud.pricing import get_size_pricing
+ 
+     price = get_size_price("compute", "bluebox", cache_all=True)
+ 
+   Or by setting ``libcloud.pricing.CACHE_ALL_PRICING_DATA`` module level
+   variable to ``True``:
+ 
+   .. sourcecode:: python
+ 
+     import libcloud.pricing
+ 
+     libcloud.pricing.CACHE_ALL_PRICING_DATA = True
+ 
+     # Your code here
+     # ...
+ 
+   Passing ``cache_all=True`` might come handy in situations where you know the
+   application will work with a lot of different drivers - this way you can
+   avoid multiple disk reads when requesting pricing data for different 
drivers.
+ 
 +* Packet driver has been renamed to Equinix Metal. Provider name
 +  has changed from ``Provider.PACKET`` to ``Provider.EQUINIXMETAL``,
 +  while everything else works as before.
 +
 +  Before:
 +
 +    .. sourcecode:: python
 +
 +      from libcloud.compute.types import Provider
 +      from libcloud.compute.providers import get_driver
 +
 +      cls = get_driver(Provider.PACKET)
 +      driver = cls('api_key')
 +
 +  After:
 +
 +    .. sourcecode:: python
 +
 +      from libcloud.compute.types import Provider
 +      from libcloud.compute.providers import get_driver
 +
 +      cls = get_driver(Provider.EQUINIXMETAL)
 +      driver = cls('api_key')
 +
  Libcloud 3.2.0
  --------------
  

Reply via email to