Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz1273327 committed Jan 14, 2021
1 parent 934ce7f commit 157d3e1
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-package.yml
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
38 changes: 38 additions & 0 deletions .github/workflows/python-publish.yml
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/*
10 changes: 10 additions & 0 deletions example.py
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()
10 changes: 9 additions & 1 deletion ppmrc.json
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"]
}
1 change: 1 addition & 0 deletions pyloggerhelper/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .proxy import StructlogProxy,log
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyproxypattern == 0.0.1
structlog == 20.2.0
5 changes: 3 additions & 2 deletions setup.cfg_ → setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 157d3e1

Please sign in to comment.