Open StoneyJackson opened 5 months ago
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
@StoneyJackson
from setuptools import setup
with open('README.md') as f: long_description = f.read()
setup( name='plcc', version='7.0.0', description='A Programming Language Compiler Compiler', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/ourPLCC/plcc', author="Akshar Patel", #placeholder name author_email='aksharcommit@gmail.com', #placeholder email license='GPL 3',
install_requires=[
'argcomplete==3.3.0',
'click==8.1.7',
'pipx==1.5.0',
'userpath==1.9.2'],
classifiers=[
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: OS Independent',
'Intended Audience :: Education',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Natural Language :: English',
'Programming Language :: Java',
'Programming Language :: Java :: 17'
] # May need to add more programming language classifiers as it states in the README.md that
# plcc works with python>=3.5 and java>=11
# Can also add entrypoints here, basically map a command to a specific function in a file, will likely need to import the file
# in the __init__.py file, this could look something like this:
# entry_points={
# 'console_scripts': ['plcc=plcc.__main__.py:main']
# }
)
4. pip3 install wheel (try --user if it doesnt work) - Needed for next step
5. python setup.py sdist bdist_wheel - Creates a build and dist folder
6. pip install --upgrade twine --user - Used to package and upload dist/ folder to pypi
7. twine upload dist/* - will ask for the pypi account credentials
8. Package should be available to download via pip3 after these steps (Hopefully)
@AksharP5 Good stuff!
Based on https://packaging.python.org/ I get the impression we should be using pyproject.toml. True?
@StoneyJackson
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
Python is beautiful. It's packaging ecosystem is not. It looks like things have ~improved~ changed since last I looked at it. Here are some readings that I found that might be useful to others, and might help provide a background if we ever reevaluate this decision later (and we probably will need to).
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.
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.