Skip to content

Commit

Permalink
Remove test from setup.py, unify test requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Jul 29, 2024
1 parent 49137c3 commit 1bbe637
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
33 changes: 11 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,24 @@
# You should have received a copy of the GNU Lesser General Public License
# along with pygal. If not, see <http://www.gnu.org/licenses/>.
import os
import sys

from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand


class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['-x', 'build/lib/pygal']
self.test_suite = True

def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)


ROOT = os.path.dirname(__file__)


tests_requirements = [
"pyquery", "flask", 'cairosvg', 'lxml', 'pygal_maps_world', 'pygal_maps_fr',
'pygal_maps_ch', 'coveralls',
'ruff',
'pytest-runner', 'pytest-cov',
'pytest'
"cairosvg",
"coveralls",
"flask",
"lxml",
"pygal_maps_ch",
"pygal_maps_fr",
"pygal_maps_world",
"pyquery",
"pytest"
"pytest-cov",
"ruff",
]

about = {}
Expand All @@ -72,7 +62,6 @@ def run_tests(self):
"svg", "chart", "graph", "diagram", "plot", "histogram", "kiviat"],
setup_requires=['pytest-runner'],
install_requires=['importlib-metadata'], # TODO: remove this (see #545, #546)
cmdclass={'test': PyTest},
package_data={'pygal': ['css/*', 'graph/maps/*.svg']},
extras_require={
'lxml': ['lxml'],
Expand Down
8 changes: 1 addition & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
envlist = py38,py39,py310,py311,py312,pypy

[testenv]
deps =
pytest
coverage
lxml
pyquery
cairosvg

extras = test
setenv =
COVERAGE_FILE=.cov-{envname}
commands =
Expand Down

0 comments on commit 1bbe637

Please sign in to comment.