diff --git a/CHANGELOG.md b/CHANGELOG.md index 271eef33..3369907a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.7.1] - 2024-05-31 +### Fixed +- Updated package version retrieval method from pkg_resources to importlib.metadata. + ## [2.7.0] - 2024-05-31 ### Added - Add support of DNA Center versions ('2.3.7.6') @@ -485,4 +489,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [2.6.10]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.6.9...v2.6.10 [2.6.11]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.6.10...v2.6.11 [2.7.0]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.6.11...v2.7.0 -[Unreleased]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.7.0...develop +[2.7.1]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.7.0...v2.7.1 +[Unreleased]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.7.1...develop diff --git a/README.rst b/README.rst index f8a5c86b..771c3441 100755 --- a/README.rst +++ b/README.rst @@ -156,9 +156,9 @@ The following table shows the supported versions. * - 2.3.3.0 - 2.5.6 * - 2.3.5.3 - - 2.6.10 + - 2.6.11 * - 2.3.7.6 - - 2.7.0 + - 2.7.1 diff --git a/dnacentersdk/__init__.py b/dnacentersdk/__init__.py index 97a8095f..9a7fd3c0 100644 --- a/dnacentersdk/__init__.py +++ b/dnacentersdk/__init__.py @@ -44,6 +44,6 @@ logger = logging.getLogger(__name__) -from pkg_resources import get_distribution -release = get_distribution('dnacentersdk').version +from importlib.metadata import version +release = version('dnacentersdk') __version__ = '.'.join(release.split('.')[:3]) diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 62415724..a82bfe15 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -11,6 +11,17 @@ Versioning `__. `Unreleased `__ -------------------------------------------------------------------------------------------------- +[2.7.1] - 2024-05-31 +-------------------- + +Fixed +~~~~~ + +- Updated package version retrieval method from pkg_resources to + importlib.metadata. + +.. _section-1: + `2.7.0 `__ - 2024-05-31 ---------------------------------------------------------------------------------------------------------- @@ -26,11 +37,13 @@ Added - Fix headers in ``create_webhook_destination`` and ``update_webhook_destination`` -.. _section-1: +.. _section-2: `2.6.11 `__ - 2023-01-10 ------------------------------------------------------------------------------------------------------------ +.. _fixed-1: + Fixed ~~~~~ @@ -38,12 +51,12 @@ Fixed Fixing required schema. - Updating request version. Issue #132 -.. _section-2: +.. _section-3: `2.6.10 `__ - 2023-11-10 ----------------------------------------------------------------------------------------------------------- -.. _fixed-1: +.. _fixed-2: Fixed ~~~~~ @@ -53,7 +66,7 @@ Fixed - Fixed params in 2.3.5.3 claim_a_device_to_a_site from vlanID to vlanId -.. _section-3: +.. _section-4: `2.6.9 `__ - 2023-09-20 --------------------------------------------------------------------------------------------------------- @@ -64,7 +77,7 @@ Changed - AP port assignment API not working with DNAC APIs of 2.3.3.0 #126, Documetion bug, extra-space in enum. -.. _section-4: +.. _section-5: `2.6.8 `__ - 2023-09-12 --------------------------------------------------------------------------------------------------------- @@ -76,7 +89,7 @@ Changed - 2_3_3_0 sda sevice ``add_vn`` method update. -.. _section-5: +.. _section-6: `2.6.7 `__ - 2023-08-25 --------------------------------------------------------------------------------------------------------- @@ -88,7 +101,7 @@ Changed - Update readthedocs settings -.. _section-6: +.. _section-7: `2.6.6 `__ - 2023-07-10 --------------------------------------------------------------------------------------------------------- @@ -100,7 +113,7 @@ Changed - Change requests-toolbelt minimum version #101 -.. _section-7: +.. _section-8: `2.6.5 `__ - 2023-05-29 --------------------------------------------------------------------------------------------------------- @@ -112,7 +125,7 @@ Changed - user_and_roles::Unable to use user and roles module. #112 -.. _section-8: +.. _section-9: `2.6.4 `__ - 2023-05-25 --------------------------------------------------------------------------------------------------------- @@ -141,7 +154,7 @@ Changed - Poor naming of function: v2_3_5_3/authentication_management.py : ``authentication_ap_i( #102`` -.. _section-9: +.. _section-10: `2.6.3 `__ - 2023-04-28 --------------------------------------------------------------------------------------------------------- @@ -169,14 +182,14 @@ Changed .. rubric:: `2.6.2 `__ - 2023-04-25 - :name: section-10 + :name: section-11 .. rubric:: Changed :name: changed-7 - Add ``issue`` family on 2.3.3.0 -.. _section-11: +.. _section-12: `2.6.1 `__ - 2023-04-12 --------------------------------------------------------------------------------------------------------- @@ -190,7 +203,7 @@ Changed - Correct families names in 2.3.5.3 - Removing duplicate params -.. _section-12: +.. _section-13: `2.6.0 `__ - 2023-04-12 --------------------------------------------------------------------------------------------------------- @@ -203,7 +216,7 @@ Added - Add support of DNA Center versions (‘2.3.5.3’) - Adds modules for v2_3_5_3 -.. _section-13: +.. _section-14: `2.5.6 `__ - 2023-01-10 --------------------------------------------------------------------------------------------------------- @@ -215,7 +228,7 @@ Added - Compatibility matrix added in ``readme.rst`` -.. _fixed-2: +.. _fixed-3: Fixed ~~~~~ @@ -242,12 +255,12 @@ Fixed - dnacentersdk.api.v2_3_3_0.tag - dnacentersdk.api.v2_3_3_0.task -.. _section-14: +.. _section-15: `2.5.5 `__ - 2022-11-17 --------------------------------------------------------------------------------------------------------- -.. _fixed-3: +.. _fixed-4: Fixed ~~~~~ @@ -259,7 +272,7 @@ Fixed - Added Dict_of_str function call in custom_caller headers -.. _section-15: +.. _section-16: `2.5.4 `__ - 2022-08-11 --------------------------------------------------------------------------------------------------------- @@ -273,12 +286,12 @@ Added - ``add_ssid_to_ip_pool_mapping`` -.. _section-16: +.. _section-17: `2.5.3 `__ - 2022-08-09 --------------------------------------------------------------------------------------------------------- -.. _fixed-4: +.. _fixed-5: Fixed ~~~~~ @@ -289,12 +302,12 @@ Fixed ``connectedToInternet`` on ``sda.adds_border_device`` comes from ``boolean`` to ``string``. -.. _section-17: +.. _section-18: `2.5.2 `__ - 2022-07-29 --------------------------------------------------------------------------------------------------------- -.. _fixed-5: +.. _fixed-6: Fixed ~~~~~ @@ -326,12 +339,12 @@ Fixed - network - servers -.. _section-18: +.. _section-19: `2.5.1 `__ - 2022-07-12 --------------------------------------------------------------------------------------------------------- -.. _fixed-6: +.. _fixed-7: Fixed ~~~~~ @@ -340,7 +353,7 @@ Fixed - IpAddressSpace -.. _section-19: +.. _section-20: `2.5.0 `__ - 2022-06-20 ---------------------------------------------------------------------------------------------------------- @@ -353,12 +366,12 @@ Added - Add support of DNA Center versions (‘2.3.3.0’) - Adds modules for v2_3_3_0 -.. _section-20: +.. _section-21: `2.4.11 `__ - 2022-06-15 ------------------------------------------------------------------------------------------------------------ -.. _fixed-7: +.. _fixed-8: Fixed ~~~~~ @@ -369,7 +382,7 @@ Fixed - verify - debug -.. _section-21: +.. _section-22: `2.4.10 `__ - 2022-05-12 ----------------------------------------------------------------------------------------------------------- @@ -385,7 +398,7 @@ Added - site_name_hierarchy -.. _section-22: +.. _section-23: `2.4.9 `__ - 2022-04-20 --------------------------------------------------------------------------------------------------------- @@ -405,7 +418,7 @@ Added - subnetMask - vlanId -.. _section-23: +.. _section-24: `2.4.8 `__ - 2022-03-23 --------------------------------------------------------------------------------------------------------- @@ -451,7 +464,7 @@ Changed - dnacentersdk.api.v2_2_3_3.file.File.download_a_file_by_fileid - dnacentersdk.api.v2_2_3_3.reports.Reports.download_report_content -.. _section-24: +.. _section-25: `2.4.7 `__ - 2022-03-22 --------------------------------------------------------------------------------------------------------- @@ -464,7 +477,7 @@ Added - Add ``rfProfile`` parameter for request body struct of ``claim_a_device_to_a_site``. -.. _section-25: +.. _section-26: `2.4.6 `__ - 2022-03-14 --------------------------------------------------------------------------------------------------------- @@ -495,7 +508,7 @@ Changed - sda.adds_border_device -.. _section-26: +.. _section-27: `2.4.5 `__ - 2022-02-01 --------------------------------------------------------------------------------------------------------- @@ -521,7 +534,7 @@ Changed - devices.sync_devices -.. _section-27: +.. _section-28: `2.4.4 `__ - 2022-01-31 --------------------------------------------------------------------------------------------------------- @@ -549,7 +562,7 @@ Changed - site_design.update_floormap - application_policy.create_application -.. _fixed-8: +.. _fixed-9: Fixed ~~~~~ @@ -565,12 +578,12 @@ Added - Adds parameters ``hostname``, ``imageInfo`` and ``configInfo`` to device_onboarding_pnp.pnp_device_claim_to_site -.. _section-28: +.. _section-29: `2.4.3 `__ - 2022-01-19 --------------------------------------------------------------------------------------------------------- -.. _fixed-9: +.. _fixed-10: Fixed ~~~~~ @@ -588,12 +601,12 @@ Changed DNACenterAPI - Adds tests for env variables before/after DNACenterAPI import -.. _section-29: +.. _section-30: `2.4.2 `__ - 2021-12-14 --------------------------------------------------------------------------------------------------------- -.. _fixed-10: +.. _fixed-11: Fixed ~~~~~ @@ -603,7 +616,7 @@ Fixed - Update json schemas for models/validators and tests/models/models/validators -.. _section-30: +.. _section-31: `2.4.1 `__ - 2021-12-01 --------------------------------------------------------------------------------------------------------- @@ -615,7 +628,7 @@ Changed - Update to match checksum -.. _section-31: +.. _section-32: `2.4.0 `__ - 2021-12-01 --------------------------------------------------------------------------------------------------------- @@ -646,7 +659,7 @@ Changed - Update missing dnac 2.2.3.3 files -.. _section-32: +.. _section-33: `2.3.3 `__ - 2021-11-24 --------------------------------------------------------------------------------------------------------- @@ -678,7 +691,7 @@ Changed - Add ``isGuestVirtualNetwork`` parameter to ``update_virtual_network_with_scalable_groups`` function -.. _section-33: +.. _section-34: `2.3.2 `__ - 2021-09-14 --------------------------------------------------------------------------------------------------------- @@ -690,12 +703,12 @@ Changed - Disable verify=False warnings of urllib3 -.. _section-34: +.. _section-35: `2.3.1 `__ - 2021-08-10 --------------------------------------------------------------------------------------------------------- -.. _fixed-11: +.. _fixed-12: Fixed ~~~~~ @@ -703,7 +716,7 @@ Fixed - Fix devices param definition & schemas [``aba32f3``] - Remove unnecesary path_params [``25c4e99``] -.. _section-35: +.. _section-36: `2.3.0 `__ - 2021-08-09 --------------------------------------------------------------------------------------------------------- @@ -728,7 +741,7 @@ Changed - Updates restsession.py to handle downloads using Content-Disposition header rather than custom fileName header -.. _section-36: +.. _section-37: `2.2.5 `__ - 2021-08-05 --------------------------------------------------------------------------------------------------------- @@ -747,12 +760,12 @@ Changed - Removes minus char from docstrings. - Adds check_type conditions for ‘X-Auth-Token’ for v2_2_1 operations. -.. _section-37: +.. _section-38: `2.2.4 `__ - 2021-06-08 --------------------------------------------------------------------------------------------------------- -.. _fixed-12: +.. _fixed-13: Fixed ~~~~~ @@ -760,7 +773,7 @@ Fixed - Fixes download_a_file_by_fileid and import_local_software_image for v2_2_1 -.. _section-38: +.. _section-39: `2.2.3 `__ - 2021-06-08 --------------------------------------------------------------------------------------------------------- @@ -783,7 +796,7 @@ Changed - Patch adds one function that was missing from previous release - Patch adds models/validators for v2_2_1 with new ids -.. _section-39: +.. _section-40: `2.2.2 `__ - 2021-05-10 --------------------------------------------------------------------------------------------------------- @@ -802,7 +815,7 @@ Changed - Updates requirements files -.. _section-40: +.. _section-41: `2.0.2 `__ - 2020-11-01 --------------------------------------------------------------------------------------------------------- @@ -831,7 +844,7 @@ Removed - Removed requirements.lock -.. _section-41: +.. _section-42: `2.0.0 `__ - 2020-07-17 --------------------------------------------------------------------------------------------------------- @@ -854,7 +867,7 @@ Changed - Changed setup from versioneer to setuptools_scm - Changed version management to include patch (major, minor, patch) -.. _fixed-13: +.. _fixed-14: Fixed ~~~~~ @@ -871,7 +884,7 @@ Removed - Removed Webex Teams Space Community reference from README - Removed Token refresh when changing base_url -.. _section-42: +.. _section-43: `1.3.0 `__ - 2019-08-19 ---------------------------------------------------------------------------------------------------------- @@ -883,7 +896,7 @@ Added - Add support for multiple versions of DNA Center (‘1.2.10’, ‘1.3.0’) -.. _fixed-14: +.. _fixed-15: Fixed ~~~~~ @@ -892,7 +905,7 @@ Fixed - Fix error in setter in ``api/__init__.py`` - Fix errors for readthedocs -.. _section-43: +.. _section-44: `1.2.10 `__ - 2019-07-18 --------------------------------------------------------------------------------------------------- diff --git a/docs/conf.py b/docs/conf.py index 3beda9da..5398995e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -7,8 +7,8 @@ sys.path.insert(0, os.path.abspath('..')) -from pkg_resources import get_distribution -release = get_distribution('dnacentersdk').version +from importlib.metadata import version +release = version('dnacentersdk') version = '.'.join(release.split('.')[:2]) project = u'dnacentersdk' diff --git a/pyproject.toml b/pyproject.toml index 6c667eef..c3eac2cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dnacentersdk" -version = "2.7.0" +version = "2.7.1" description = "Cisco DNA Center Platform SDK" authors = ["Jose Bogarin Solano ", "William Astorga ", "Francisco Muñoz ", "Francisco Muñoz ", "Bryan Vargas "] license = "MIT" diff --git a/test_new.py b/test_new.py deleted file mode 100644 index d8631b04..00000000 --- a/test_new.py +++ /dev/null @@ -1,23 +0,0 @@ -from dnacentersdk import api - -# Create a DNACenterAPI connection object; -# it uses DNA Center sandbox URL, username and password, with DNA Center API version 2.3.5.3. -# and requests to verify the server's TLS certificate with verify=True. -dnac = api.DNACenterAPI(username="devnetuser", - password="Cisco123!", - base_url="https://sandboxdnac.cisco.com:443", - version='2.3.7.6', - verify=False) - -# Find all devices that have 'Switches and Hubs' in their family -devices = dnac.devices.get_device_list(family='Switches and Hubs') - -# Print all of demo devices -for device in devices.response: - print('{:20s}{}'.format(device.hostname, device.upTime)) - -# Find all tags -all_tags = dnac.tag.get_tag(sort_by='name', order='des') -demo_tags = [tag for tag in all_tags.response if 'Demo' in tag.name ] - -print(all_tags) \ No newline at end of file