GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python3 port of SCL library by devonsparks · Pull Request #408 · stepcode/stepcode

Conversation

@devonsparks

@devonsparks devonsparks commented May 18, 2021

Copy link
Copy Markdown
Contributor

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:

  1. Those changes critical to make SCL run under Py3 at all
  2. Convenience features like egg packaging that will hopefully make working with SCL easier in the future.

Changes on (1) were minor (updating the use of the new print function, migrating all modules to use new-style classes).

Changes on (2) were more significant. They include:

  1. Creating a proper setup.cfg configuration to allow us to build SCL as a Python Package and automatically install required dependencies. This also opens the door to publishing the library on PyPI, so users could install with pip and friends.
  2. Ensure the test suite can run using python3 -m unittest discover
  3. Adding a new set of test cases, test_parser.py, that do a basic sanity check on the parser logic against a sample Part 21 file.
  4. Adding a separate LICENSE file (that mirrors those already shown in line at the top of SCL files), and basic README that provides a starting point for newcomers.

The only "breaking change" is a test case file, test_unitary_schemas.py, that I prefixed with an underscore to avoid being called by unittest discover. test_untiary_schemas.py relies on Python modules autogenerated by exp2python in 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 @apply can 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 full stepcode project using the usual cmake workflow from scratch without errors.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
devonsparks added 8 commits May 15, 2021 09:48
@devonsparks
Initial Python 3 port of SCL library.
d2ea477
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)
@devonsparks
Refactored Py3 source directory to support build module. Turned tests…
f7c9fb0
… into a package to support use with unittest.
@devonsparks
Restructured package structure to avoid redundant src/ directory.
66b7ef9
Added new sanity test for Part 21 parser.
@devonsparks
Added initial README
b8f04bd
@devonsparks
Minor updates to README and setup.cfg build target.
cecc1e5
@devonsparks
Added README to setup.cfg
c3913c0
@devonsparks
Added comment about unitary schema test exclusion
c75c6ae
@devonsparks
Add notes about test suite to README
0f8cc66
@tpaviot

tpaviot commented May 18, 2021

Copy link
Copy Markdown
Member

In Python3 there's no need to explicitly inherit from the object class

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@devonsparks
Simplified setup.cfg package search to use explicit package listing.
2dd8541
@cshorler
cshorler self-requested a review August 23, 2021 20:00
cshorler
cshorler reviewed Oct 31, 2021
View reviewed changes

@cshorler cshorler left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with @tpaviot - no need for inheriting object in Python 3. Also, we can use relative imports for library imports. I'll rebase and rework locally today or tomorrow.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cshorler

cshorler commented Oct 31, 2021

Copy link
Copy Markdown
Member

also looking at the remaining commits at a glance - are there redundant commits in this, looks like there could be.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cshorler

cshorler commented Oct 31, 2021

Copy link
Copy Markdown
Member

also we need to update exp2py for this change as well - this is currently missing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cshorler cshorler mentioned this pull request Oct 31, 2021
exp2python.exe built in VS2019 converts into unparsable code for python3 from AP214&AP242 exp files #427
Open
@cshorler cshorler mentioned this pull request Nov 23, 2021
Pr408 rework #429
Merged
@cshorler

cshorler commented Jun 11, 2022

Copy link
Copy Markdown
Member

superseded by #429 and #430

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cshorler cshorler closed this Jun 11, 2022
@cshorler cshorler mentioned this pull request Apr 23, 2023
Python3 port for SCL library? #407
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cshorler cshorler cshorler left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@devonsparks @tpaviot @cshorler
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.