-
Notifications
You must be signed in to change notification settings - Fork 81
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
[AIC-PY] + publish script for any pypi pkg, small mods to llama ext #265
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
AIConfig Model Parser for LLama cpp (Python bindings). | ||
|
||
Usage: See cookbook: | ||
|
||
https://github.com/lastmile-ai/aiconfig/blob/c64224ed48ccb7f8cbd2d3a1b2e8bd250aeb9ff2/cookbooks/llama/python/ask_llama.py#L4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
|
||
[project] | ||
name = "python-aiconfig-llama" | ||
version = "0.0.1" | ||
authors = [ | ||
{ name="Jonathan Lessinger", email="[email protected]" }, | ||
] | ||
description = "LLama extension for AIConfig Library" | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"Programming Language :: Python :: 3", | ||
] | ||
dynamic = ["dependencies"] | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = {file = ["requirements.txt"]} | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/lastmile-ai/aiconfig" | ||
"Bug Tracker" = "https://github.com/lastmile-ai/aiconfig/issues" | ||
|
||
# Black formatting | ||
[tool.black] | ||
line-length = 99 | ||
include = '\.pyi?$' | ||
exclude = ''' | ||
/( | ||
.eggs # exclude a few common directories in the | ||
| .git # root of the project | ||
| .hg | ||
| .mypy_cache | ||
| .tox | ||
| venv | ||
| _build | ||
| buck-out | ||
| build | ||
| dist | ||
)/ | ||
''' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#! /bin/zsh | ||
# pypipublish.sh | ||
# Usage: Run ./scripts/pypipublish.sh path/to/project/root conda-env-name | ||
# path/to/project/root is anywhere with a pyproject.toml. | ||
|
||
# NOTE: This assumes you have the aiconfig conda environment created. | ||
# You will be prompted for a username and password. For the username, use __token__. | ||
# For the password, use the token value, including the pypi- prefix. | ||
# To get a PyPi token, go here: | ||
# Need to get a token from here (scroll down to API Tokens): https://pypi.org/manage/account/ | ||
# If you have issues, read the docs: https://packaging.python.org/en/latest/tutorials/packaging-projects/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is publishing with account username and password an expected flow? I've noticed that the official publishing guide suggests using token I think it would make more sense to expect .env or equivalent rather than typing it in at script run? |
||
|
||
# If you want to upload to testpypi, run pypipublish-test.sh. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this exist? I don't see it in this diff |
||
|
||
if [ -z "$2" ] | ||
then | ||
echo "Usage: pypipublish.sh path/to/project/root conda-env-name" | ||
exit 1 | ||
fi | ||
|
||
|
||
cd "$1" | ||
if [ ! -f "pyproject.toml" ] | ||
then | ||
echo "File pyproject.toml does not exist in the current directory" | ||
exit 1 | ||
fi | ||
|
||
rm -rf ./dist | ||
|
||
source /opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh && conda activate "$2"\ | ||
&& python3 -m pip install --upgrade build \ | ||
&& python3 -m build \ | ||
&& python3 -m pip install --upgrade twine \ | ||
&& python3 -m twine upload dist/* | ||
|
||
cd - |
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.
Wouldn't it make more sense to create an empty environment rather than depend on an existing one?