-
-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSoC: Settings API and Basic Inward Facing Testing API #118
Comments
This is pretty good for a first pass (and the spelling isn't even that bad! :-) The design for the core functionality has already been vetted as part of #90, so you've got a really good head start. There's only two areas that I think need a bit more clarification, and they're the two areas that aren't really covered by #90:
|
@freakboy3742 I created #119 to clarify what I had in mind for the testing part. I only consider the inward facing section of #119 as part of this GSoC proposal. Both would be to big in scale I think. |
@freakboy3742 about versioning and migration. Example
I have never done something like this before. Do I miss some key challenge/problem? |
Possibly not; migrations for Django required a whole lot of interaction with transactions, database backends, inconsistent syntax, plus dealing with collaboration between developers working in parallel. In retrospect, I guess migration in the settings context is literally just a function that takes v1 format and outputs v2 format. |
This proposal was accepted for the 2017 GSoC. Project progress updates will be posted here by @Ocupe. |
[Logbook 1]Google Summer of Code has started! This is a quick recap of what I did in week 1 and a preview what I'm planing to do this week. In the weeks preceding the start of GSoC I tried to figure out what a test setup for toga could look like. With the help of the community, especially @phildini, @dgelessus, I came to the conclusion that toga, and even toga.core are really hard to test. The main problem are platform dependencies that are intertwined with toga.core interfaces. We are already in the mid of week 2 and I'm currently working on restructuring toga to make it testable. If you're interested in the process you can watch my hacking around here (Waring no docs or descriptions at the moment). I hope we have a simple implementation of what a restructured version of toga could look like by the end of the week. If you have questions or comments please feel free to contact me on Gitter or post a comment here. |
[Logbook 2] This weeks main goal is to validate the new restructured form of Toga. The key points to keep in mind are:
If the validations outcome it positive we can work on refactoring the rest of Toga. To change the design of a program like Toga you really have to understand the inner workings of it. In the last weeks I learned a lot about Toga and the processes that make it work. @freakboy3742 suggested to document my learning experience and for others to come. Hence, as I go along I try to write down how Toga works internally. On top of that I try to produce some info graphics about the structure of Toga. Drawing the program structure on paper always helped me, so I thing others could also profit from it. As a last point I try to introduce static typing and MyPy into Toga. I think Toga could gain some confidence and make itself easier to understand if we have at least some static typing in Toga.core. If you have questions or comments please feel free to contact me on Gitter or post a comment here. |
[Logbook 3] RecapLast week I finished the proof of concept for the restructured version of Toga. The proof of concept consists of a working Toga-Cocoa and iOS app. Supported widgets are box and button. Static TypingI did some tests with static typing and MyPy on this branch of toga. After consolidating with @freakboy3742 we decided to put is on hold for the moment. However, it is still possible that static typing is introduced later to the project. PreviewThis week I will move the, currently separated, ocupe/restruc_toga repo into a pull request of the pybee/toga repo. This allows us to start the process of making a Toga 0.3 release with the new restructured and tested version of Toga. After creating the PR, I will, step by step, add more widgets and tests for the Toga-Cocoa and iOS backends. |
[Logbook 4] RecapA lot of code has accumulated in the newly created PR. I think this justifies the name of “The Big Restructure of Toga [WIP]“. Testing TogaAs a reminder, the main reason for this endeavour was to make Toga more testable. Until now, the first tests look promising. Implementation ChecksThe basic idea of the implementation check is to verified if a Toga backend satisfies the requirements in form of classes, methods etc. The biggest problem is the fact that most of the backends are platform specific. For example, the toga-iOS backend requires a iOS device or at least a simulator to run and even to be imported without an exception. This hinders us for just importing the backend and running tests against it. As a way around this we introduced the ast module. With the ast module we can parse the actual .py file and get a representation of the python code in form of an abstract model tree. From the tree we can now extract all kind of structural information about the python file. At the moment I just extract what classes and class methods are in the file. With this informations I check if the requirements are met. The requirements are defined in a newly created dummy backend called toga-dummy. At the moment it is hollow with now functionality, just structure. We extract the required class structure form the dummy backend in the same way we test it, with the help of the ast module. With the requirements at one hand and the backend representation on the other we can now perform some unit tests and check if all the required classes and methods are implemented. This is still very basic but we can build on it. We also see the implementation tests as one part of the bigger testing puzzle that should eventually cover all of Toga. |
@Ocupe Any reason to keep this GSoC proposal still open? |
@danyeaw I don't see a reason. Let's clean up :) |
GSoC Proposal - Toga Settings API and Basic Inward Facing Testing API
Introduction
Programs and settings are a inseparably bound with each other. Every professional application gives users the freedom to change default values to there needs and liking. Toga should realise this need and provide a strong and compelling solution to create beautiful and platform native settings.
The Toga project is completely untested at the moment. As a first step to tackle the not trivial problem, that cross platform testing is, I want to build up a inward facing testing system to test toga core and it's interface.
Project Goals
In short, the main goal of this Google Summer of Code project is to create a strong and compelling Settings API in toga core that is then also implemented in toga.cocoa and toga.iOS.
Implementation
I'm dividing the Settings API implementation into two stages. Conceptualising and Implementing.
Conceptualising the Settings API
Because Toga aims to be platform independent, what also includes it has to be device independent (pc, mobile), we have to create a Settings API that considers for all of that. In #90 I go into great detail about the main challenge of creating a Settings API that works on mobile as well as on Desktop. Some issues to resolve are.
How is the end user going to experience the Settings API?
On key feature of Toga is its use of native widgets that makes the user feel at 'home' on his/her platform machine. The Settings API should not be any different. Users are going to find and open their preferences on the same locations that are normally used for settings. (File > Preferences on Mac, Settings App on iOS ...). The Settings API is also going to provide functionality to save settings in a platform nativ fashion (.plist files on osX/iOS, .xml for Android...).
How is the developer going to use the Settings API?
Another big challenge is to design the Settings API to be easy and a pleasure to use for whom which are actually going to use it - the developers.
Some aspects that I have in mind are:
with
).Under the Hood - a glimps of the implementation
To give a better understanding of how I envision the implementation I give some use cases.
Standard way to use Settings API
Elegant way of using the Settings API:
How can other toga contributors integrate the Settings API on their platforms.
I'm aware that there is a universal outside the Apple galaxy and we need to support other platforms as well. I picked macOS and iOS just because I'm comfortable developing for those platforms. I already included Android into my considerations how the core Settings API should look like to not exclude any platform or even make it hart for them to implement the developed Settings API.
As I mentioned in #90 I want a clean Interface between toga.core and the respective platform integration of the Settings API. This interface converts the defined settings in code to a normalised form. That form is then passed to the platform specific integration of the Toga Settings API integration. This is best explained with a simplified example.
After the definition, the platform specific integration of the Toga Settings API, calls the
get_normal_form()
function to receive the normalised form of the before defined settings, which looks like this:This agreed upon normalised form than acts as the base for all the system specific integrations. For example, a Android developer can now translate this dictionary to a suitable and platform native representation for a settings view.
The normalised from has the nice side effect that we can easily save it as a platform independent settings file (For example as a xml or json file). This allows also for settings syncing over cloud solutions.
Timeline
>>> GSOC.community_bonding('May 4 - 30, 2017')
>>> GSOC.week(1, 'May 30 - June 2')
>>> GSOC.week(2, 'June 5 - 9')
class SettingsItem
with>>> GSOC.week(3, 'June 12 - 16')
class SettingsGroup
>>> GSOC.week(4, 'June 19 - 23')
class Settings()
>>> GSOC.week(5, 'June 26 - 30')
>>> GSOC.week(6, 'July 3 - 7')
>>> GSOC.week(7, 'July 10 - 14')
>>> GSOC.week(8, 'July 17 - 21')
>>> GSOC.week(9, 'July 24 - 28')
>>> GSOC.week(10, 'July 31 - August 14')
>>> GSOC.week(11, 'August 7 - 11')
>>> GSOC.week(12, 'August 14 - 2')
Because the iOS documentation recommends a custom UI for frequently changed preferences instead of the settings bundle, I'm going to implement a solution that gives the developer the possibility to deploy their settings to a normal table view as well. In this form the settings view is just another view in the app and not part of the iOS Settings app.
About me
Hey Bees, thanks for reading my proposal. I'm Jonas and I studied Digital Media. Programming is not a requirement for my masters programs. This should show you that I don't program because I have to but because I love to. Wait, am I then qualified you ask? Even though I'm mostly self taught I had my fair share of university programming courses.
I tried to keep the proposal short, if a more detailed explanation is desired I am happy to expand on any subject.
I look forward to feedback and comments.
Academic History
University of Applied Sciences Düsseldorf
Acquired my Bachelors Degree in Media Engineering. First contact with C and Java and the beginning of my interest for programming.
Drexel University Philadelphia
Because of the performance during my bachelors program I was able to get funding though the Fulbright Foundation. This funding enabled me to study for one year at Drexel University in Philadelphia. I was enrolled in the Digital Media masters program, which was focused on different domains in the field of Digital Media (Game Design and Programming, Interactive Web-development, 3D-Animation and Rendering and Media Theory).
University of the Arts Bremen & University of Bremen
At the moment I am completing my masters degree in Digital Media. My studies here are a joint program of two universities. The University of Bremen, which is responsible for the informatics part of the program and the University of Arts which is dedicated to the media theory and artistic part of the program.
The text was updated successfully, but these errors were encountered: