From 34eb6b9764e547d816df414151ada463b2209af3 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Tue, 18 Jun 2024 13:58:24 -0700 Subject: [PATCH] Drop 3.9 --- .github/workflows/ci.yml | 31 +++++-------------- .pre-commit-config.yaml | 5 ++- .readthedocs.yml | 2 +- LICENSE.rst | 2 +- README.rst | 4 +++ docs/conf.py | 22 ++----------- .../sources/tests/test_callisto.py | 6 ++-- setup.cfg | 4 +-- tox.ini | 9 +++--- 9 files changed, 27 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 183e15c..36a1eb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,8 @@ jobs: submodules: false coverage: codecov toxdeps: tox-pypi-filter - posargs: -n auto envs: | - - linux: py311 + - linux: py312 test: needs: [core] @@ -37,11 +36,10 @@ jobs: submodules: false coverage: codecov toxdeps: tox-pypi-filter - posargs: -n auto envs: | - - macos: py310 - - windows: py39 - - linux: py39-oldestdeps + - macos: py311 + - windows: py310 + - linux: py310-oldestdeps docs: needs: [test] @@ -66,24 +64,9 @@ jobs: submodules: false coverage: codecov toxdeps: tox-pypi-filter - posargs: -n auto --dist loadgroup envs: | - - linux: py311-online - - devdeps: - needs: [online] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main - with: - submodules: false - coverage: codecov - toxdeps: tox-pypi-filter - posargs: -n auto - libraries: | - apt: - # This can be removed when there are binaries for h5py on 3.11 - - libhdf5-dev - envs: | - - linux: py311-devdeps + - linux: py312-online + - linux: py312-devdeps publish: # Build wheels when pushing to any branch except main @@ -101,7 +84,7 @@ jobs: needs: [test] uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main with: - python-version: "3.11" + python-version: "3.12" test_extras: 'dev' test_command: 'pytest -p no:warnings --doctest-rst -m "not mpl_image_compare" --pyargs radiospectra' submodules: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f106d0..7c56f19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|__init__.py|docs/conf.py)$" - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.2 hooks: - id: black exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" @@ -16,7 +16,7 @@ repos: - id: isort exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-ast - id: check-case-conflict @@ -28,7 +28,6 @@ repos: exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" - id: check-yaml - id: debug-statements - ci: autofix_prs: false autoupdate_schedule: "quarterly" diff --git a/.readthedocs.yml b/.readthedocs.yml index dc5115f..4f38fb2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -2,7 +2,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: "3.9" + python: "3.12" apt_packages: - graphviz diff --git a/LICENSE.rst b/LICENSE.rst index c98bfd7..6518fe2 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -1,4 +1,4 @@ -Copyright (c) 2018-2022, The SunPy Developers +Copyright (c) 2018-2024, The SunPy Developers Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.rst b/README.rst index 573756c..75ea082 100644 --- a/README.rst +++ b/README.rst @@ -24,6 +24,7 @@ To see the latest changes in ``radiospectra`` see our `changelog `__. To install ``radiospectra`` once miniforge is installed run the following command: @@ -35,6 +36,7 @@ For detailed installation instructions, see the `installation guide `__ @@ -43,11 +45,13 @@ For more information or to ask questions about ``radiospectra`` or any other Sun Contributing ============ + If you would like to get involved, start by joining the `SunPy Chat`_ and check out our `Newcomers' guide `__. This will walk you through getting set up for contributing. Code of Conduct =============== + When you are interacting with the SunPy community you are asked to follow our `Code of Conduct `__. .. _SunPy Chat: https://openastronomy.element.io/#/room/#sunpy:openastronomy.org diff --git a/docs/conf.py b/docs/conf.py index 6257917..c8e909c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,28 +10,11 @@ import os import sys import datetime -from pkg_resources import get_distribution from packaging.version import Version -# -- Check for dependencies ---------------------------------------------------- - -doc_requires = get_distribution("radiospectra").requires(extras=("docs",)) -missing_requirements = [] -for requirement in doc_requires: - try: - get_distribution(requirement) - except Exception as e: - missing_requirements.append(requirement.name) -if missing_requirements: - print( - f"The {' '.join(missing_requirements)} package(s) could not be found and " - "is needed to build the documentation, please install the 'docs' requirements." - ) - sys.exit(1) - # -- Read the Docs Specific Configuration -------------------------------------- -# This needs to be done before sunpy is imported +# This needs to be done before radiospectra is imported on_rtd = os.environ.get("READTHEDOCS", None) == "True" if on_rtd: os.environ["SUNPY_CONFIGDIR"] = "/home/docs/" @@ -167,8 +150,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. - -from sunpy_sphinx_theme.conf import * # NOQA +html_theme = "sunpy" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/radiospectra/spectrogram/sources/tests/test_callisto.py b/radiospectra/spectrogram/sources/tests/test_callisto.py index 7d634af..ee2c458 100644 --- a/radiospectra/spectrogram/sources/tests/test_callisto.py +++ b/radiospectra/spectrogram/sources/tests/test_callisto.py @@ -247,7 +247,8 @@ def test_callisto(parse_path_moc): assert spec.end_time.datetime == datetime(2011, 6, 7, 6, 39) assert spec.wavelength.min.to(u.MHz) == 20 * u.MHz assert spec.wavelength.max.to(u.MHz).round(1) == 91.8 * u.MHz - assert str(spec.observatory_location) == "(3801942.21260148, 528924.60367802, 5077174.56861812) m" + assert spec.observatory_location.value.tolist() == (3801942.212601484, 528924.6036780173, 5077174.568618115) + assert spec.observatory_location.unit == u.m @mock.patch("sunpy.util.io.is_file") @@ -490,4 +491,5 @@ def test_callisto_hour_rollover(hdul_moc, is_file_mock): assert spec.end_time.datetime == datetime(2011, 6, 8, 0, 1, 6, 0) assert spec.wavelength.min.to(u.MHz) == 20 * u.MHz assert spec.wavelength.max.to(u.MHz).round(1) == 91.8 * u.MHz - assert str(spec.observatory_location) == "(3801942.21260148, 528924.60367802, 5077174.56861812) m" + assert spec.observatory_location.value.tolist() == (3801942.212601484, 528924.6036780173, 5077174.568618115) + assert spec.observatory_location.unit == u.m diff --git a/setup.cfg b/setup.cfg index fe1d4d9..2a35b0f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,14 +21,14 @@ classifiers = Operating System :: OS Independent Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Topic :: Scientific/Engineering :: Physics [options] zip_safe = False -python_requires = >=3.9 +python_requires = >=3.10 packages = find: include_package_data = True setup_requires = diff --git a/tox.ini b/tox.ini index 806214a..f6800b4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 4.0.0 envlist = - py{39,310,311}{,-oldestdeps,-devdeps,-online} + py{310,311,312}{,-oldestdeps,-devdeps,-online} build_docs codestyle requires = @@ -23,13 +23,12 @@ setenv = devdeps,build_docs,online: HOME = {envtmpdir} SUNPY_SAMPLEDIR = {env:SUNPY_SAMPLEDIR:{toxinidir}/.tox/{envname}/sample_data/} deps = + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple devdeps: git+https://github.com/sunpy/sunpy - devdeps: matplotlib - devdeps: scipy - oldestdeps: sunpy<4.1 + devdeps: matplotlib>=0.0.dev0 + devdeps: scipy>=0.0.dev0 online: pytest-rerunfailures online: pytest-timeout - pytest-xdist extras = all tests