Skip to content

Commit

Permalink
Merge pull request #1 from pyecharts/v002
Browse files Browse the repository at this point in the history
Update: ready to release version 0.0.2
  • Loading branch information
chfw authored Apr 10, 2019
2 parents 5c25cac + 407db65 commit 31b3c08
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 222 deletions.
21 changes: 2 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -261,25 +261,8 @@ tags
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# IDE
.idea/

# CMake
cmake-build-*/
Expand Down
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ language: python
notifications:
email: false
python:
- &pypy2 pypy2.7-6.0
- &pypy3 pypy3.5-6.0
- 3.8-dev
- 3.7
- 3.6
- 3.5
- 2.7
before_install:
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install flake8==2.6.2; fi
- if [[ -f min_requirements.txt && "$MINREQ" -eq 1 ]]; then
mv min_requirements.txt requirements.txt ;
fi
Expand Down
2 changes: 0 additions & 2 deletions CHANGELOG.rst

This file was deleted.

3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@ all: test

test:
bash test.sh

document:
bash document.sh
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name = 'pypi'
python_version= '3.6'

[packages]
selenium = "*"

[dev-packages]
nose = "*"
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# snapshot-selenium

![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)

## Installation

You can install snapshot-selenium via pip:

```bash
$ pip install snapshot-selenium
```

or clone it and install it:

```bash
$ git clone https://github.com/pyecharts/snapshot-selenium.git
$ cd snapshot-selenium
$ pip install -r requirements.txt
$ python setup.py install
```
33 changes: 0 additions & 33 deletions README.rst

This file was deleted.

62 changes: 0 additions & 62 deletions docs/source/conf.py

This file was deleted.

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
selenium
113 changes: 49 additions & 64 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#!/usr/bin/env python3

# Template by pypi-mobans
import os
import sys
import codecs
import locale

# Template by pypi-mobans
import os
import platform
import sys
from shutil import rmtree

from setuptools import Command, setup, find_packages

PY2 = sys.version_info[0] == 2
PY26 = PY2 and sys.version_info[1] < 7
PY33 = sys.version_info < (3, 4)
from setuptools import Command, find_packages, setup

# Work around mbcs bug in distutils.
# http://bugs.python.org/issue10945
Expand All @@ -22,67 +19,57 @@
try:
lc = locale.getlocale()
pf = platform.system()
if pf != 'Windows' and lc == (None, None):
locale.setlocale(locale.LC_ALL, 'C.UTF-8')
if pf != "Windows" and lc == (None, None):
locale.setlocale(locale.LC_ALL, "C.UTF-8")
except (ValueError, UnicodeError, locale.Error):
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')

NAME = 'snapshot-selenium'
AUTHOR = 'C.W.'
VERSION = '0.0.1'
EMAIL = 'info@pyecharts.com'
LICENSE = 'MIT'
DESCRIPTION = (
'Render echarts using selenium'
)
URL = 'https://github.com/pyecharts/snapshot-selenium'
DOWNLOAD_URL = '%s/archive/0.0.1.tar.gz' % URL
FILES = ['README.rst', 'CHANGELOG.rst']
KEYWORDS = [
'python',
]
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")

NAME = "snapshot-selenium"
AUTHOR = "pyecharts dev team"
VERSION = "0.0.1"
EMAIL = "info@pyecharts.com"
LICENSE = "MIT"
DESCRIPTION = "Render echarts using selenium"
URL = "https://github.com/pyecharts/snapshot-selenium"
DOWNLOAD_URL = "%s/archive/0.0.1.tar.gz" % URL
FILES = ["README.md"]


CLASSIFIERS = [
'Topic :: Software Development :: Libraries',
'Programming Language :: Python',
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
"Topic :: Software Development :: Libraries",
"Programming Language :: Python",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
]

INSTALL_REQUIRES = [
]
INSTALL_REQUIRES = ["selenium"]
SETUP_COMMANDS = {}


PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
PACKAGES = find_packages(exclude=["ez_setup", "examples", "tests"])
EXTRAS_REQUIRE = {}
# You do not need to read beyond this line
PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format(
sys.executable)
GS_COMMAND = ('gs snapshot-selenium v0.0.1 ' +
"Find 0.0.1 in changelog for more details")
NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
'Please install gease to enable it.')
UPLOAD_FAILED_MSG = (
'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND)
PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable)
GS_COMMAND = "gs snapshot-selenium v0.0.1 " + "Find 0.0.1 in changelog for more details"
NO_GS_MESSAGE = (
"Automatic github release is disabled. " + "Please install gease to enable it."
)
UPLOAD_FAILED_MSG = 'Upload failed. please run "%s" yourself.' % PUBLISH_COMMAND
HERE = os.path.abspath(os.path.dirname(__file__))


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

description = 'Build and publish the package on github and pypi'
description = "Build and publish the package on github and pypi"
user_options = []

@staticmethod
def status(s):
"""Prints things in bold."""
print('\033[1m{0}\033[0m'.format(s))
print("\033[1m{0}\033[0m".format(s))

def initialize_options(self):
pass
Expand All @@ -92,14 +79,14 @@ def finalize_options(self):

def run(self):
try:
self.status('Removing previous builds...')
rmtree(os.path.join(HERE, 'dist'))
rmtree(os.path.join(HERE, 'build'))
rmtree(os.path.join(HERE, 'snapshot_selenium.egg-info'))
self.status("Removing previous builds...")
rmtree(os.path.join(HERE, "dist"))
rmtree(os.path.join(HERE, "build"))
rmtree(os.path.join(HERE, "snapshot_selenium.egg-info"))
except OSError:
pass

self.status('Building Source and Wheel (universal) distribution...')
self.status("Building Source and Wheel (universal) distribution...")
run_status = True
if has_gease():
run_status = os.system(GS_COMMAND) == 0
Expand All @@ -112,9 +99,7 @@ def run(self):
sys.exit()


SETUP_COMMANDS.update({
'publish': PublishCommand
})
SETUP_COMMANDS.update({"publish": PublishCommand})


def has_gease():
Expand All @@ -125,6 +110,7 @@ def has_gease():
"""
try:
import gease # noqa

return True
except ImportError:
return False
Expand All @@ -142,7 +128,7 @@ def read_files(*files):
def read(afile):
"""Read a file into setup"""
the_relative_file = os.path.join(HERE, afile)
with codecs.open(the_relative_file, 'r', 'utf-8') as opened_file:
with codecs.open(the_relative_file, "r", "utf-8") as opened_file:
content = filter_out_test_code(opened_file)
content = "".join(list(content))
return content
Expand All @@ -151,11 +137,11 @@ def read(afile):
def filter_out_test_code(file_handle):
found_test_code = False
for line in file_handle.readlines():
if line.startswith('.. testcode:'):
if line.startswith(".. testcode:"):
found_test_code = True
continue
if found_test_code is True:
if line.startswith(' '):
if line.startswith(" "):
continue
else:
empty_line = line.strip()
Expand All @@ -165,14 +151,14 @@ def filter_out_test_code(file_handle):
found_test_code = False
yield line
else:
for keyword in ['|version|', '|today|']:
for keyword in ["|version|", "|today|"]:
if keyword in line:
break
else:
yield line


if __name__ == '__main__':
if __name__ == "__main__":
setup(
test_suite="tests",
name=NAME,
Expand All @@ -184,13 +170,12 @@ def filter_out_test_code(file_handle):
download_url=DOWNLOAD_URL,
long_description=read_files(*FILES),
license=LICENSE,
keywords=KEYWORDS,
extras_require=EXTRAS_REQUIRE,
tests_require=['nose'],
tests_require=["nose"],
install_requires=INSTALL_REQUIRES,
packages=PACKAGES,
include_package_data=True,
zip_safe=False,
classifiers=CLASSIFIERS,
cmdclass=SETUP_COMMANDS
cmdclass=SETUP_COMMANDS,
)
Loading

0 comments on commit 31b3c08

Please sign in to comment.