Skip to content

Commit 1f40218

Browse files
committed
Ran pre-commit, added licenses
1 parent 4b53423 commit 1f40218

37 files changed

+604
-80
lines changed

.github/workflows/test.yml

-25
This file was deleted.

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
*.mpy
26
.idea
37
__pycache__
@@ -8,4 +12,4 @@ bundles
812
*.DS_Store
913
.eggs
1014
dist
11-
**/*.egg-info
15+
**/*.egg-info

.pylintrc

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
[MASTER]
26

37
# A comma-separated list of package or module names from where C extensions may

.readthedocs.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
python:
26
version: 3
37
requirements_file: requirements.txt

CODE_OF_CONDUCT.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
3+
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
4+
SPDX-License-Identifier: CC-BY-4.0
5+
-->
6+
17
# Adafruit Community Code of Conduct
28

39
## Our Pledge
@@ -43,7 +49,7 @@ Examples of unacceptable behavior by participants include:
4349

4450
The goal of the standards and moderation guidelines outlined here is to build
4551
and maintain a respectful community. We ask that you don’t just aim to be
46-
"technically unimpeachable", but rather try to be your best self.
52+
"technically unimpeachable", but rather try to be your best self.
4753

4854
We value many things beyond technical expertise, including collaboration and
4955
supporting others within our community. Providing a positive experience for
@@ -74,9 +80,9 @@ You may report in the following ways:
7480
In any situation, you may send an email to <support@adafruit.com>.
7581

7682
On the Adafruit Discord, you may send an open message from any channel
77-
to all Community Moderators by tagging @community moderators. You may
78-
also send an open message from any channel, or a direct message to
79-
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
83+
to all Community Moderators by tagging @community moderators. You may
84+
also send an open message from any channel, or a direct message to
85+
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
8086
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
8187

8288
Email and direct message reports will be kept confidential.

LICENSES/CC-BY-4.0.txt

+324
Large diffs are not rendered by default.

LICENSES/MIT.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License Copyright (c) <year> <copyright holders>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice (including the next
11+
paragraph) shall be included in all copies or substantial portions of the
12+
Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19+
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LICENSES/Unlicense.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute
4+
this software, either in source code form or as a compiled binary, for any
5+
purpose, commercial or non-commercial, and by any means.
6+
7+
In jurisdictions that recognize copyright laws, the author or authors of this
8+
software dedicate any and all copyright interest in the software to the public
9+
domain. We make this dedication for the benefit of the public at large and
10+
to the detriment of our heirs and successors. We intend this dedication to
11+
be an overt act of relinquishment in perpetuity of all present and future
12+
rights to this software under copyright law.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
19+
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information,
20+
please refer to <https://unlicense.org/>

README.rst.license

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
3+
SPDX-License-Identifier: MIT

adafruit_requests.py

+4-21
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
1-
# The MIT License (MIT)
1+
# SPDX-FileCopyrightText: 2019 ladyada for Adafruit Industries
2+
# SPDX-FileCopyrightText: 2020 Scott Shawcroft for Adafruit Industries
23
#
3-
# Copyright (c) 2019 ladyada for Adafruit Industries
4-
# Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
5-
#
6-
# Permission is hereby granted, free of charge, to any person obtaining a copy
7-
# of this software and associated documentation files (the "Software"), to deal
8-
# in the Software without restriction, including without limitation the rights
9-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
# copies of the Software, and to permit persons to whom the Software is
11-
# furnished to do so, subject to the following conditions:
12-
#
13-
# The above copyright notice and this permission notice shall be included in
14-
# all copies or substantial portions of the Software.
15-
#
16-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22-
# THE SOFTWARE.
4+
# SPDX-License-Identifier: MIT
5+
236
"""
247
`adafruit_requests`
258
================================================================================

docs/_static/favicon.ico.license

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries
2+
3+
SPDX-License-Identifier: CC-BY-4.0

docs/api.rst.license

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

docs/conf.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# -*- coding: utf-8 -*-
22

3+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
4+
#
5+
# SPDX-License-Identifier: MIT
6+
37
import os
48
import sys
59

docs/examples.rst.license

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

docs/index.rst.license

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

examples/requests_advanced.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
import board
25
import busio
36
from digitalio import DigitalInOut

examples/requests_advanced_cellular.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
# pylint: disable=unused-import
25
import time
36
import board

examples/requests_advanced_cpython.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
import socket
25
import adafruit_requests
36

examples/requests_advanced_ethernet.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
import board
25
import busio
36
from digitalio import DigitalInOut

examples/requests_github_cpython.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
# adafruit_requests usage with a CPython socket
25
import socket
36
import ssl

examples/requests_https_cpython.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
# adafruit_requests usage with a CPython socket
25
import socket
36
import ssl

examples/requests_simpletest.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
# adafruit_requests usage with an esp32spi_socket
25
import board
36
import busio

examples/requests_simpletest_cellular.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
# pylint: disable=unused-import
25
import time
36
import board

examples/requests_simpletest_cpython.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
# adafruit_requests usage with a CPython socket
25
import socket
36
import adafruit_requests

examples/requests_simpletest_ethernet.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
import board
25
import busio
36
from digitalio import DigitalInOut

requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
Adafruit-Blinka

setup.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
"""A setuptools based setup module.
26
37
See:

tests/chunk_test.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
from unittest import mock
26
import mocket
37
import adafruit_requests
@@ -53,7 +57,10 @@ def do_test_get_text(extra=b""):
5357
]
5458
)
5559
sock.send.assert_has_calls(
56-
[mock.call(b"Host: "), mock.call(b"wifitest.adafruit.com"),]
60+
[
61+
mock.call(b"Host: "),
62+
mock.call(b"wifitest.adafruit.com"),
63+
]
5764
)
5865
assert r.text == str(text, "utf-8")
5966

@@ -89,7 +96,10 @@ def do_test_close_flush(extra=b""):
8996
]
9097
)
9198
sock.send.assert_has_calls(
92-
[mock.call(b"Host: "), mock.call(b"wifitest.adafruit.com"),]
99+
[
100+
mock.call(b"Host: "),
101+
mock.call(b"wifitest.adafruit.com"),
102+
]
93103
)
94104

95105
r.close()

tests/concurrent_test.py

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
from unittest import mock
26
import mocket
37
import pytest
@@ -28,11 +32,17 @@ def test_second_connect_fails_memoryerror():
2832
r = s.get("https://" + host + path)
2933

3034
sock.send.assert_has_calls(
31-
[mock.call(b"testwifi/index.html"),]
35+
[
36+
mock.call(b"testwifi/index.html"),
37+
]
3238
)
3339

3440
sock.send.assert_has_calls(
35-
[mock.call(b"Host: "), mock.call(b"wifitest.adafruit.com"), mock.call(b"\r\n"),]
41+
[
42+
mock.call(b"Host: "),
43+
mock.call(b"wifitest.adafruit.com"),
44+
mock.call(b"\r\n"),
45+
]
3646
)
3747
assert r.text == str(text, "utf-8")
3848

@@ -65,11 +75,17 @@ def test_second_connect_fails_oserror():
6575
r = s.get("https://" + host + path)
6676

6777
sock.send.assert_has_calls(
68-
[mock.call(b"testwifi/index.html"),]
78+
[
79+
mock.call(b"testwifi/index.html"),
80+
]
6981
)
7082

7183
sock.send.assert_has_calls(
72-
[mock.call(b"Host: "), mock.call(b"wifitest.adafruit.com"), mock.call(b"\r\n"),]
84+
[
85+
mock.call(b"Host: "),
86+
mock.call(b"wifitest.adafruit.com"),
87+
mock.call(b"\r\n"),
88+
]
7389
)
7490
assert r.text == str(text, "utf-8")
7591

tests/header_test.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
from unittest import mock
26
import mocket
37
import json

tests/legacy_mocket.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
from unittest import mock
26

37
SOCK_STREAM = 0

0 commit comments

Comments
 (0)