Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for new python core #507

Merged
156 commits merged into from Aug 1, 2017
Merged

Add support for new python core #507

156 commits merged into from Aug 1, 2017

Conversation

ghost
Copy link

@ghost ghost commented Aug 1, 2017

No description provided.

psykokwak4 and others added 30 commits April 24, 2017 10:58
- Change holder type for ydk::Entity from std::unique_ptr to std::shared_ptr
- Update generated API, use local reference to avoid type casting error from Python to C++ side
- Add wrapper class PyEntithList, automatically assign parent pointer when appending list object
- Update small set of test case
pybind11 will automatically cast inherited python class to abstract c++ class
PyEntity when converting objects from Python and C++ side. To avoid this, need
to associate the object with a local reference.
with Flask's ImportExtension
The crud.update operation no longer does read, it updates
the data sent by the user.
- Update python.cpp interface
- Update test_sanity_crud.py and test_sanity_delete.py
- Add glue code for YLeafList in ydk.types
Put ydk::get_relative_entity_path under ydk.entity_utils.get_relative_entity_path
- Introduce new error classes:
  - YPYClientError
  - YPYIllegalStateError
  - YPYInvalidArgumentError
  - YPYOperationNotSupportedError
- update test case
Child class instance is initiated and added to parent's
children map. Attempt to manually assign child class instance
will cause a mismatch, and thus segfault.
- test_uint64_invalid_1 no longer applys
- update test_boolean_invalid
- Redirect TypeError to YPYServiceError for invalid ServiceProvider arguments
- Add check for invalid arguments in CrudService
- Change holder type for ydk::Entity from std::unique_ptr to std::shared_ptr
- Update generated API, use local reference to avoid type casting error from Python to C++ side
- Add wrapper class PyEntithList, automatically assign parent pointer when appending list object
- Update small set of test case
Update type mismatch test

- The user should not manually assign child object of current object after initialization.
- Add generated code to check manually assignment.
- Update test case for manually assignment.

Update test_sanity_deviation

- Update test_sanity_deviation.py.
  - Skip leaf-list length restrict deviation test.
- Update cisco-xr-bgp-deviations.yang, comment empty deviate statement.
- Update generated code for assignment check and enum assignment.
- Load deviation modules in repository.

Remove duplicate statements

Update test_sanity_deviation_bgp

- Updated test_sanity_deviation_bgp.py.
- Removed python deviation printer.

Fix test case in test_sanity_deviation.py

- Fix deviation boolean tests
- Changed gen code to use enum name as assignment name
- Changed affected test case in test_sanity_type_mismatch_errors.py

Fix segfault issue for assignment after instantiation.

- Change ydk::Entity::children to map of shared_ptr
  - Change ydk::Entity::children declaration in types.hpp to use map of string and shared_ptr.
  - Change related c++ source code.
  - Change related c++ printer code.
  - Add Entity glue code overrides get_children method.
  - Change related python printer code.
  - Removed python printer for get_children method.
- Cleanup get_child_by_name method
- Add entity method to check monkey patching errors
  - Update test_sanity_mismatch_errors.py.
  - Add monkey patching check to gen code.

Add YdkStreamHandler

Usage:

import logging
from ydk.logging import YDKStreamHandler

log = logging.getLogger('ydk')
log.setLevel(logging.DEBUG)
ch = YDKStreamHandler()
log.addHandler(ch)

Fix python.cpp
- Change clone_ptr to const
- Remove print statement in test case
- Rename test_sanity_bundle_aug.py to test_sanity_augmentation.py.
- Remove code support augmentation cross bundles.
- Add module name to augment leafs.
- Add CodecService/CodecServiceProvider python wrapper.
- Update test_sanity_codec.py
- Install YANG models as data files for every bundle under ydk/models/<bundle>/_yang/
- Replace variables in ydk/models/<bundle>/_yang_ns.py with:
  - bundle name.
  - bundle capabilities.
  - top level entity map.
- Remove old _aug and _meta directory from python package.
- Remove related printer code.
- Remove support for cross bundle augmentation.
- Reduce amount of boilerplate code in test cases.
- Add codec wrapper for JSON encoding/decoding.
- Add JSON codec test cases to test_sanity_codec.py.
- unicode/str issuse for Python2 and 3 compatibility.
- Monkey patching inspect.getargspec to inspect.getfullargspec under Python3
- Introduced Python libraries as dependency libraries for libydk to enable python extension logging.

- Add EnableLogging method to ydk.logging module to:
    - Register a spdlog logger named `ydk` to enable logging.
    - Use a spdlog null sink for this logger to drop cpp logging.

- Logging level:
    - Drop TRACE level according to syslog RFC 5424.
    - Use DEBUG as the most verbose level, shows everything propagated from libydk. Target users are YDK developers.
    - INFO level ignores detailed logging messages, only shows necessary messages and payload.
    - Update logging level in samples and documentation.

- Remove YDKStreamHandler.

- Update codec service's oc pattern tests.
shgandhi and others added 28 commits July 31, 2017 12:15
* Update ydk core version in CMakeLists.txt
* Update ydk core version in packages/setup.py
* Update lxml dependency version in requirements.txt
* Update lxml dependency version in sdk/python/core/setup.py
* Update lxml dependency version in sdk/python/packages/setup.py
* Rename ydk-version to core-version in bundle resolver and translator
* Rename ydk-version to core-version in bundle profiles
* Read ydk core library version from bundle profiles

Reads ydk core library version from bundle profiles to generate
CMakeLists.txt (for the cpp libraries) and setup.py (for python
packages) for coherency.
* Updates documentation to correctly describe RPC input/output
…ad output needs to be returned as a list (#459)

* Fix rpc output to be decoded into entity

* Fix incorrect decoding when read list only has one element
* Update README for ydk-gen

* Add minor doc edit for YDK-Py/YDK-Cpp

* Consolidate gitignore

Removed empty `gen-api` directory from repo and consolidated exceptions
in a single gitignore file. Directory is locally created when APIs are
generated.  Those APIs can be deleted by removing the directory w/o the
absent directory being reported as a repo change.
* Update README for ydk-gen

* Add minor doc edit for YDK-Py/YDK-Cpp

* Add profile for Cisco IOS XE bundle

Introduces profile for Cisco IOS XE (16.5.1) models.  Updates IETF
bundle (0.1.2) profile to meet dependencies of all other bundles.
* Update README for ydk-gen

* Add minor doc edit for YDK-Py/YDK-Cpp

* Fix documentation logo/icon for YDK-Py

Makes documentation logo and icon consistent between YDK-Cpp and YDK-Py.
 * Add exec to escaped python keywords

 * Add more issues fixed
* crud update fix

* Update crud_service.py

* Update crud_service.py
* Escape 'register', 'volatile' etc keyword for cpp

 * Fix xe compile issue on cpp
@codecov-io
Copy link

codecov-io commented Aug 1, 2017

Codecov Report

Merging #507 into master will decrease coverage by 3.74%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #507      +/-   ##
==========================================
- Coverage      84%   80.26%   -3.75%     
==========================================
  Files         109       92      -17     
  Lines       13076     9610    -3466     
  Branches     1892     1221     -671     
==========================================
- Hits        10985     7713    -3272     
- Misses       1570     1646      +76     
+ Partials      521      251     -270
Impacted Files Coverage Δ
sdk/python/core/tests/test_sanity_netconf.py 90.51% <ø> (-5.62%) ⬇️
sdk/python/core/tests/test_sanity_delete.py 99.53% <ø> (+2.21%) ⬆️
sdk/python/core/ydk/entity_utils/__init__.py 100% <ø> (ø)
sdk/python/core/ydk/__init__.py 100% <ø> (ø) ⬆️
sdk/python/core/ydk/services/__init__.py 100% <ø> (ø) ⬆️
sdk/python/core/ydk/providers/codec_provider.py 78.31% <ø> (-3.83%) ⬇️
sdk/python/core/tests/test_sanity_codec.py 96.25% <ø> (+1.98%) ⬆️
sdk/python/core/tests/test_sanity_filter_read.py 95.31% <ø> (-0.42%) ⬇️
sdk/python/core/tests/test_sanity_errors.py 94.73% <ø> (+4.9%) ⬆️
sdk/python/core/ydk/filters/__init__.py 100% <ø> (ø)
... and 116 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4daf578...db83832. Read the comment docs.

@ghost ghost merged commit 1864e8f into CiscoDevNet:master Aug 1, 2017
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants