-
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
PyPI #119
Comments
It’s been a while since I used pip. Do you have to have super user permission to get pip to work?On Apr 21, 2024, at 9:39 AM, Stoney Jackson ***@***.***> wrote:
If we distributed PLCC through PyPI then installing PLCC would become...
$ pip install plcc
And no one needs to set environment variables (e.g., LIBPLCC). All Python scripts can find the resource that they need (e.g., Std/) relative to their location (__file__). We might need to reimplement the PLCC scripts (e.g., parse, scan, etc.) in Python. This could have the added benefit of making them platform independent.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
@jashelio Should be possible. Something like: $ python3 -m pip install --user plcc This I based on this: https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-to-the-user-site |
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
Everything I have learned about how to package to PyPi, and what I have so far:
|
@AksharP5 Good stuff! Based on https://packaging.python.org/ I get the impression we should be using pyproject.toml. True? |
setup.py is fine to use instead of pyproject.toml I believe it is the older method (This is based on git-keeper), however pyproject.toml seems to be the newer standardized format so we can use that. Using poetry for this may be helpful, https://github.com/python-poetry/poetry |
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
Python is beautiful. It's packaging ecosystem is not. It looks like things have
Based on the above (and maybe a few I didn't capture), here is my summary.
My conclusion? Use pyproject.toml following modern standards. Use PDM for now. If Poetry comes up to standards, consider moving to it. Note, even if we don't start publishing to PyPI, we still need a place to specify development and runtime dependencies, and pyproject.toml is a good place to do it. |
PR #129 is becoming unwieldily. So I'm down scoping it. It will no longer attempt to distribute plcc through PyPI. But I think this is still a good goal. I'm moving the to-do list that was to here, so we don't lose it.
|
Adopt Technologies: * PDM - "A modern Python package and dependency manager supporting the latest PEP standards." * pyproject.toml - Used by PDM to manage project dependencies and metadata. * pytest - A nice modern unit testing framework for python. Reorganized tests, and removed local-min-max test. They were breaking and are VERY slow. They were intended to mimic those that run in CI. But those are passing. Added bin/test/units.bash to run unit tests. Place unit tests in tests/unit/. No longer supporting python < 3.9. --- Related to #119 Closes #131 Thanks to Co-authored-by: Akshar Patel <aksharpatel1233@gmail.com> He performed the initial research for pyproject.toml
If we distributed PLCC through PyPI then installing PLCC would become...
And no one needs to set environment variables (e.g., LIBPLCC). All Python scripts can find the resource that they need (e.g., Std/) relative to their location (
__file__
). We might need to reimplement the PLCC scripts (e.g., parse, scan, etc.) in Python. This could have the added benefit of making them platform independent.The text was updated successfully, but these errors were encountered: