Commit a369e272 authored by Shashank Kumar's avatar Shashank Kumar

Initializing skeleton Kivy application

- Initial app setup using Kivy
- Integrate pylint, pytest and support for Gitlab CI
- Reporting coverage while running Gitlab CI
parent 2ad85493
.pytest_cache
.coverage
before_script:
- export LANG="C.UTF-8"
- export LC_ALL="C.UTF-8"
- export LC_CTYPE="C.UTF-8"
- apt-get update -qy
- apt-get install -y python3 python3-dev python3-pip build-essential ffmpeg libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev zlib1g-dev
- apt-get install -y libgstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good
- apt-get install ffmpeg
- pip3 install pipenv
- pipenv install --dev --skip-lock
pylint:
type: test
script:
- pipenv run pylint main.py
- pipenv run pylint modules
pytest:
type: test
script:
- pipenv run pytest tests/
- pipenv run pytest --cov=modules
This diff is collapsed.
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[dev-packages]
pylint = "==1.9.1"
pytest = "==3.6.0"
pytest-cov = "==2.5.1"
[packages]
cython = "==0.23"
kivy = "==1.9.1"
[requires]
python_version = "3.5"
This diff is collapsed.
# New Contributor Wizard
### Description
A GSoC 2018 project to help new contributors get started with open source contributions. New Contribution Wizard is a GUI application which on completion will contains all the tutorials and tools to facilitate open source contribution.
### Project Management
Project management is currently underway on [Redmine](https://outreach-lab.debian.net/redmine/projects/new-contributor-wizard) hosted on Debian.
### Prerequisites To Build Application
- GNU/Linux OS (Tested on Debian 9)
- Python (Tested on Python =>3.5)
### Documentation
##### Developer Documentation
These documentations help developers who are willing to build this application from source. Checkout docs from [here](docs/developer.md).
##### Contributor Documentation
These documentations contains guildelines for the contributors get started with best practices to help out in contributing to this project. Checkout docs from [here](docs/contributor.md).
##### User Documentation
These documentations help end users get started with the application and describe the features which can be explored further. Checkout docs from [here](docs/user.md).
#### Changelogs
Changelogs for this project is based on [SemVer](https://semver.org/) or Semantic Versioning. Checkout Changelogs from [here](changelog).
v0.0.1
## June 3 2018
- Reporting coverage while running Gitlab CI.
## June 1 2018
- Initial app setup using Kivy.
- Integrate pylint, pytest and support for Gitlab CI.
# New Contributor Wizard - Contributor Documentation
### Few Key Points
- In order to build the application from the source provided in this repository or to know more about important files and locations, must read [Developer's Doc](Developer.md).
- Again, read [Developer's Doc](Developer.md) as it's very important that you understand the reason why everything at it's place.
- Always create a Fork of this repository and then start to make changes to the forked repository.
- Once you are satisfied with the changes, create a merge request describing briefly about all the changes you have made.
- Make sure the merge reqeust is atomic, ie. only trying to solve one problem at a time.
- Always write tests, documentations and changelogs (if required) with the changes you make to the project.
# New Contributor Wizard - Developer Documentation
### How To Build
Step 1: Install [Pipenv](https://docs.pipenv.org/)
`$ pip install pipenv`
Step 2: Clone this repository to your local machine
`$ git clone https://salsa.debian.org/new-contributor-wizard-team/new-contributor-wizard`
Step 3: Change location to repository
`$ cd new-contributor-wizard`
Step 4: Install dependencies (this might take a while, grab a cup of coffee)
`$ pipenv install`
Step 5: Run New Contributor Wizard
`$ python main.py`
### Some Important Files/Locations
- `main.py` - It contains the Root Kivy Application which is to run in order to start the GUI.
- `data` - It contains static application data which can be used by application at anytime. It helps when the machine is offine.
- `docs` - This directory should and only contain the documentations for developers, contributors and end users.
- `modules` - This directory should and only contain the application login for different modules integrated to the Root Application. For example, this should contain the source for all application logic the tutorials and tools.
- `tests` - This directory should and only contain the Test written for the application, both for application logic and GUI.
- `UI` - This directory should and only contain the `.kv` files which uses Kivy Language in order to create the widget tree. Hence, making the UI designing easier.
### How To Design
Designing of GUI for this application is explained in [this](https://blog.shanky.xyz/gsoc-2018-week-1-and-2.html) blog.
# New Contributor Wizard - User Documentation
### Download the Application
More description on how you can download and install the application from your package manager will ba available soon. Until then you may want to build the application from source yourself, read [Developer's Doc](Developer.md) to find out more.
# New Contributor Wizard - Contributor Documentation
### Few Key Points
- In order to build the application from the source provided in this repository or to know more about important files and locations, must read [Developer's Doc](developer.md).
- Again, read [Developer's Doc](developer.md) as it's very important that you understand the reason why everything at it's place.
- In order to contribute to designing of the application read [Design Doc](design.md)
- Always create a Fork of this repository and then start to make changes to the forked repository.
- Once you are satisfied with the changes, create a merge request describing briefly about all the changes you have made.
- Make sure the merge reqeust is atomic, ie. only trying to solve one problem at a time.
- Always write tests, documentations and changelogs (if required) with the changes you make to the project.
### How To Design
Designing of GUI for this application is explained in [this](https://blog.shanky.xyz/gsoc-2018-week-1-and-2.html) blog.
##### Sign Up Screen
![Sign Up Screen](https://blog.shanky.xyz/images/NewContributorWizardSignUp.png)
##### Sign In Screen
![Sign In Screen](https://blog.shanky.xyz/images/NewContributorWizardSignIn.png)
##### Dashboard
![Dashboard](https://blog.shanky.xyz/images/NewContributorWizardDashboard.png)
# New Contributor Wizard - Developer Documentation
### How To Build
Step 1: Install [Pipenv](https://docs.pipenv.org/)
`$ pip install pipenv`
Step 2: Clone this repository to your local machine
`$ git clone https://salsa.debian.org/new-contributor-wizard-team/new-contributor-wizard`
Step 3: Change location to repository
`$ cd new-contributor-wizard`
Step 4: Install dependencies for KIVY
- For Linux
```
# Install necessary system packages
sudo apt-get install -y \
python-pip \
build-essential \
git \
python \
python-dev \
ffmpeg \
libsdl2-dev \
libsdl2-image-dev \
libsdl2-mixer-dev \
libsdl2-ttf-dev \
libportmidi-dev \
libswscale-dev \
libavformat-dev \
libavcodec-dev \
zlib1g-dev
# Install gstreamer for audio, video (optional)
sudo apt-get install -y \
libgstreamer1.0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good
```
- For MacOS and Windows
This project is build and tested on Linux OS (specifically Debian 9), if you would like to deploy the application to any other OS do checkout the installation process from KIVY docs for [MacOS](https://kivy.org/docs/installation/installation-osx.html) and [Windows](https://kivy.org/docs/installation/installation-windows.html).
Step 4: Install application dependencies (this might take a while, grab a cup of coffee)
`$ pipenv install`
Step 5: Run New Contributor Wizard
`$ python main.py`
### Some Important Files/Locations
- `main.py` - It contains the Root Kivy Application which is to run in order to start the GUI.
- `data` - It contains static application data which can be used by application at anytime. It helps when the machine is offine.
- `docs` - This directory should and only contain the documentations for developers, contributors and end users.
- `modules` - This directory should and only contain the application login for different modules integrated to the Root Application. For example, this should contain the source for all application logic the tutorials and tools.
- `tests` - This directory should and only contain the Test written for the application, both for application logic and GUI.
- `UI` - This directory should and only contain the `.kv` files which uses Kivy Language in order to create the widget tree. Hence, making the UI designing easier.
# New Contributor Wizard - User Documentation
### Download the Application
More description on how you can download and install the application from your package manager will ba available soon. Until then you may want to build the application from source yourself, read [Developer's Doc](developer.md) to find out more.
'''
Root Kivy Application
'''
from kivy.app import App
from kivy.config import Config
from modules.welcome import WelcomeScreen
class NewContributorWizard(App):
'''
Declaration of Root Kivy App which contains Root Widget
'''
def build(self):
return WelcomeScreen()
if __name__ == '__main__':
'''
Setting window width to 720px and height to 480px
'''
Config.set('graphics', 'width', '720')
Config.set('graphics', 'height', '480')
'''
Running Kivy application and building root Widget
'''
NewContributorWizard().run()
'''
Sample module just to showcase how pytest should be used
'''
from datetime import datetime as dt
import calendar
class SampleCommunicationModule():
'''
Sample class to showcase testing
'''
@staticmethod
def return_datetime_object(date_time, given_format):
'''
Sample method to change given date time to unix timestamp
'''
given_datetime_object = dt.strptime(date_time, given_format)
return given_datetime_object
@staticmethod
def unix_time_of_communication(date_time, given_format):
'''
Sample method to change given date time to unix timestamp
'''
given_date_time = dt.strptime(date_time, given_format)
unix_time = calendar.timegm(given_date_time.utctimetuple())
return unix_time
'''
Class for Welcome Screen
'''
from kivy.uix.gridlayout import GridLayout
from kivy.lang import Builder
Builder.load_file('./ui/welcome.kv')
class WelcomeScreen(GridLayout):
'''
Declaration of Welcome Screen which is the first screen to show
after Kivy application is running
'''
def __init__(self, **kwargs):
super(WelcomeScreen, self).__init__(**kwargs)
import pytest
from datetime import datetime as dt
from modules.communication.sample_module import SampleCommunicationModule
@pytest.mark.incremental
class Testsample:
def test_return_datetime_object(self):
resultant_datetime_object = SampleCommunicationModule.return_datetime_object("3/3/2018 12:02", "%m/%d/%Y %H:%M")
assert type(dt.now()) == type(resultant_datetime_object)
def test_unix_time_of_communication(self):
resultant_unix_timestamp = SampleCommunicationModule.unix_time_of_communication("3/3/2018 12:02", "%m/%d/%Y %H:%M")
assert 1520078520 == resultant_unix_timestamp
<WelcomeScreen>:
cols: 2
Label:
text: "Hello"
Label:
text: "World"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment