balena-io / balena-sdk-python

Balena SDK for Python
Apache License 2.0
67 stars 46 forks source link

Use `pathlib` instead of `os.path` #343

Open pranasziaukas opened 1 year ago

pranasziaukas commented 1 year ago

https://github.com/balena-io/balena-sdk-python/blob/7a9be5f150dc680d53b6be206874ff8a593f2a0b/balena/settings.py#L3

Starting with python 3.4, pathlib became - to the best of my knowledge - the de facto way of handling paths in an object-oriented way.

While we will not be able to simply replace the above with

from pathlib import Path

without breaking anything, there is a somewhat of an official migration guide at https://docs.python.org/3/library/pathlib.html#correspondence-to-tools-in-the-os-module

_Originally posted by @pranasziaukas in https://github.com/balena-io/balena-sdk-python/pull/326#discussion_r1238615013_