-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed library to be packagable, added logging, added workflows, corre…
…cted spelling mistakes
- Loading branch information
1 parent
581ee66
commit eb4c9f2
Showing
23 changed files
with
205 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.py] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{md,mdx}] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload --repository pypi dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.6, 3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install Tox and any other packages | ||
run: pip install tox | ||
- name: Run Tox | ||
# Run tox using the version of Python in `PATH` | ||
run: tox -e py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+37.7 KB
.vs/ShipHelm/FileContentIndex/0e381e5b-9409-4ffc-9c4e-02d580443435.vsidx
Binary file not shown.
Binary file added
BIN
+197 Bytes
.vs/ShipHelm/FileContentIndex/2667559c-c77f-4162-9ef3-fef940b13df2.vsidx
Binary file not shown.
Binary file added
BIN
+335 Bytes
.vs/ShipHelm/FileContentIndex/5f0240db-9267-4a3c-9bc0-bc9b9f4fa559.vsidx
Binary file not shown.
Binary file added
BIN
+4.74 KB
.vs/ShipHelm/FileContentIndex/63424c4f-3749-4dc3-b82b-7a73206eef4d.vsidx
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file removed
BIN
-36.7 KB
.vs/Shipwreck/FileContentIndex/bae79108-9b47-40e9-a4e4-d14590be1602.vsidx
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"ExpandedNodes": [ | ||
"", | ||
"\\dist" | ||
], | ||
"SelectedNode": "\\setup.py", | ||
"PreviewInSolutionExplorer": false | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include pyproject.toml | ||
include *.md | ||
include LICENSE | ||
recursive-include tests test*.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["setuptools>=46.4.0", "wheel"] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[metadata] | ||
version = 0.5.0 | ||
license_files = LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
setup( | ||
name='Shipwreck', | ||
version='0.1.3', | ||
description='A library for handling Python errors and suggesting fixes', | ||
description='A library for logging and handling Python errors and suggesting fixes', | ||
author='Gameplex Sfotware', | ||
author_email='[email protected]', | ||
install_requires=[ | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# ---------------------------------------------------------------------------- | ||
# ShipHelm Copyright 2020-2023 by Gameplex Software and contributors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ---------------------------------------------------------------------------- | ||
|
||
import datetime | ||
|
||
class logging: | ||
def __init__(self): | ||
logging.log(logline="ShipWreck logging and error detection active! \n \n # ---------------------------------------------------------------------------- \n # ShipHelm Copyright 2020-2023 by Gameplex Software and contributors \n # \n # Licensed under the Apache License, Version 2.0 (the 'License'); \n # you may not use this file except in compliance with the License. \n # You may obtain a copy of the License at \n # \n # http://www.apache.org/licenses/LICENSE-2.0 \n # \n # Unless required by applicable law or agreed to in writing, software \n # distributed under the License is distributed on an 'AS IS' BASIS, \n # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n # See the License for the specific language governing permissions and \n # limitations under the License. \n # ----------------------------------------------------------------------------\n",type="n") | ||
logging.log(logline="\n _________.__ .__ __ __ __ \n / _____/| |__ |__|______ / \ / \_______ ____ ____ | | __ \n \_____ \ | | \ | |\____ \\ \/\/ /\_ __ \_/ __ \_/ ___\ | |/ / \n / \| Y \| || |_> >\ / | | \/\ ___/\ \___ | < \n /_______ /|___| /|__|| __/ \__/\ / |__| \___ >\___ >|__|_ \ \n \/ \/ |__| \/ \/ \/ \/ \n ",type="n") | ||
print("ShipWreck logging and error detection active! \n \n # ---------------------------------------------------------------------------- \n # ShipHelm Copyright 2020-2023 by Gameplex Software and contributors \n # \n # Licensed under the Apache License, Version 2.0 (the 'License'); \n # you may not use this file except in compliance with the License. \n # You may obtain a copy of the License at \n # \n # http://www.apache.org/licenses/LICENSE-2.0 \n # \n # Unless required by applicable law or agreed to in writing, software \n # distributed under the License is distributed on an 'AS IS' BASIS, \n # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n # See the License for the specific language governing permissions and \n # limitations under the License. \n # ----------------------------------------------------------------------------\n") | ||
print("\n _________.__ .__ __ __ __ \n / _____/| |__ |__|______ / \ / \_______ ____ ____ | | __ \n \_____ \ | | \ | |\____ \\ \/\/ /\_ __ \_/ __ \_/ ___\ | |/ / \n / \| Y \| || |_> >\ / | | \/\ ___/\ \___ | < \n /_______ /|___| /|__|| __/ \__/\ / |__| \___ >\___ >|__|_ \ \n \/ \/ |__| \/ \/ \/ \/ \n ") | ||
|
||
|
||
def log(self, logline, type): | ||
with open('latest.log', 'a') as file: | ||
logging = logline + "[" + datetime.strftime("%Y-%m-%d %H:%M:%S") + " " | ||
if type == "w": | ||
logline = "WARN]: " + logline + "\n" | ||
elif type == "d": | ||
logline = "DEBUG]: " + logline + "\n" | ||
elif type == "e": | ||
logline = "ERROR]: Oh mo! looks like you hit a ShipWreck, here is what we know: \n ---------[Begin Error]--------- \n" + logline + "\n ----------[End Error]---------- \n" | ||
elif type == "n": | ||
logline = logline | ||
else: | ||
logline = "INFO]: " + logline + "\n" | ||
print(logline) | ||
file.write(logline) | ||
|
||
def clearlog(self): | ||
with open('latest.log') as file: | ||
logline = "" | ||
file.write(logline) | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import unittest | ||
|
||
from shiphelm import helmdocker | ||
|
||
|
||
|
||
|
||
class TestSimple(unittest.TestCase): | ||
helmdocker.docker.__init__ | ||
if __name__ == '__main__': | ||
unittest.main() |