setup.py is maintained so that there is no hard dependency on bench
v5.11.0 and people get enough time to update their CLI. Hope the TODO
adds a subtle reminder for the future ;)
There was an attempt to switch to declarative setup, which was to use
setup.cfg. However, we've made more progress in the "world of packaging"
since. Also, given we're using a pyproject file already to govern
certain aspects of our project maintenance, it's probably a good time to
bring these things together. bye-bye to clutter and confusion in
maintaining multiple files and formats.
We've used setuptools to package frappe for the longest time. Maybe
since the first editable installation. Howver setuptools doesn't support
PEP 660 yet which supports editable installs via pyproject file.
So why now? Primarily because I wanted to start tracking system
dependencies for Frappe. Doing so through pyproject file made the most
sense. This change seemed to be the obvious pre-requisite for the
upcoming changes to our packaging systems.
Sys deps tracking: https://github.com/frappe/frappe/issues/13811
Flit docs: https://flit.pypa.io/en/latest/pyproject_toml.html
Previous attempt: https://github.com/frappe/frappe/pull/10773
Which build tool: https://stackoverflow.com/a/69711730/10309266
PEP 660: https://peps.python.org/pep-0660/
* Bumping iPython by a minor version broke 3.6 installs for us via https://github.com/frappe/frappe/pull/14192
* We could just add another line in requirements.txt to solve this, but
since PY36 is reaching end of life by end of this year and release of
3.10 is just around the corner, might as well just drop it now than
later
* Frappe v14 would probably have the support range of 3.7-3.10/11 given
when we release it. Maintaining dependencies for such a large range
can become cumbersome
* Remove six for PY2 compatability since our dependencies are not, PY2
is legacy.
* Removed usages of utils from future/past libraries since they are
deprecated. This includes 'from __future__ ...' and 'from past...'
statements.
* Removed compatibility imports for PY2, switched from six imports to
standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
recent changes in frappe/__init__.py make use of f-strings that are only
available on python>=3.6
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>