-
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
65d09a3
commit 5f1d136
Showing
6 changed files
with
104 additions
and
0 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,3 @@ | ||
build | ||
dist | ||
zyz.egg-info |
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,21 @@ | ||
all: clean check_setup build_bdist pypi_upload | ||
@echo "All in one workflow" | ||
|
||
check_setup: | ||
@python3 setup.py check | ||
|
||
build_sdist: check_setup | ||
@echo "build sdist:" | ||
@python3 setup.py sdist | ||
|
||
build_bdist: check_setup | ||
@echo "build bdist_wheel:" | ||
@python3 setup.py bdist_wheel | ||
|
||
pypi_upload: build_bdist | ||
@echo "Upload to PyPI:" | ||
@twine upload dist/* | ||
|
||
clean: | ||
@echo "Clean workspace:" | ||
rm -fr build dist zhouyuanzhen.egg-info |
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,2 +1,24 @@ | ||
# zyztk | ||
|
||
[<img src="https://avatars2.githubusercontent.com/u/54104471" align="right" width="200">](https://github.com/zhouyuanzhen) | ||
|
||
My Python Toolkit | ||
|
||
## Quick Start | ||
|
||
### Install pip package | ||
|
||
```shell | ||
pip install -U zyz | ||
``` | ||
|
||
### Work with the package | ||
|
||
```python | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import zyz | ||
|
||
zyz.help() | ||
``` |
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,34 @@ | ||
""" | ||
Yuanzhen Zhou 's Python Toolkit | ||
""" | ||
|
||
from setuptools import setup, find_packages | ||
|
||
LONG_DESC = """ | ||
Python Toolkit of Yuanzhen Zhou. | ||
""" | ||
|
||
setup( | ||
name='zyz', | ||
version='0.2.0', | ||
license='Apache License 2.0', | ||
keywords='zyz, zyztk, zhouyuanzhen', | ||
maintainer='Yuanzhen Zhou', | ||
maintainer_email='[email protected]', | ||
packages=find_packages(include=['zyz', 'zyz.*']), | ||
zip_safe=False, | ||
include_package_data=True, | ||
url='https://github.com/zhouyuanzhen/zyztk', | ||
author='Yuanzhen Zhou', | ||
author_email='[email protected]', | ||
description='Python Toolkit of Yuanzhen Zhou', | ||
long_description=LONG_DESC, | ||
python_requires='>=3.5, <4', | ||
install_requires=[], | ||
extras_require={ | ||
'test': [ | ||
'pytest', | ||
'coverage', | ||
], | ||
}, | ||
) |
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,15 @@ | ||
import sys | ||
import os | ||
|
||
sys.path.append(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
|
||
def help(): | ||
|
||
print("************************************************\n") | ||
print("Help:\n") | ||
print("* Install zyz package:") | ||
print("pip install -U zyz -i https://pypi.python.org/pypi\n") | ||
print("* Use with zyz package:") | ||
print("python -c 'import zyz;zyz.help()'\n") | ||
print("************************************************\n") |
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,9 @@ | ||
|
||
def get_public_ip(): | ||
|
||
import urllib.request | ||
import ssl | ||
|
||
ssl._create_default_https_context = ssl._create_unverified_context | ||
|
||
return urllib.request.urlopen("https://ifconfig.me/ip").read().decode() |