Initial commit

This commit is contained in:
2022-04-23 19:17:31 +02:00
commit d9ce9fb9a5
8 changed files with 61 additions and 0 deletions

6
Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM docker.io/python:3.10-alpine
COPY . src
RUN cd src && pip install --no-cache-dir .
CMD ["python", "-m", "myproj"]

22
LICENSE.txt Normal file
View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright © 2022
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
# Python Project
This is a test package.

13
pyproject.toml Normal file
View File

@@ -0,0 +1,13 @@
[project]
name = "pyprotest"
version = "0.0.1"
description = "My pyproject test"
readme = "README.md"
license = { file = "LICENSE.txt" }
authors = [
{ name = "Dietrich Rink" }
]
dependencies = [
"requests ~= 2.27.1"
]

5
pyprotest/__main__.py Normal file
View File

@@ -0,0 +1,5 @@
from .request import make_request
resp = make_request()
print(resp.status_code)
print(resp.text)

4
pyprotest/request.py Normal file
View File

@@ -0,0 +1,4 @@
import requests
def make_request():
return requests.get('https://wtfismyip.com/text')

0
tests/__init__.py Normal file
View File

9
tests/test_request.py Normal file
View File

@@ -0,0 +1,9 @@
from unittest import TestCase
from pyprotest import request
class TestRequest(TestCase):
def test_request(self):
resp = request.make_request()
self.assertEqual(resp.status_code, 200)