Skip to content

Commit d936b11

Browse files
committed
added more logging and setup python publish
1 parent 92c71e3 commit d936b11

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

.github/workflows/python-publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ on:
99

1010
jobs:
1111
deploy:
12-
1312
runs-on: ubuntu-latest
14-
1513
steps:
16-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v1
1715
- name: Set up Python
18-
uses: actions/setup-python@v2
16+
uses: actions/setup-python@v1
1917
with:
2018
python-version: '3.x'
2119
- name: Install dependencies
@@ -24,8 +22,8 @@ jobs:
2422
pip install setuptools wheel twine
2523
- name: Build and publish
2624
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
25+
TWINE_USERNAME: __token__
26+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
2927
run: |
3028
python setup.py sdist bdist_wheel
3129
twine upload dist/*

flask_shell2http/api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
# system imports
1010
import functools
1111
from http import HTTPStatus
12-
from typing import Any, Callable, Dict
12+
from typing import Callable, Dict, Any
1313

1414
# web imports
15-
from flask import jsonify, make_response, request
15+
from flask import request, jsonify, make_response
1616
from flask.views import MethodView
1717
from flask_executor import Executor
1818
from flask_executor.futures import Future
1919

2020
# lib imports
2121
from .classes import RunnerParser
22-
from .exceptions import JobNotFoundException, JobStillRunningException
2322
from .helpers import get_logger
23+
from .exceptions import JobNotFoundException, JobStillRunningException
2424

2525
logger = get_logger()
2626
runner_parser = RunnerParser()
@@ -93,7 +93,7 @@ def get(self):
9393
)
9494

9595
except Exception as e:
96-
logger.error(e)
96+
logger.exception(e)
9797
return make_response(jsonify(error=str(e)), HTTPStatus.BAD_REQUEST)
9898

9999
def post(self):
@@ -132,7 +132,7 @@ def post(self):
132132
)
133133

134134
except Exception as e:
135-
logger.error(e)
135+
logger.exception(e)
136136
response_dict = {"error": str(e)}
137137
if key:
138138
response_dict["key"] = key
@@ -171,7 +171,7 @@ def delete(self):
171171
return make_response(jsonify(error=str(e)), HTTPStatus.NOT_FOUND)
172172

173173
except Exception as e:
174-
logger.error(e)
174+
logger.exception(e)
175175
return make_response(jsonify(error=str(e)), HTTPStatus.BAD_REQUEST)
176176

177177
@classmethod

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
##### Docs & Example usage on GitHub: https://github.com/eshaan7/flask-shell2http
88
"""
99
import pathlib
10-
1110
from setuptools import setup
1211

1312
# The directory containing this file
@@ -19,15 +18,15 @@
1918
# version
2019
VERSION = (HERE / "version.txt").read_text()
2120

22-
GITHUB_URL = "https://github.com/eshaan7/flask-shell2http"
21+
GITHUB_URL = "https://github.com/intelowlproject/flask-shell2http"
2322

2423
requirements = (HERE / "requirements.txt").read_text().split("\n")
2524

2625
requirements_test = (HERE / "requirements.dev.txt").read_text().split("\n")
2726

2827
# This call to setup() does all the work
2928
setup(
30-
name="Flask-Shell2HTTP",
29+
name="Flask-Shell2HTTP-fork",
3130
version=VERSION,
3231
url=GITHUB_URL,
3332
license="BSD",

0 commit comments

Comments
 (0)