Skip to content
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

chore: Updated license from GPLv3 to Apache 2.0 #40

Merged
merged 5 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ jobs:
flake8 --version
flake8 ./

unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
architecture: x64
- name: Run unittests
run: |
python -m unittest discover test/

docker-ready:
runs-on: ubuntu-latest
needs: install-deps
Expand Down
875 changes: 201 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Pyronear Platform
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/0e4490e06eaf41a3a5faea69dad5caa9)](https://www.codacy.com/gh/pyronear/pyro-platform/dashboard?utm_source=github.com&utm_medium=referral&utm_content=pyronear/pyro-platform&utm_campaign=Badge_Grade) ![Build Status](https://github.com/pyronear/pyro-platform/workflows/dash-project/badge.svg)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/0e4490e06eaf41a3a5faea69dad5caa9)](https://www.codacy.com/gh/pyronear/pyro-platform/dashboard?utm_source=github.com&utm_medium=referral&utm_content=pyronear/pyro-platform&utm_campaign=Badge_Grade) ![Build Status](https://github.com/pyronear/pyro-platform/workflows/dash-project/badge.svg)

The building blocks of our wildfire detection & monitoring API.

Expand Down Expand Up @@ -69,4 +69,4 @@ Like previously, you can navigate then to http://localhost:8050/ to interact wit

## License

Distributed under the GPLv3 License. See `LICENSE` for more information.
Distributed under the Apache 2.0 License. See `LICENSE` for more information.
5 changes: 5 additions & 0 deletions app/alerts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

"""
The following Python file is dedicated to the "Alerts and Infrastructure" view of the dashboard.

Expand Down
5 changes: 5 additions & 0 deletions app/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

import os
from dotenv import load_dotenv

Expand Down
5 changes: 5 additions & 0 deletions app/graphs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

"""
The following file is dedicated to graph functions.

Expand Down
5 changes: 5 additions & 0 deletions app/homepage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

"""
The following Python file is dedicated to the homepage of the web application.

Expand Down
5 changes: 5 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

"""
The following is the main file and the script to run in order to launch the app locally.

Expand Down
5 changes: 5 additions & 0 deletions app/navbar.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

"""
The following file is dedicated to the navigation bar at the top of the web application.

Expand Down
5 changes: 5 additions & 0 deletions app/risks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

"""
The following file is dedicated to the "Risk Score" view of the dashboard.

Expand Down
5 changes: 5 additions & 0 deletions app/services/api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

from pyroclient import Client
import config as cfg

Expand Down
5 changes: 5 additions & 0 deletions app/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

"""
The following file gathers several items (variables, functions...) that are common to both views of the dashboard.

Expand Down
48 changes: 48 additions & 0 deletions test/test_headers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (C) 2021, Pyronear contributors.

# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.

import unittest
from pathlib import Path


class HeadersTester(unittest.TestCase):

def setUp(self):
shebang = ["#!usr/bin/python\n"]
blank_line = "\n"

copyright_notice = ["# Copyright (C) 2021, Pyronear contributors.\n"]
license_notice = [
"# This program is licensed under the Apache License version 2.\n",
"# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.\n"
]

self.headers = [
shebang + [blank_line] + copyright_notice + [blank_line] + license_notice,
copyright_notice + [blank_line] + license_notice
]

self.excluded_files = ["version.py", "__init__.py"]

def test_headers(self):
# For every python file in the repository
for source_path in Path(__file__).parent.parent.rglob('*.py'):
if source_path.name not in self.excluded_files:
# Parse header
header_length = max(len(option) for option in self.headers)
current_header = []
with open(source_path) as f:
for idx, line in enumerate(f):
current_header.append(line)
if idx == header_length - 1:
break

# Compare it
self.assertTrue(any("".join(current_header[:min(len(option), len(current_header))]) == "".join(option)
for option in self.headers), msg=f"Invalid header in {source_path}")


if __name__ == '__main__':
unittest.main()