**Why Migrate to pyproject.toml?**

With the upcoming end-of-life of Python 2.7, support for building universal wheels is being obviated. To continue building universal wheels, we need to update our project and remove deprecated calls. We decided to use the new pyproject.toml method for packaging. I first learned about Poetry and adapted it to NJUlogin, and then applied it to mijia-api. However, I forgot how to use it again, so I've written this article to record my experience.

**Original Packaging Script**

The original packaging script is as follows:
```powershell
clear-item dist -force -recurse
python setup.py sdist build
python setup.py bdist_wheel --universal
twine upload dist/*
```