Repository navigation
Python3 port of SCL library - #408
Closed
devonsparks wants to merge 9 commits into
Closed
devonsparks wants to merge 9 commits into
devonsparks wants to merge 9 commits into
Conversation
Includes: - Updating core to remove Py2 dependencies (especially print_function) - Migrating setup.py to setup.cfg to support integration with PyPA build - Making all imports absolute - Fixing the test suite to ensure it runs again (with the exception of unitary schema, which seems to depend on modules that no longer exist)
… into a package to support use with unittest.
Added new sanity test for Part 21 parser.
Member
|
In Python3 there's no need to explicitly inherit from the object class |
cshorler
self-requested a review
August 23, 2021 20:00
Member
|
also looking at the remaining commits at a glance - are there redundant commits in this, looks like there could be. |
Member
|
also we need to update exp2py for this change as well - this is currently missing. |
Merged
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
I've been using the Py2 SCL library in the stepcode library to good effect for some IFC experiments. I now would like to integrate this with adjacent libraries that have a Py3 dependency. Considering Python2 is sunset, and there's interest (Issue 407) from the stepcode community in a Py3 port, it seemed like a good time to start. This PR is the result.
Summary of Changes
Changes fell in two categories:
Changes on (1) were minor (updating the use of the new
printfunction, migrating all modules to use new-style classes).Changes on (2) were more significant. They include:
python3 -m unittest discovertest_parser.py, that do a basic sanity check on the parser logic against a sample Part 21 file.The only "breaking change" is a test case file,
test_unitary_schemas.py, that I prefixed with an underscore to avoid being called byunittest discover.test_untiary_schemas.pyrelies on Python modules autogenerated byexp2pythonin the parent directory. Those autogenerated modules make use of a decorator, called@apply, I haven't been able to find/grep in the source tree. The tests won't be able to run until this decorator definition is found/written and put back in the sys.path. For now I've added this note in the test case file with an open invitation for others to bring it back to life if they know where the missing dependencies are. If the meaning or source for@applycan be found, it doesn't seem like we're far off from resurrecting these particular tests.Validation
I'm able to successfully build the package (
python3 -m build) and run all unit tests (python -m unittest discover- 101/101 pass) on my local machine. I can also build the fullstepcodeproject using the usual cmake workflow from scratch without errors.