jaroslawhartman / withings-sync

Synchronisation of Withings weight
MIT License
457 stars 89 forks source link

Future code base components? (python 3.12 / pyproject.toml vs setup.py / poetry vs pip-pipenv-twine-... / docker improvements) #181

Open stynoo opened 2 weeks ago

stynoo commented 2 weeks ago

When working on the last PR I came across the statements that "The recommended way of using Setuptools has shifted in the direction of using the pyproject.toml in favour of setup.py and setup.cfg." Combining this with "pkg_resources is deprecated" in python 3.12 and the docker wishlist in #133 I realized that we probably will have to introduce some breaking changes in the future.
Hence introducing this PR, primarily as a proposition of a possible way forwards. This introduces the following changes:

  1. move away from setuptools/setup.py/requirements.txt and start using poetry as a package/venv builder-manager based on pyproject.toml
  2. base everything on python3.12 and eliminate all deprecated dependencies and warnings
  3. build a small lightweight docker image based on some best practices such as layer optimization & running the app as a non-priviledged user
  4. update github actions to make use of this new way of working

Again, this will introduce breaking changes, this PR is incomplete but I wanted to share this early to start a discussion/collaboration. If this is not the correct way forwards or not what you envisioned, just let me know.

todo:

stynoo commented 1 week ago

Thx for taking the time already, I don't think we need to rush this, nothing is on fire atm.
I'll try to dive deeper into the questions during the next weeks but my availability is also scarce.
I may need some help to optimize the release/version process.