Skip to content

Commit 139a3f5

Browse files
committed
🤝 synchronize with pyecharts-mobans
1 parent 921efa5 commit 139a3f5

File tree

13 files changed

+221
-387
lines changed

13 files changed

+221
-387
lines changed

.gitignore

Lines changed: 75 additions & 310 deletions
Large diffs are not rendered by default.

.moban.d/custom_setup.py.jj2

Lines changed: 0 additions & 1 deletion
This file was deleted.

.moban.d/tests/custom_requirements.txt.jj2

Lines changed: 0 additions & 4 deletions
This file was deleted.

.moban.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
requires:
2-
- pypi-mobans-pkg==0.0.4
2+
- type: git
3+
url: https://github.com/moremoban/pypi-mobans
4+
submodule: true
5+
- type: git
6+
url: https://github.com/pyecharts/pyecharts-mobans
37
configuration:
8+
configuration_dir: "pyecharts-mobans:config"
49
template_dir:
5-
- "pypi-mobans-pkg:templates"
10+
- "pyecharts-mobans:templates"
11+
- "pypi-mobans:templates"
612
- ".moban.d"
713
configuration: snapshot-phantomjs.yml
814
targets:
915
- README.rst: CUSTOM_README.rst.jj2
10-
- setup.py: custom_setup.py.jj2
16+
- setup.py: pyecharts_setup.py.jj2
1117
- requirements.txt: requirements.txt.jj2
12-
- "tests/requirements.txt": "tests/custom_requirements.txt.jj2"
13-
- "docs/source/conf.py": "docs/conf.py_t"
18+
- "tests/requirements.txt": "tests/pyecharts_requirements.txt.jj2"
1419
- test.sh: test.script.jj2
1520
- "snapshot_phantomjs/_version.py": "_version.py.jj2"
16-
- .gitignore: gitignore.jj2
17-
- .travis.yml: travis.yml.jj2
18-
- Pipfile: Pipfile.jj2
21+
- .gitignore: pyecharts_gitignore.jj2
22+
- .travis.yml: pyecharts_travis.yml.jj2
23+
- Pipfile: Pipfile.jj2
24+
- output: CHANGELOG.rst
25+
template: CHANGELOG.rst.jj2
26+
- lint.sh: lint.script.jj2

.travis.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,42 @@
1+
12
sudo: false
23
dist: xenial
34
language: python
45
notifications:
56
email: false
67
python:
7-
- &pypy2 pypy2.7-6.0
8-
- &pypy3 pypy3.5-6.0
98
- 3.8-dev
109
- 3.7
1110
- 3.6
1211
- 3.5
13-
- 2.7
12+
13+
stages:
14+
- test
15+
- lint
16+
17+
.disable_global: &disable_global
18+
before_install: false
19+
install: true
20+
before_script: false
21+
after_success: false
22+
after_failure: false
23+
24+
.lint: &lint
25+
<<: *disable_global
26+
python: 3.6
27+
stage: lint
28+
install: pip install flake8
29+
script: flake8
30+
31+
jobs:
32+
include:
33+
- *lint
34+
35+
stage: test
36+
37+
script: make test
38+
1439
before_install:
15-
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install flake8==2.6.2; fi
1640
- if [[ -f min_requirements.txt && "$MINREQ" -eq 1 ]]; then
1741
mv min_requirements.txt requirements.txt ;
1842
fi

CHANGELOG.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
Change log
2-
===========
2+
================================================================================
3+
4+
0.0.2 - 01.04.2019
5+
--------------------------------------------------------------------------------
6+
7+
update
8+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9+
10+
#. proper releases
11+
12+
0.0.1 - 09.04.2019
13+
--------------------------------------------------------------------------------
14+
15+
first release
16+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17+
18+
#. use selenium driver for rendering pyecharts output as image

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,12 @@ all: test
33
test:
44
bash test.sh
55

6-
document:
7-
bash document.sh
6+
format:
7+
isort -rc .
8+
black -l 79 snapshot_selenium
9+
black -l 79 setup.py
10+
black -l 79 tests
11+
12+
13+
lint:
14+
make lint

lint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flake8 . --exclude=.moban.d,docs --builtins=unicode,xrange,long

setup.py

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
#!/usr/bin/env python3
22

33
# Template by pypi-mobans
4-
import os
5-
import sys
64
import codecs
75
import locale
6+
import os
87
import platform
8+
import sys
99
from shutil import rmtree
1010

11-
from setuptools import Command, setup, find_packages
11+
from setuptools import Command, find_packages, setup
1212

13-
PY2 = sys.version_info[0] == 2
14-
PY26 = PY2 and sys.version_info[1] < 7
15-
PY33 = sys.version_info < (3, 4)
1613

1714
# Work around mbcs bug in distutils.
1815
# http://bugs.python.org/issue10945
@@ -22,52 +19,58 @@
2219
try:
2320
lc = locale.getlocale()
2421
pf = platform.system()
25-
if pf != 'Windows' and lc == (None, None):
26-
locale.setlocale(locale.LC_ALL, 'C.UTF-8')
22+
if pf != "Windows" and lc == (None, None):
23+
locale.setlocale(locale.LC_ALL, "C.UTF-8")
2724
except (ValueError, UnicodeError, locale.Error):
28-
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
25+
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
2926

30-
NAME = 'snapshot-phantomjs'
31-
AUTHOR = 'C.W.'
32-
VERSION = '0.0.1'
33-
34-
LICENSE = 'MIT'
27+
NAME = "snapshot-phantomjs"
28+
AUTHOR = "pyecharts dev team"
29+
VERSION = "0.0.2"
30+
31+
LICENSE = "MIT"
3532
DESCRIPTION = (
36-
'Render pyecharts as image via phantomjs'
33+
"Render pyecharts as image via phantomjs"
3734
)
38-
URL = 'https://github.com/pyecharts/snapshot-phantomjs'
39-
DOWNLOAD_URL = '%s/archive/0.0.1.tar.gz' % URL
40-
FILES = ['README.rst', 'CHANGELOG.rst']
35+
URL = "https://github.com/pyecharts/snapshot-phantomjs"
36+
DOWNLOAD_URL = "%s/archive/0.0.1.tar.gz" % URL
37+
FILES = ["README.rst", "CHANGELOG.rst"]
4138
KEYWORDS = [
42-
'python',
39+
"python",
40+
"pyecharts",
41+
"chart",
4342
]
4443

4544
CLASSIFIERS = [
46-
'Topic :: Software Development :: Libraries',
47-
'Programming Language :: Python',
48-
'Intended Audience :: Developers',
49-
'Programming Language :: Python :: 2.6',
50-
'Programming Language :: Python :: 2.7',
51-
'Programming Language :: Python :: 3.3',
52-
'Programming Language :: Python :: 3.4',
53-
'Programming Language :: Python :: 3.5',
54-
'Programming Language :: Python :: 3.6',
45+
"Topic :: Software Development :: Libraries",
46+
"Programming Language :: Python",
47+
"Intended Audience :: Developers",
48+
49+
"Programming Language :: Python :: 3 :: Only",
50+
51+
52+
"Programming Language :: Python :: 3.5",
53+
"Programming Language :: Python :: 3.6",
54+
55+
"Programming Language :: Python :: 3.7",
56+
57+
"Programming Language :: Python :: 3.8",
58+
5559
]
5660

5761
INSTALL_REQUIRES = [
5862
]
5963
SETUP_COMMANDS = {}
6064

6165

62-
PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
66+
PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"])
6367
EXTRAS_REQUIRE = {}
6468
# You do not need to read beyond this line
65-
PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format(
66-
sys.executable)
67-
GS_COMMAND = ('gs snapshot-phantomjs v0.0.1 ' +
69+
PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable)
70+
GS_COMMAND = ("gs snapshot-phantomjs v0.0.1 " +
6871
"Find 0.0.1 in changelog for more details")
69-
NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
70-
'Please install gease to enable it.')
72+
NO_GS_MESSAGE = ("Automatic github release is disabled. " +
73+
"Please install gease to enable it.")
7174
UPLOAD_FAILED_MSG = (
7275
'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND)
7376
HERE = os.path.abspath(os.path.dirname(__file__))
@@ -76,13 +79,13 @@
7679
class PublishCommand(Command):
7780
"""Support setup.py upload."""
7881

79-
description = 'Build and publish the package on github and pypi'
82+
description = "Build and publish the package on github and pypi"
8083
user_options = []
8184

8285
@staticmethod
8386
def status(s):
8487
"""Prints things in bold."""
85-
print('\033[1m{0}\033[0m'.format(s))
88+
print("\033[1m{0}\033[0m".format(s))
8689

8790
def initialize_options(self):
8891
pass
@@ -92,14 +95,14 @@ def finalize_options(self):
9295

9396
def run(self):
9497
try:
95-
self.status('Removing previous builds...')
96-
rmtree(os.path.join(HERE, 'dist'))
97-
rmtree(os.path.join(HERE, 'build'))
98-
rmtree(os.path.join(HERE, 'snapshot_phantomjs.egg-info'))
98+
self.status("Removing previous builds...")
99+
rmtree(os.path.join(HERE, "dist"))
100+
rmtree(os.path.join(HERE, "build"))
101+
rmtree(os.path.join(HERE, "snapshot_phantomjs.egg-info"))
99102
except OSError:
100103
pass
101104

102-
self.status('Building Source and Wheel (universal) distribution...')
105+
self.status("Building Source and Wheel (universal) distribution...")
103106
run_status = True
104107
if has_gease():
105108
run_status = os.system(GS_COMMAND) == 0
@@ -113,7 +116,7 @@ def run(self):
113116

114117

115118
SETUP_COMMANDS.update({
116-
'publish': PublishCommand
119+
"publish": PublishCommand
117120
})
118121

119122

@@ -142,7 +145,7 @@ def read_files(*files):
142145
def read(afile):
143146
"""Read a file into setup"""
144147
the_relative_file = os.path.join(HERE, afile)
145-
with codecs.open(the_relative_file, 'r', 'utf-8') as opened_file:
148+
with codecs.open(the_relative_file, "r", "utf-8") as opened_file:
146149
content = filter_out_test_code(opened_file)
147150
content = "".join(list(content))
148151
return content
@@ -151,11 +154,11 @@ def read(afile):
151154
def filter_out_test_code(file_handle):
152155
found_test_code = False
153156
for line in file_handle.readlines():
154-
if line.startswith('.. testcode:'):
157+
if line.startswith(".. testcode:"):
155158
found_test_code = True
156159
continue
157160
if found_test_code is True:
158-
if line.startswith(' '):
161+
if line.startswith(" "):
159162
continue
160163
else:
161164
empty_line = line.strip()
@@ -165,14 +168,14 @@ def filter_out_test_code(file_handle):
165168
found_test_code = False
166169
yield line
167170
else:
168-
for keyword in ['|version|', '|today|']:
171+
for keyword in ["|version|", "|today|"]:
169172
if keyword in line:
170173
break
171174
else:
172175
yield line
173176

174177

175-
if __name__ == '__main__':
178+
if __name__ == "__main__":
176179
setup(
177180
test_suite="tests",
178181
name=NAME,
@@ -186,7 +189,7 @@ def filter_out_test_code(file_handle):
186189
license=LICENSE,
187190
keywords=KEYWORDS,
188191
extras_require=EXTRAS_REQUIRE,
189-
tests_require=['nose'],
192+
tests_require=["nose"],
190193
install_requires=INSTALL_REQUIRES,
191194
packages=PACKAGES,
192195
include_package_data=True,

snapshot-phantomjs.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1+
overrides: pyecharts.yml
12
name: "snapshot-phantomjs"
2-
organisation: "pyecharts"
3-
author: "C.W."
4-
5-
company: "pyecharts dev team"
6-
version: "0.0.1"
7-
current_version: "0.0.1"
3+
version: "0.0.2"
4+
current_version: "0.0.2"
85
release: "0.0.1"
96
copyright_year: 2019
107
license: MIT
8+
nodocs: true
9+
min_python_version: "3.5"
1110
dependencies: []
1211
description: "Render pyecharts as image via phantomjs"
12+
releases:
13+
- changes:
14+
- action: update
15+
details:
16+
- proper releases
17+
version: 0.0.2
18+
date: 01.04.2019
19+
- changes:
20+
- action: first release
21+
details:
22+
- use selenium driver for rendering pyecharts output as image
23+
version: 0.0.1
24+
date: 09.04.2019

snapshot_phantomjs/_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.0.1"
2-
__author__ = "C.W."
1+
__version__ = "0.0.2"
2+
__author__ = "pyecharts dev team"

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
pip freeze
2-
nosetests --with-coverage --cover-package snapshot_phantomjs --cover-package tests tests docs/source snapshot_phantomjs && flake8 . --exclude=.moban.d,docs --builtins=unicode,xrange,long
2+
nosetests --with-coverage --cover-package snapshot_phantomjs --cover-package tests tests snapshot_phantomjs

tests/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ mock
33
codecov
44
coverage
55
flake8
6+
moban
7+
black;python_version>="3.6"
8+
isort;python_version>="3.6"

0 commit comments

Comments
 (0)