Browse Source

Cosmetic (+ add test as an extra requirements)

pull/374/head
Florian Mounier 8 years ago
parent
commit
13c0d1a5ff
  1. 1
      perf.py
  2. 1
      pygal/__init__.py
  3. 2
      pygal/_compat.py
  4. 1
      pygal/etree.py
  5. 1
      pygal/formatters.py
  6. 1
      pygal/interpolate.py
  7. 1
      pygal/util.py
  8. 13
      setup.py

1
perf.py

@ -40,6 +40,7 @@ def perf(chart_name, length, series):
chart.add('s %d' % i, adapt(chart, rands[:length]))
return chart
if '--bench' in sys.argv:
bench = True

1
pygal/__init__.py

@ -106,4 +106,5 @@ class PluginImportFixer(object):
sys.modules[name] = getattr(maps, name.split('.')[2])
return sys.modules[name]
sys.meta_path += [PluginImportFixer()]

2
pygal/_compat.py

@ -69,6 +69,7 @@ def u(s):
return s.decode('utf-8')
return s
try:
from datetime import timezone
utc = timezone.utc
@ -96,6 +97,7 @@ def timestamp(x):
else:
return (x - datetime(1970, 1, 1, tzinfo=utc)).total_seconds()
try:
from urllib import quote_plus
except ImportError:

1
pygal/etree.py

@ -61,4 +61,5 @@ class Etree(object):
self._etree = self._py_etree
self.lxml = False
etree = Etree()

1
pygal/formatters.py

@ -101,6 +101,7 @@ class Default(Significant, IsoDateTime, Raw):
return IsoDateTime.__call__(self, val)
return Raw.__call__(self, val)
# Formatters with default options
human_readable = HumanReadable()
significant = Significant()

1
pygal/interpolate.py

@ -230,6 +230,7 @@ def trigonometric_interpolate(x, y, precision=250, **kwargs):
s += y[k] * p
yield X, s
INTERPOLATIONS = {
'quadratic': quadratic_interpolate,
'cubic': cubic_interpolate,

1
pygal/util.py

@ -275,6 +275,7 @@ class cached_property(object):
obj.__dict__[self.__name__] = self.getter(obj)
return value
css_comments = re.compile(r'/\*.*?\*/', re.MULTILINE | re.DOTALL)

13
setup.py

@ -40,6 +40,12 @@ class PyTest(TestCommand):
ROOT = os.path.dirname(__file__)
tests_requirements = [
"pyquery", "flask", "cairosvg",
'pytest-runner', 'pytest-cov', 'pytest-flake8', 'pytest-isort',
'pytest'
]
# Explicitly specify the encoding of pygal/__init__.py if we're on py3.
kwargs = {}
if sys.version_info[0] == 3:
@ -62,13 +68,14 @@ setup(
scripts=["pygal_gen.py"],
keywords=[
"svg", "chart", "graph", "diagram", "plot", "histogram", "kiviat"],
tests_require=["pytest", "pyquery", "flask", "cairosvg"],
setup_requires=['pytest-runner'],
test_requires=tests_requirements,
cmdclass={'test': PyTest},
package_data={'pygal': ['css/*', 'graph/maps/*.svg']},
extras_require={
'lxml': ['lxml'],
'png': ['cairosvg']
'png': ['cairosvg'],
'test': tests_requirements
},
classifiers=[
"Development Status :: 4 - Beta",

Loading…
Cancel
Save