Skip to content

Commit 31b3c08

Browse files
authored
Merge pull request #1 from pyecharts/v002
Update: ready to release version 0.0.2
2 parents 5c25cac + 407db65 commit 31b3c08

File tree

14 files changed

+100
-222
lines changed

14 files changed

+100
-222
lines changed

.gitignore

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -261,25 +261,8 @@ tags
261261
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
262262
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
263263

264-
# User-specific stuff
265-
.idea/**/workspace.xml
266-
.idea/**/tasks.xml
267-
.idea/**/usage.statistics.xml
268-
.idea/**/dictionaries
269-
.idea/**/shelf
270-
271-
# Sensitive or high-churn files
272-
.idea/**/dataSources/
273-
.idea/**/dataSources.ids
274-
.idea/**/dataSources.local.xml
275-
.idea/**/sqlDataSources.xml
276-
.idea/**/dynamic.xml
277-
.idea/**/uiDesigner.xml
278-
.idea/**/dbnavigator.xml
279-
280-
# Gradle
281-
.idea/**/gradle.xml
282-
.idea/**/libraries
264+
# IDE
265+
.idea/
283266

284267
# CMake
285268
cmake-build-*/

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@ language: python
44
notifications:
55
email: false
66
python:
7-
- &pypy2 pypy2.7-6.0
8-
- &pypy3 pypy3.5-6.0
97
- 3.8-dev
108
- 3.7
119
- 3.6
1210
- 3.5
13-
- 2.7
1411
before_install:
15-
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install flake8==2.6.2; fi
1612
- if [[ -f min_requirements.txt && "$MINREQ" -eq 1 ]]; then
1713
mv min_requirements.txt requirements.txt ;
1814
fi

CHANGELOG.rst

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

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@ all: test
22

33
test:
44
bash test.sh
5-
6-
document:
7-
bash document.sh

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ name = 'pypi'
77
python_version= '3.6'
88

99
[packages]
10+
selenium = "*"
1011

1112
[dev-packages]
1213
nose = "*"

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# snapshot-selenium
2+
3+
![http://travis-ci.org/pyecharts/snapshot-selenium](https://api.travis-ci.org/pyecharts/snapshot-selenium.svg) ![https://codecov.io/github/pyecharts/snapshot-selenium](https://codecov.io/github/pyecharts/snapshot-selenium/coverage.png)
4+
5+
## Installation
6+
7+
You can install snapshot-selenium via pip:
8+
9+
```bash
10+
$ pip install snapshot-selenium
11+
```
12+
13+
or clone it and install it:
14+
15+
```bash
16+
$ git clone https://github.com/pyecharts/snapshot-selenium.git
17+
$ cd snapshot-selenium
18+
$ pip install -r requirements.txt
19+
$ python setup.py install
20+
```

README.rst

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

docs/source/conf.py

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

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
selenium

setup.py

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

3-
# Template by pypi-mobans
4-
import os
5-
import sys
63
import codecs
74
import locale
5+
6+
# Template by pypi-mobans
7+
import os
88
import platform
9+
import sys
910
from shutil import rmtree
1011

11-
from setuptools import Command, setup, find_packages
12-
13-
PY2 = sys.version_info[0] == 2
14-
PY26 = PY2 and sys.version_info[1] < 7
15-
PY33 = sys.version_info < (3, 4)
12+
from setuptools import Command, find_packages, setup
1613

1714
# Work around mbcs bug in distutils.
1815
# http://bugs.python.org/issue10945
@@ -22,67 +19,57 @@
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')
29-
30-
NAME = 'snapshot-selenium'
31-
AUTHOR = 'C.W.'
32-
VERSION = '0.0.1'
33-
34-
LICENSE = 'MIT'
35-
DESCRIPTION = (
36-
'Render echarts using selenium'
37-
)
38-
URL = 'https://github.com/pyecharts/snapshot-selenium'
39-
DOWNLOAD_URL = '%s/archive/0.0.1.tar.gz' % URL
40-
FILES = ['README.rst', 'CHANGELOG.rst']
41-
KEYWORDS = [
42-
'python',
43-
]
25+
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
26+
27+
NAME = "snapshot-selenium"
28+
AUTHOR = "pyecharts dev team"
29+
VERSION = "0.0.1"
30+
31+
LICENSE = "MIT"
32+
DESCRIPTION = "Render echarts using selenium"
33+
URL = "https://github.com/pyecharts/snapshot-selenium"
34+
DOWNLOAD_URL = "%s/archive/0.0.1.tar.gz" % URL
35+
FILES = ["README.md"]
36+
4437

4538
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',
39+
"Topic :: Software Development :: Libraries",
40+
"Programming Language :: Python",
41+
"Intended Audience :: Developers",
42+
"Programming Language :: Python :: 3.5",
43+
"Programming Language :: Python :: 3.6",
44+
"Programming Language :: Python :: 3.7",
5545
]
5646

57-
INSTALL_REQUIRES = [
58-
]
47+
INSTALL_REQUIRES = ["selenium"]
5948
SETUP_COMMANDS = {}
6049

6150

62-
PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
51+
PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"])
6352
EXTRAS_REQUIRE = {}
6453
# 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-selenium v0.0.1 ' +
68-
"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.')
71-
UPLOAD_FAILED_MSG = (
72-
'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND)
54+
PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable)
55+
GS_COMMAND = "gs snapshot-selenium v0.0.1 " + "Find 0.0.1 in changelog for more details"
56+
NO_GS_MESSAGE = (
57+
"Automatic github release is disabled. " + "Please install gease to enable it."
58+
)
59+
UPLOAD_FAILED_MSG = 'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND
7360
HERE = os.path.abspath(os.path.dirname(__file__))
7461

7562

7663
class PublishCommand(Command):
7764
"""Support setup.py upload."""
7865

79-
description = 'Build and publish the package on github and pypi'
66+
description = "Build and publish the package on github and pypi"
8067
user_options = []
8168

8269
@staticmethod
8370
def status(s):
8471
"""Prints things in bold."""
85-
print('\033[1m{0}\033[0m'.format(s))
72+
print("\033[1m{0}\033[0m".format(s))
8673

8774
def initialize_options(self):
8875
pass
@@ -92,14 +79,14 @@ def finalize_options(self):
9279

9380
def run(self):
9481
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_selenium.egg-info'))
82+
self.status("Removing previous builds...")
83+
rmtree(os.path.join(HERE, "dist"))
84+
rmtree(os.path.join(HERE, "build"))
85+
rmtree(os.path.join(HERE, "snapshot_selenium.egg-info"))
9986
except OSError:
10087
pass
10188

102-
self.status('Building Source and Wheel (universal) distribution...')
89+
self.status("Building Source and Wheel (universal) distribution...")
10390
run_status = True
10491
if has_gease():
10592
run_status = os.system(GS_COMMAND) == 0
@@ -112,9 +99,7 @@ def run(self):
11299
sys.exit()
113100

114101

115-
SETUP_COMMANDS.update({
116-
'publish': PublishCommand
117-
})
102+
SETUP_COMMANDS.update({"publish": PublishCommand})
118103

119104

120105
def has_gease():
@@ -125,6 +110,7 @@ def has_gease():
125110
"""
126111
try:
127112
import gease # noqa
113+
128114
return True
129115
except ImportError:
130116
return False
@@ -142,7 +128,7 @@ def read_files(*files):
142128
def read(afile):
143129
"""Read a file into setup"""
144130
the_relative_file = os.path.join(HERE, afile)
145-
with codecs.open(the_relative_file, 'r', 'utf-8') as opened_file:
131+
with codecs.open(the_relative_file, "r", "utf-8") as opened_file:
146132
content = filter_out_test_code(opened_file)
147133
content = "".join(list(content))
148134
return content
@@ -151,11 +137,11 @@ def read(afile):
151137
def filter_out_test_code(file_handle):
152138
found_test_code = False
153139
for line in file_handle.readlines():
154-
if line.startswith('.. testcode:'):
140+
if line.startswith(".. testcode:"):
155141
found_test_code = True
156142
continue
157143
if found_test_code is True:
158-
if line.startswith(' '):
144+
if line.startswith(" "):
159145
continue
160146
else:
161147
empty_line = line.strip()
@@ -165,14 +151,14 @@ def filter_out_test_code(file_handle):
165151
found_test_code = False
166152
yield line
167153
else:
168-
for keyword in ['|version|', '|today|']:
154+
for keyword in ["|version|", "|today|"]:
169155
if keyword in line:
170156
break
171157
else:
172158
yield line
173159

174160

175-
if __name__ == '__main__':
161+
if __name__ == "__main__":
176162
setup(
177163
test_suite="tests",
178164
name=NAME,
@@ -184,13 +170,12 @@ def filter_out_test_code(file_handle):
184170
download_url=DOWNLOAD_URL,
185171
long_description=read_files(*FILES),
186172
license=LICENSE,
187-
keywords=KEYWORDS,
188173
extras_require=EXTRAS_REQUIRE,
189-
tests_require=['nose'],
174+
tests_require=["nose"],
190175
install_requires=INSTALL_REQUIRES,
191176
packages=PACKAGES,
192177
include_package_data=True,
193178
zip_safe=False,
194179
classifiers=CLASSIFIERS,
195-
cmdclass=SETUP_COMMANDS
180+
cmdclass=SETUP_COMMANDS,
196181
)

0 commit comments

Comments
 (0)