-
Notifications
You must be signed in to change notification settings - Fork 4
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
Convert plcc.py into a Python package #121
Comments
BREAKING CHANGE: plcc is now a Python package, and plcc.py has been removed. So plcc.py can no longer be called directly like this python3 path/to/plcc.py grammar Instead, use plcc like this plcc grammar --- This commit restructures the PLCC codebase into that of a conventional Python project. This should make it easier to redesign the internal structure of PLCC, making it easier to maintain and add new functionality. It should also help us prepare to distribute PLCC through PyPI, making it easier to install. Here is a summary of changes. - Convert plcc.py into python package plcc - Remove environment variable LIBPLCC - Move src/Std/ to src/ - Move lib/jackson to src/lib/jackson - Move src/ to plcc/bin/ - Pull common functionality of scripts into plcc/bin/__init__.bash --- Related Issues - Related to #119 - Closes #121 - Closes #120
I played around with these Python features a bit. On the one hand, I read that init.py has not been required since Python3.3. On the other hand, I suggest it be used to do the necessary imports, whereas main.py contains the simple code line(s) to start everything running. No biggie; just my preference. |
Wow, didn't know I added |
BREAKING CHANGE: plcc is now a Python package, and plcc.py has been removed. So plcc.py can no longer be called directly like this python3 path/to/plcc.py grammar Instead, use plcc like this plcc grammar --- This commit restructures the PLCC codebase into that of a conventional Python project. This should make it easier to redesign the internal structure of PLCC, making it easier to maintain and add new functionality. It should also help us prepare to distribute PLCC through PyPI, making it easier to install. Here is a summary of changes. - Convert plcc.py into python package plcc - Remove environment variable LIBPLCC - Move src/Std/ under src/plcc (the PLCC Python package) - Move lib/jackson under src/plcc (the PLCC Python package) - Pull common functionality of scripts into common.bash --- Related Issues - Related to #119 - Closes #121 - Closes #120
🎉 This issue has been resolved in version 8.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
To help with redesigns, it would be helpful to organize functionality across multiple files (making clear the boundaries and independence of components). Converting plcc.py into a package would help with this and gets us closer to #119 .
This would change the way you call it. Currently, as a script, we call it like this...
Once converted into a package, we would call it like this...
This requires that it's parent directory is in Python's path (PYTHONPATH). After #119 , this is automatic. Until then, the PLCC scripts can set this just before calling plcc, something like this
PLCC's scripts can do this by using relative paths from their current location as described in #120 .
Code impact
The codebase would need to be reorganized as follows:
Scripts and main.py (currently plcc.py) would need to update the way they find the location of resources (e.g., Std/).
Scripts would need to be updated to set PYTHONPATH and CLASSPATH correctly.
User impact
This would break existing PLCC installations as LIBPLCC would point to src/ which no longer exists.
Users would need to reinstall PLCC when they upgrade.
The text was updated successfully, but these errors were encountered: