This is the first of a set of three posts aimed at showing how to create a full featured Python3 project: since the topic is quite massive, I decided to split it into three different posts. In this post we do not only quickly see how to develop a full featured Python application, since I wanted to do something that shows a lot of things, such as:
- creating Python objects
- put the custom Python objects inside a Python package within the scope of our own namespace
- develop accordingly to encapsulation rules, by implementing getters and setters methods that look like regular attributes by exploiting decorators
- use the standard Python logging facility, configuring everything with an external settings file
- altering the __eq__ comparison so to consider two objects as equal when one of their attribute has the same value
- implementing comparison methods and the __iter__ method, so to be able to use Python standard functions such as sorted() to sort it also in reverse order
- exploit total_ordering to make an object fully sortable
The next parts of this post will be on the following topics
- the second one is about delivering the object as a Python package
- the third and last post Packaging a Python Wheel as RPM is about how to pack this project into two RPM packages, also seeing how to digitally sign these RPM packages, and in general how to set up an RPM development environment, with a good overview on how to exploit the RPM building tools