Skip to content

Commit 81b9e9b

Browse files
committed
🤝 synchronize with pypi-mobans
1 parent c2bdc6e commit 81b9e9b

File tree

6 files changed

+93
-57
lines changed

6 files changed

+93
-57
lines changed

.github/workflows/pythonpublish.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Set up Python
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: '3.x'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

.moban.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
requires:
2-
- type: git
3-
url: https://github.com/moremoban/pypi-mobans
4-
submodule: true
51
configuration:
62
template_dir:
7-
- "pypi-mobans:templates"
3+
- "git://github.com/moremoban/pypi-mobans.git?submodule=true&brach=dev!/templates"
4+
- "git://github.com/moremoban/pypi-mobans.git?submodule=true&brach=dev!/statics"
85
- ".moban.d"
96
configuration: gease.yml
107
targets:
@@ -14,3 +11,4 @@ targets:
1411
- "tests/requirements.txt": "tests/requirements.txt.jj2"
1512
- test.sh: test.script.jj2
1613
- 'gease/_version.py': 'version.py.jj2'
14+
- ".github/workflows/pythonpublish.yml": "pythonpublish.yml"

README.rst

+7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ gease - gITHUB RELease
77

88
.. image:: https://codecov.io/github/moremoban/gease/coverage.png
99
:target: https://codecov.io/github/moremoban/gease
10+
.. image:: https://badge.fury.io/py/gease.svg
11+
:target: https://pypi.org/project/gease
1012

13+
.. image:: https://pepy.tech/badge/gease/month
14+
:target: https://pepy.tech/project/gease/month
15+
16+
.. image:: https://img.shields.io/github/stars/moremoban/gease.svg?style=social&maxAge=3600&label=Star
17+
:target: https://github.com/moremoban/gease/stargazers
1118

1219

1320
::

setup.py

+55-50
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env python3
22

3-
# Template by pypi-mobans
3+
"""
4+
Template by pypi-mobans
5+
"""
6+
47
import os
58
import sys
69
import codecs
@@ -22,61 +25,63 @@
2225
try:
2326
lc = locale.getlocale()
2427
pf = platform.system()
25-
if pf != 'Windows' and lc == (None, None):
26-
locale.setlocale(locale.LC_ALL, 'C.UTF-8')
28+
if pf != "Windows" and lc == (None, None):
29+
locale.setlocale(locale.LC_ALL, "C.UTF-8")
2730
except (ValueError, UnicodeError, locale.Error):
28-
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
31+
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
2932

30-
NAME = 'gease'
31-
AUTHOR = 'C. W.'
32-
VERSION = '0.0.3'
33-
34-
LICENSE = 'MIT'
33+
NAME = "gease"
34+
AUTHOR = "C. W."
35+
VERSION = "0.0.3"
36+
37+
LICENSE = "MIT"
3538
ENTRY_POINTS = {
36-
'console_scripts': [
37-
'gease = gease.main:main',
38-
'fork = gease.fork:main',
39+
"console_scripts": [
40+
"gease = gease.main:main",
41+
"fork = gease.fork:main",
3942
],
4043
}
4144
DESCRIPTION = (
42-
'simply makes a git release using github api v3'
45+
"simply makes a git release using github api v3"
4346
)
44-
URL = 'https://github.com/moremoban/gease'
45-
DOWNLOAD_URL = '%s/archive/0.0.3.tar.gz' % URL
46-
FILES = ['README.rst', 'CHANGELOG.rst']
47+
URL = "https://github.com/moremoban/gease"
48+
DOWNLOAD_URL = "%s/archive/0.0.3.tar.gz" % URL
49+
FILES = ["README.rst", "CHANGELOG.rst"]
4750
KEYWORDS = [
48-
'python',
51+
"python",
4952
]
5053

5154
CLASSIFIERS = [
52-
'Topic :: Software Development :: Libraries',
53-
'Programming Language :: Python',
54-
'Intended Audience :: Developers',
55-
'Programming Language :: Python :: 2.6',
56-
'Programming Language :: Python :: 2.7',
57-
'Programming Language :: Python :: 3.3',
58-
'Programming Language :: Python :: 3.4',
59-
'Programming Language :: Python :: 3.5',
60-
'Programming Language :: Python :: 3.6',
55+
"Topic :: Software Development :: Libraries",
56+
"Programming Language :: Python",
57+
"Intended Audience :: Developers",
58+
"Programming Language :: Python :: 2.6",
59+
"Programming Language :: Python :: 2.7",
60+
"Programming Language :: Python :: 3.3",
61+
"Programming Language :: Python :: 3.4",
62+
"Programming Language :: Python :: 3.5",
63+
"Programming Language :: Python :: 3.6",
64+
"Programming Language :: Python :: 3.7",
65+
"Programming Language :: Python :: 3.8",
66+
6167
]
6268

69+
6370
INSTALL_REQUIRES = [
64-
'crayons',
65-
'requests',
71+
"crayons",
72+
"requests",
6673
]
6774
SETUP_COMMANDS = {}
6875

69-
70-
PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
76+
PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests", "tests.*"])
7177
EXTRAS_REQUIRE = {
7278
}
7379
# You do not need to read beyond this line
74-
PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format(
75-
sys.executable)
76-
GS_COMMAND = ('gs gease v0.0.3 ' +
80+
PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable)
81+
GS_COMMAND = ("gs gease v0.0.3 " +
7782
"Find 0.0.3 in changelog for more details")
78-
NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
79-
'Please install gease to enable it.')
83+
NO_GS_MESSAGE = ("Automatic github release is disabled. " +
84+
"Please install gease to enable it.")
8085
UPLOAD_FAILED_MSG = (
8186
'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND)
8287
HERE = os.path.abspath(os.path.dirname(__file__))
@@ -85,13 +90,13 @@
8590
class PublishCommand(Command):
8691
"""Support setup.py upload."""
8792

88-
description = 'Build and publish the package on github and pypi'
93+
description = "Build and publish the package on github and pypi"
8994
user_options = []
9095

9196
@staticmethod
9297
def status(s):
9398
"""Prints things in bold."""
94-
print('\033[1m{0}\033[0m'.format(s))
99+
print("\033[1m{0}\033[0m".format(s))
95100

96101
def initialize_options(self):
97102
pass
@@ -101,28 +106,28 @@ def finalize_options(self):
101106

102107
def run(self):
103108
try:
104-
self.status('Removing previous builds...')
105-
rmtree(os.path.join(HERE, 'dist'))
106-
rmtree(os.path.join(HERE, 'build'))
107-
rmtree(os.path.join(HERE, 'gease.egg-info'))
109+
self.status("Removing previous builds...")
110+
rmtree(os.path.join(HERE, "dist"))
111+
rmtree(os.path.join(HERE, "build"))
112+
rmtree(os.path.join(HERE, "gease.egg-info"))
108113
except OSError:
109114
pass
110115

111-
self.status('Building Source and Wheel (universal) distribution...')
116+
self.status("Building Source and Wheel (universal) distribution...")
112117
run_status = True
113118
if has_gease():
114119
run_status = os.system(GS_COMMAND) == 0
115120
else:
116121
self.status(NO_GS_MESSAGE)
117122
if run_status:
118123
if os.system(PUBLISH_COMMAND) != 0:
119-
self.status(UPLOAD_FAILED_MSG % PUBLISH_COMMAND)
124+
self.status(UPLOAD_FAILED_MSG)
120125

121126
sys.exit()
122127

123128

124129
SETUP_COMMANDS.update({
125-
'publish': PublishCommand
130+
"publish": PublishCommand
126131
})
127132

128133

@@ -151,7 +156,7 @@ def read_files(*files):
151156
def read(afile):
152157
"""Read a file into setup"""
153158
the_relative_file = os.path.join(HERE, afile)
154-
with codecs.open(the_relative_file, 'r', 'utf-8') as opened_file:
159+
with codecs.open(the_relative_file, "r", "utf-8") as opened_file:
155160
content = filter_out_test_code(opened_file)
156161
content = "".join(list(content))
157162
return content
@@ -160,11 +165,11 @@ def read(afile):
160165
def filter_out_test_code(file_handle):
161166
found_test_code = False
162167
for line in file_handle.readlines():
163-
if line.startswith('.. testcode:'):
168+
if line.startswith(".. testcode:"):
164169
found_test_code = True
165170
continue
166171
if found_test_code is True:
167-
if line.startswith(' '):
172+
if line.startswith(" "):
168173
continue
169174
else:
170175
empty_line = line.strip()
@@ -174,14 +179,14 @@ def filter_out_test_code(file_handle):
174179
found_test_code = False
175180
yield line
176181
else:
177-
for keyword in ['|version|', '|today|']:
182+
for keyword in ["|version|", "|today|"]:
178183
if keyword in line:
179184
break
180185
else:
181186
yield line
182187

183188

184-
if __name__ == '__main__':
189+
if __name__ == "__main__":
185190
setup(
186191
test_suite="tests",
187192
name=NAME,
@@ -195,7 +200,7 @@ def filter_out_test_code(file_handle):
195200
license=LICENSE,
196201
keywords=KEYWORDS,
197202
extras_require=EXTRAS_REQUIRE,
198-
tests_require=['nose'],
203+
tests_require=["nose"],
199204
install_requires=INSTALL_REQUIRES,
200205
packages=PACKAGES,
201206
include_package_data=True,

test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pip freeze
2-
nosetests --with-coverage --cover-package gease --cover-package tests tests --with-doctest --doctest-extension=.rst README.rst gease && flake8 . --exclude=.moban.d,docs --builtins=unicode,xrange,long
2+
nosetests --with-coverage --cover-package gease --cover-package tests tests --with-doctest --doctest-extension=.rst README.rst gease

tests/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
nose
2-
mock
32
codecov
43
coverage
54
flake8
5+
mock

0 commit comments

Comments
 (0)