diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index e2519a7..c11f67f 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -5,10 +5,10 @@ on: branches: - main tags: - - 'v*' - - '!*dev*' - - '!*pre*' - - '!*post*' + - "v*" + - "!*dev*" + - "!*pre*" + - "!*post*" pull_request: # Allow manual runs through the web UI workflow_dispatch: @@ -27,29 +27,29 @@ jobs: - inkscape envs: | # Test oldest NEP 29 configurations - - linux: py39-test-mpl33 - - macos: py39-test-mpl33 - - windows: py39-test-mpl33 - # Test oldest non-NEP 29 configurations - - linux: py36-test-mpl20 - runs-on: ubuntu-20.04 - - macos: py36-test-mpl20 - - windows: py36-test-mpl20 + - linux: py311-test-mpl37 + - macos: py311-test-mpl37 + - windows: py311-test-mpl37 # Test newest configurations - - linux: py312-test-mpl38 - - macos: py312-test-mpl38 - - windows: py312-test-mpl38 + # + # TODO: mpl310 gives different hashes on different operating systems + # when that's fixed, these should be bumped to mpl310 + # + - linux: py313-test-mpl39 + - macos: py313-test-mpl39 + - windows: py313-test-mpl39 # Test intermediate NEP 29 configurations on Linux - linux: py39-test-mpl38 + - linux: py310-test-mpl37 - linux: py310-test-mpl38 - - linux: py310-test-mpl35 - - linux: py311-test-mpl36 - linux: py311-test-mpl37 + - linux: py311-test-mpl39 + - linux: py312-test-mpl39 # Test different versions of pytest - linux: py312-test-mpldev-pytestdev - - linux: py39-test-mpl33-pytest62 - - linux: py38-test-mpl31-pytest54 - coverage: 'codecov' + - linux: py39-test-mpl39-pytest62 + - linux: py39-test-mpl37-pytest54 + coverage: "codecov" publish: if: github.event_name != 'pull_request' @@ -57,7 +57,5 @@ jobs: uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 with: test_command: pytest $GITHUB_WORKSPACE/tests; pytest --mpl $GITHUB_WORKSPACE/tests - # Remove python-version when python-dateutil >2.8.2 - python-version: "3.11" secrets: pypi_token: ${{ secrets.pypi_password }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 02fe0e9..a482151 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,6 +5,9 @@ build: tools: python: "3.11" +sphinx: + configuration: docs/conf.py + python: install: - method: pip diff --git a/docs/installing.rst b/docs/installing.rst index 9bd0279..c4ce2d0 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -4,7 +4,7 @@ Installation Guide ################## -This plugin is compatible with Python 3.6 and later, and +This plugin is compatible with Python 3.9 and later, and requires `pytest `__ and `matplotlib `__ to be installed. diff --git a/setup.cfg b/setup.cfg index a874af3..6e6dcb1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,10 +23,10 @@ long_description_content_type = text/x-rst zip_safe = True packages = find: include_package_data = True -python_requires = >=3.6 +python_requires = >=3.9 install_requires = pytest - matplotlib + matplotlib>=3.7 importlib_resources;python_version<'3.8' packaging Jinja2 @@ -41,9 +41,9 @@ test = pytest-cov docs = sphinx - mpl_sphinx_theme>=3.6.0.dev0 + mpl_sphinx_theme>=3.9.0 sphinx_design - matplotlib==3.6 + matplotlib==3.9.* [tool:pytest] testpaths = tests diff --git a/tests/baseline/hashes/mpl20_ft261.json b/tests/baseline/hashes/mpl20_ft261.json deleted file mode 100644 index 47c4eac..0000000 --- a/tests/baseline/hashes/mpl20_ft261.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "test_pytest_mpl.test_hash_succeeds": "480062c2239ed9d70e361d1a5b578dc2aa756971161ac6e7287b492ae6118c59", - "test.test_modified": "54f6cf83d5b06fa2ecb7fa23d6e87898679178ef5d0dfdd2551a139f1932127b", - "test.test_new": "54f6cf83d5b06fa2ecb7fa23d6e87898679178ef5d0dfdd2551a139f1932127b", - "test.test_unmodified": "54f6cf83d5b06fa2ecb7fa23d6e87898679178ef5d0dfdd2551a139f1932127b", - "test_formats.test_format_png": "480062c2239ed9d70e361d1a5b578dc2aa756971161ac6e7287b492ae6118c59" -} diff --git a/tests/baseline/hashes/mpl21_ft261.json b/tests/baseline/hashes/mpl21_ft261.json deleted file mode 100644 index 73286d5..0000000 --- a/tests/baseline/hashes/mpl21_ft261.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "test_pytest_mpl.test_hash_succeeds": "17b65dd0247b0dfd8c1b4b079352414ae0fe03c0a3e79d63c8b8670d84d4098f", - "test.test_modified": "14d326881467bc613e6504b87bd7d556a5e58668ff16b896fa3c15745cfb6336", - "test.test_new": "14d326881467bc613e6504b87bd7d556a5e58668ff16b896fa3c15745cfb6336", - "test.test_unmodified": "14d326881467bc613e6504b87bd7d556a5e58668ff16b896fa3c15745cfb6336", - "test_formats.test_format_eps": "f8a0fbb33dcd473ef5cfdd69317db6eb58d64a7f5f3b5072e0de69aa9e201224", - "test_formats.test_format_pdf": "82b2b58fc3a74591c85cdf2f06b2f72dfc154820fca98e7cfd5cb6904ed60b23", - "test_formats.test_format_png": "d577a3c8c7550413d8d50bc26a68f3e8d9c35d4763c52cbcc15df4f61c8406b2" -} diff --git a/tests/baseline/hashes/mpl22_ft261.json b/tests/baseline/hashes/mpl22_ft261.json deleted file mode 100644 index fbde756..0000000 --- a/tests/baseline/hashes/mpl22_ft261.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "test_pytest_mpl.test_hash_succeeds": "e80557c8784fb920fb79b03b26dc072649a98811f00a8c212df8761e4351acde", - "test.test_modified": "80e0ee6df7cf7d9d9407395a25af30beb8763e98820a7be972764899246d2cd7", - "test.test_new": "80e0ee6df7cf7d9d9407395a25af30beb8763e98820a7be972764899246d2cd7", - "test.test_unmodified": "80e0ee6df7cf7d9d9407395a25af30beb8763e98820a7be972764899246d2cd7", - "test_formats.test_format_eps": "f8a0fbb33dcd473ef5cfdd69317db6eb58d64a7f5f3b5072e0de69aa9e201224", - "test_formats.test_format_pdf": "8963ba9209080091c0961553bdf195cdcd0f2ba29081a122f9aad8e94c444aff", - "test_formats.test_format_png": "d577a3c8c7550413d8d50bc26a68f3e8d9c35d4763c52cbcc15df4f61c8406b2" -} diff --git a/tests/baseline/hashes/mpl30_ft261.json b/tests/baseline/hashes/mpl30_ft261.json deleted file mode 100644 index b928fbb..0000000 --- a/tests/baseline/hashes/mpl30_ft261.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "test_pytest_mpl.test_hash_succeeds": "ffbe386e7bbd8c720a44d2775dfe207b6dcca9304d845b557071a72b8c31ce04", - "test.test_modified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_new": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_unmodified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test_formats.test_format_eps": "4a605a2cd24101b9292151f5ab6d6846ba1b9c856cfda2bee6a142380e257b04", - "test_formats.test_format_pdf": "34a9eb10372b35c0bd26472e8571a91031c055ab47cc3682ebc0c5e47c2b6cbd", - "test_formats.test_format_png": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904" -} diff --git a/tests/baseline/hashes/mpl310_ft261.json b/tests/baseline/hashes/mpl310_ft261.json new file mode 100644 index 0000000..033718a --- /dev/null +++ b/tests/baseline/hashes/mpl310_ft261.json @@ -0,0 +1,10 @@ +{ + "test_pytest_mpl.test_hash_succeeds": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", + "test.test_modified": "2d3f2990aa6bc127d154c39ec4480a56e95e6245de31280c049b760ac1d120f0", + "test.test_new": "2d3f2990aa6bc127d154c39ec4480a56e95e6245de31280c049b760ac1d120f0", + "test.test_unmodified": "2d3f2990aa6bc127d154c39ec4480a56e95e6245de31280c049b760ac1d120f0", + "test_formats.test_format_eps": "f730e67270aeeb2a0bedee168d7c421b952cbf486ea371987cc4cea503a7d7ff", + "test_formats.test_format_pdf": "492152532625c1c4ea404854b75923c5dae0c253873b3715edba29d93b326d07", + "test_formats.test_format_png": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", + "test_formats.test_format_svg": "37695c451ddc7b92ee18025e51ef54cc0e58840298945050d40d692580a14539" +} diff --git a/tests/baseline/hashes/mpl31_ft261.json b/tests/baseline/hashes/mpl31_ft261.json deleted file mode 100644 index 421a2ab..0000000 --- a/tests/baseline/hashes/mpl31_ft261.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "test_pytest_mpl.test_hash_succeeds": "d577a3c8c7550413d8d50bc26a68f3e8d9c35d4763c52cbcc15df4f61c8406b2", - "test.test_modified": "b7a4b4a01e8cf66c805ab456bf3f807066acf86a11af669b557b2aa98586f2c0", - "test.test_new": "b7a4b4a01e8cf66c805ab456bf3f807066acf86a11af669b557b2aa98586f2c0", - "test.test_unmodified": "b7a4b4a01e8cf66c805ab456bf3f807066acf86a11af669b557b2aa98586f2c0", - "test_formats.test_format_eps": "108a341ce450cb5adef9f41e27175da1809fcdeb64f17b13f58d3eb0efc08006", - "test_formats.test_format_pdf": "8963ba9209080091c0961553bdf195cdcd0f2ba29081a122f9aad8e94c444aff", - "test_formats.test_format_png": "d577a3c8c7550413d8d50bc26a68f3e8d9c35d4763c52cbcc15df4f61c8406b2" -} diff --git a/tests/baseline/hashes/mpl32_ft261.json b/tests/baseline/hashes/mpl32_ft261.json deleted file mode 100644 index b928fbb..0000000 --- a/tests/baseline/hashes/mpl32_ft261.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "test_pytest_mpl.test_hash_succeeds": "ffbe386e7bbd8c720a44d2775dfe207b6dcca9304d845b557071a72b8c31ce04", - "test.test_modified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_new": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_unmodified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test_formats.test_format_eps": "4a605a2cd24101b9292151f5ab6d6846ba1b9c856cfda2bee6a142380e257b04", - "test_formats.test_format_pdf": "34a9eb10372b35c0bd26472e8571a91031c055ab47cc3682ebc0c5e47c2b6cbd", - "test_formats.test_format_png": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904" -} diff --git a/tests/baseline/hashes/mpl33_ft261.json b/tests/baseline/hashes/mpl33_ft261.json deleted file mode 100644 index 3fdf024..0000000 --- a/tests/baseline/hashes/mpl33_ft261.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "test_pytest_mpl.test_hash_succeeds": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", - "test.test_modified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_new": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_unmodified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test_formats.test_format_eps": "4a605a2cd24101b9292151f5ab6d6846ba1b9c856cfda2bee6a142380e257b04", - "test_formats.test_format_pdf": "34a9eb10372b35c0bd26472e8571a91031c055ab47cc3682ebc0c5e47c2b6cbd", - "test_formats.test_format_png": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", - "test_formats.test_format_svg": "b7f85f4b44e0c5871f5cc230b5a9042f2e73aa70384ab584d6cd8cde29344cd2" -} diff --git a/tests/baseline/hashes/mpl34_ft261.json b/tests/baseline/hashes/mpl34_ft261.json deleted file mode 100644 index 3fdf024..0000000 --- a/tests/baseline/hashes/mpl34_ft261.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "test_pytest_mpl.test_hash_succeeds": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", - "test.test_modified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_new": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_unmodified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test_formats.test_format_eps": "4a605a2cd24101b9292151f5ab6d6846ba1b9c856cfda2bee6a142380e257b04", - "test_formats.test_format_pdf": "34a9eb10372b35c0bd26472e8571a91031c055ab47cc3682ebc0c5e47c2b6cbd", - "test_formats.test_format_png": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", - "test_formats.test_format_svg": "b7f85f4b44e0c5871f5cc230b5a9042f2e73aa70384ab584d6cd8cde29344cd2" -} diff --git a/tests/baseline/hashes/mpl35_ft261.json b/tests/baseline/hashes/mpl35_ft261.json deleted file mode 100644 index 5abbe0d..0000000 --- a/tests/baseline/hashes/mpl35_ft261.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "test_pytest_mpl.test_hash_succeeds": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", - "test.test_modified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_new": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test.test_unmodified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test_formats.test_format_eps": "eafdced089e99355680744ac0b03d0beb3908c356c15f42e3fb299fa96cce46b", - "test_formats.test_format_pdf": "43ff9cc711b1d5e94bb904fc0ba872ea1c0a3fc778ed6eb705c5fc9305928c6b", - "test_formats.test_format_png": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", - "test_formats.test_format_svg": "43a859a3642b9ce15578d25c6fd7d13edfee3a18457949a1ed4e841a83aa2942" -} diff --git a/tests/baseline/hashes/mpl37_ft261.json b/tests/baseline/hashes/mpl37_ft261.json index d02bd2e..0a94ad1 100644 --- a/tests/baseline/hashes/mpl37_ft261.json +++ b/tests/baseline/hashes/mpl37_ft261.json @@ -6,5 +6,5 @@ "test_formats.test_format_eps": "f7a03867e26b8ae32ed6f22972dfdc571a974df80881dc24bb8f840681f2ac5f", "test_formats.test_format_pdf": "492152532625c1c4ea404854b75923c5dae0c253873b3715edba29d93b326d07", "test_formats.test_format_png": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", - "test_formats.test_format_svg": "cb648df098fa1dd1ba0ed81e6498d31a152a43c47882e2503d093f83306ff403" + "test_formats.test_format_svg": "bfe2704c1b1ce78edd70a0ad0b74519344e348ba830faafaecc7612b4950a9f6" } diff --git a/tests/baseline/hashes/mpl38_ft261.json b/tests/baseline/hashes/mpl38_ft261.json index 7104aec..603a07e 100644 --- a/tests/baseline/hashes/mpl38_ft261.json +++ b/tests/baseline/hashes/mpl38_ft261.json @@ -6,5 +6,5 @@ "test_formats.test_format_eps": "f730e67270aeeb2a0bedee168d7c421b952cbf486ea371987cc4cea503a7d7ff", "test_formats.test_format_pdf": "492152532625c1c4ea404854b75923c5dae0c253873b3715edba29d93b326d07", "test_formats.test_format_png": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", - "test_formats.test_format_svg": "6309fd2c3f328ca3c5614c58c118780c94035eb3690fc4b95d1923699b28ff8e" + "test_formats.test_format_svg": "9cae2f09df8e0a442be577e4138ed0f15cdde485929a5b85d8544b97590047ac" } diff --git a/tests/baseline/hashes/mpl36_ft261.json b/tests/baseline/hashes/mpl39_ft261.json similarity index 74% rename from tests/baseline/hashes/mpl36_ft261.json rename to tests/baseline/hashes/mpl39_ft261.json index ef249c3..31690ce 100644 --- a/tests/baseline/hashes/mpl36_ft261.json +++ b/tests/baseline/hashes/mpl39_ft261.json @@ -3,8 +3,8 @@ "test.test_modified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", "test.test_new": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", "test.test_unmodified": "025d344bc9667222abc27f2d746618bce9da8ae44fa9afa1220ac83f230b4e4e", - "test_formats.test_format_eps": "f7a03867e26b8ae32ed6f22972dfdc571a974df80881dc24bb8f840681f2ac5f", + "test_formats.test_format_eps": "f730e67270aeeb2a0bedee168d7c421b952cbf486ea371987cc4cea503a7d7ff", "test_formats.test_format_pdf": "492152532625c1c4ea404854b75923c5dae0c253873b3715edba29d93b326d07", "test_formats.test_format_png": "e73d228183ddfdced366191399cdecef9685d1248b852162f179750fc7b8b904", - "test_formats.test_format_svg": "4d1390489561a93e5413071632cfdab79ca1efbebf55337af2ab462cf1d4b9db" + "test_formats.test_format_svg": "f2471aa700015ced1d4d17cfef58956c0cde50402435f3f996abfc962b55ce8d" } diff --git a/tests/helpers.py b/tests/helpers.py index ce41235..a3741e9 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -16,15 +16,6 @@ def pytester_path(pytester): def skip_if_format_unsupported(file_format, using_hashes=False): - if file_format == 'svg' and MPL_VERSION < Version('3.3'): - pytest.skip('SVG comparison is only supported in Matplotlib 3.3 and above') - - if using_hashes: - - if file_format == 'pdf' and MPL_VERSION < Version('2.1'): - pytest.skip('PDF hashes are only deterministic in Matplotlib 2.1 and above') - elif file_format == 'eps' and MPL_VERSION < Version('2.1'): - pytest.skip('EPS hashes are only deterministic in Matplotlib 2.1 and above') if using_hashes and not sys.platform.startswith('linux'): pytest.skip('Hashes for vector graphics are only provided in the hash library for Linux') diff --git a/tests/test_deterministic.py b/tests/test_deterministic.py index edd26b8..0b9b6a8 100644 --- a/tests/test_deterministic.py +++ b/tests/test_deterministic.py @@ -53,7 +53,6 @@ def test_mpl(): ("true", "", False, False), ], ) -@pytest.mark.skipif(MPL_VERSION < Version("3.3.0"), reason="Test unsupported: Default metadata is different in MPL<3.3") def test_config(pytester, file_format, ini, cli, kwarg, success_expected): skip_if_format_unsupported(file_format, using_hashes=True) diff --git a/tox.ini b/tox.ini index 450f49d..cb382e1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{39,310,311,312}-test-mpl{33,34,35,36,37,38} + py{39,310,311,312}-test-mpl{37,38,39,310} py312-test-mpldev-pytestdev codestyle requires = @@ -19,20 +19,10 @@ setenv = changedir = .tmp/{envname} description = run tests deps = - py312: git+https://github.com/dateutil/dateutil.git#egg=python-dateutil - mpl20: matplotlib==2.0.* - mpl20: nose - mpl21: matplotlib==2.1.* - mpl22: matplotlib==2.2.* - mpl30: matplotlib==3.0.* - mpl31: matplotlib==3.1.* - mpl32: matplotlib==3.2.* - mpl33: matplotlib==3.3.* - mpl34: matplotlib==3.4.* - mpl35: matplotlib==3.5.* - mpl36: matplotlib==3.6.* mpl37: matplotlib==3.7.* mpl38: matplotlib==3.8.* + mpl39: matplotlib==3.9.* + mpl310: matplotlib==3.10.* mpldev: matplotlib>=0.0.dev0 pytest54: pytest==5.4.* pytest60: pytest==6.0.*