summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2020-01-25 21:29:50 -0500
committerJulian Berman <Julian@GrayVines.com>2020-01-25 21:33:30 -0500
commit9cc0712e302cdbbbd36c2f57791c8a714b7646a8 (patch)
tree0fcd6392970caa00510f5d1acc4d474e18e02113
parentd4ec33ddf2094255fcdf7292f999662162616002 (diff)
downloadjsonschema-9cc0712e302cdbbbd36c2f57791c8a714b7646a8.tar.gz
Test directly with pip show.
Also move it into the regular test suite.
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--.gitignore1
-rw-r--r--COPYING (renamed from LICENSE)0
-rw-r--r--jsonschema/tests/test_cli.py7
-rw-r--r--setup.cfg3
-rw-r--r--test_license.py22
-rw-r--r--tox.ini9
7 files changed, 8 insertions, 36 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 64cdf06..84df994 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -75,8 +75,6 @@ jobs:
toxenv: py38-tests
- name: 3.8
toxenv: py38-tests_nongpl
- - name: 3.8
- toxenv: check-package-license-file
exclude:
# Building on Windows isn't supported, and 3.5/PyPy on Windows
# seem to fail with silent obscure errors.
diff --git a/.gitignore b/.gitignore
index f82e1f9..31236db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,3 @@ _static
_templates
TODO
-license_report.json
diff --git a/LICENSE b/COPYING
index af9cfbd..af9cfbd 100644
--- a/LICENSE
+++ b/COPYING
diff --git a/jsonschema/tests/test_cli.py b/jsonschema/tests/test_cli.py
index ed3b5c1..6cb999f 100644
--- a/jsonschema/tests/test_cli.py
+++ b/jsonschema/tests/test_cli.py
@@ -142,6 +142,13 @@ class TestCLI(TestCase):
self.assertEqual(stderr.getvalue(), "1 - 9\t1 - 8\t2 - 7\t")
self.assertEqual(exit_code, 1)
+ def test_license(self):
+ output = subprocess.check_output(
+ [sys.executable, "-m", "pip", "show", "jsonschema"],
+ stderr=subprocess.STDOUT,
+ )
+ self.assertIn("License: MIT\n", output)
+
def test_version(self):
version = subprocess.check_output(
[sys.executable, "-m", "jsonschema", "--version"],
diff --git a/setup.cfg b/setup.cfg
index 6f41562..c99d5b0 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -8,8 +8,7 @@ long_description = file: README.rst
long_description_content_type = text/x-rst
author = Julian Berman
author_email = Julian@GrayVines.com
-license_files =
- LICENSE
+license = MIT
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
diff --git a/test_license.py b/test_license.py
deleted file mode 100644
index fd1f427..0000000
--- a/test_license.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env python3
-
-"""Test that this package's license file is properly detected by pip-licenses.
-
-This file assumes that pip-licenses has already been run (in a tox env) and
-generated license_report.json.
-"""
-
-import json
-from pathlib import Path
-
-
-def main():
- packages = json.loads(
- (Path(__file__).resolve().parent / 'license_report.json').read_text())
- for package in packages:
- if package['Name'] == 'jsonschema':
- assert package['LicenseFile'] != 'UNKNOWN'
-
-
-if __name__ == '__main__':
- main()
diff --git a/tox.ini b/tox.ini
index bc73b43..19cfa8d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -128,12 +128,3 @@ commands =
{envpython} -m coverage run --rcfile={toxinidir}/.coveragerc -m twisted.trial jsonschema
{envpython} -m coverage xml -o {envtmpdir}/coverage.xml
codecov --required --disable gcov --file {envtmpdir}/coverage.xml
-
-[testenv:check-package-license-file]
-recreate = True
-deps =
- pip-licenses
-commands =
- pip install {toxinidir}
- pip-licenses --from=mixed --with-license-file --format=json --output-file={toxinidir}/license_report.json
- {envpython} {toxinidir}/test_license.py