FMInference / FlexLLMGen

Running large language models on a single GPU for throughput-oriented scenarios.
Apache License 2.0
9.18k stars 548 forks source link

Release a pip installable package #54

Closed LukeLIN-web closed 1 year ago

LukeLIN-web commented 1 year ago

See https://packaging.python.org/en/latest/tutorials/packaging-projects/ The following command is enough:

python3 -m pip install --upgrade build
python3 -m build
python3 -m pip install --upgrade twine
python3 -m twine upload dist/*

You can add more information, such as the author's names and emails. I installed it from my pypi link It works great for me.

maxsu commented 1 year ago

Note, we can:

  1. Migrate setup_depends from setup.py into the buildsystem.requires key in pyproject.toml.
  2. Delete setup.py

Reasoning

The rationale for dropping setup_depends is written in pep 518. This is now endorsed by the python packaging tutorial and pip v23.0.1 manual. After this, setup.py is an empty setup() invocation, so it's safe to sweep🧹

Ying1123 commented 1 year ago

This looks good. I will review it in detail later. Could you transfer the ownership of this package in pypi to my account sqy1415@gmail.com ? My username is ying1123.

LukeLIN-web commented 1 year ago

This looks good. I will review it in detail later. Could you transfer the ownership of this package in pypi to my account sqy1415@gmail.com ? My username is ying1123.

Invitation sent to 'ying1123'

Ying1123 commented 1 year ago

This looks good. I will review it in detail later. Could you transfer the ownership of this package in pypi to my account sqy1415@gmail.com ? My username is ying1123.

Invitation sent to 'ying1123'

Thanks a lot, @LukeLIN-web! I have accepted the invitation and will return with the pip release tomorrow.

LukeLIN-web commented 1 year ago

Note, we can:

  1. Migrate setup_depends from setup.py into the buildsystem.requires key in pyproject.toml.
  2. Delete setup.py

Reasoning

The rationale for dropping setup_depends is written in pep 518. This is now endorsed by the python packaging tutorial and pip v23.0.1 manual. After this, setup.py is an empty setup() invocation, so it's safe to sweep🧹

Done. It is interesting. It is the first time I heard we could remove setup.py.

anirrudh commented 1 year ago

I'd be happy to package this for conda in addition to pip if that is of any interest!

maxsu commented 1 year ago

@LukeLIN-web we use setup.py due to pip's dependency on setuptools. But TIL setuptools fully embraced pyproject.toml early last year:

https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html https://github.com/pypa/setuptools/commits/main/docs/userguide/pyproject_config.rst

I've noticed project config is simpler when it lives in a toml. Many in the Py community have worked towards this over the past few years, and I'm happy to finally get rid of setup.py in my projects.

I now think of setup.py as a home for very specialized setup logic - testing GPU availability for instance. Most projects won't need it at all

\

Ying1123 commented 1 year ago

Thanks. It is merged!