-
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.
- Loading branch information
1 parent
934ce7f
commit 157d3e1
Showing
7 changed files
with
102 additions
and
3 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,39 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python package | ||
|
||
on: | ||
push: | ||
branches: [master,dev] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install devDependence | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install mypy pycodestyle coverage lxml | ||
- name: Install dependencies | ||
run: | | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with pep8 | ||
run: | | ||
pycodestyle --max-line-length=140 --ignore=E501 --first --statistics pyloggerhelper | ||
- name: Type Hint Check | ||
run: | | ||
mypy --ignore-missing-imports --show-column-numbers --follow-imports=silent --check-untyped-defs --disallow-untyped-defs --no-implicit-optional --warn-unused-ignores pyloggerhelper | ||
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,38 @@ | ||
# This workflows will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Upload Python Package | ||
|
||
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 | ||
run: | | ||
python setup.py sdist bdist_wheel bdist_egg | ||
- name: 'Upload dist' | ||
uses: 'actions/upload-artifact@v2' | ||
with: | ||
name: packages | ||
path: dist/* | ||
- name: Publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | ||
twine upload 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,10 @@ | ||
from pyloggerhelper import log | ||
|
||
|
||
def testrun(): | ||
log.info("test") | ||
|
||
|
||
if __name__ == "__main__": | ||
log.initialize_for_app("testapp") | ||
testrun() |
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 |
---|---|---|
@@ -1 +1,9 @@ | ||
{"env": ["venv"], "project_name": "pyloggerhelper", "version": "0.0.0", "author": "hsz12", "author_email": "", "description": "", "keywords": null} | ||
{ | ||
"env": ["venv"], | ||
"project_name": "pyloggerhelper", | ||
"version": "0.0.0", | ||
"author": "hsz12", | ||
"author_email": "[email protected]", | ||
"description": "json logger helper", | ||
"keywords": ["logger", "proxy"] | ||
} |
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 @@ | ||
from .proxy import StructlogProxy,log |
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,2 @@ | ||
pyproxypattern == 0.0.1 | ||
structlog == 20.2.0 |
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 @@ name = pyloggerhelper | |
version = 0.0.0 | ||
author = hsz | ||
author_email = [email protected] | ||
description = json格式结构化logger的帮助程序 | ||
description = json logger helper | ||
long_description = file: README.md, CHANGELOG.md, LICENSE | ||
long_description_content_type = text/markdown | ||
keywords = logger, proxy | ||
|
@@ -22,9 +22,10 @@ include_package_data = True | |
packages = find: | ||
install_requires = | ||
pyproxypattern >= 0.0.1 | ||
structlog >= 20.2.0 | ||
|
||
|
||
[options.packages.find] | ||
include = pyloggerhelper | ||
exclude = tests | ||
exclude = tests, example.py | ||
|