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])) chart.add('s %d' % i, adapt(chart, rands[:length]))
return chart return chart
if '--bench' in sys.argv: if '--bench' in sys.argv:
bench = True bench = True

1
pygal/__init__.py

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

2
pygal/_compat.py

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

1
pygal/etree.py

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

1
pygal/formatters.py

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

1
pygal/interpolate.py

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

1
pygal/util.py

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

13
setup.py

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

Loading…
Cancel
Save