Skip to content

Commit

Permalink
Drop 3.9 (#111)
Browse files Browse the repository at this point in the history
* tDrop 3.9

* add changelog

* left over fixes
  • Loading branch information
nabobalis authored Jun 19, 2024
1 parent 04fc72d commit 5b009c5
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 72 deletions.
33 changes: 8 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ jobs:
submodules: false
coverage: codecov
toxdeps: tox-pypi-filter
posargs: -n auto
envs: |
- linux: py311
- linux: py312
test:
needs: [core]
Expand All @@ -37,17 +36,16 @@ 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]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
with:
default_python: '3.9'
default_python: '3.12'
submodules: false
pytest: false
toxdeps: tox-pypi-filter
Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)$"
Expand All @@ -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
Expand All @@ -28,7 +28,6 @@ repos:
exclude: ".*(.fits|.fts|.fit|.txt|.csv)$"
- id: check-yaml
- id: debug-statements

ci:
autofix_prs: false
autoupdate_schedule: "quarterly"
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.9"
python: "3.12"
apt_packages:
- graphviz

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ To see the latest changes in ``radiospectra`` see our `changelog <https://docs.s

Installation
============

The recommended way to install ``radiospectra`` is with `miniforge <https://github.com/conda-forge/miniforge#miniforge3>`__.
To install ``radiospectra`` once miniforge is installed run the following command:

Expand All @@ -35,6 +36,7 @@ For detailed installation instructions, see the `installation guide <https://doc

Getting Help
============

For more information or to ask questions about ``radiospectra`` or any other SunPy library, check out:

- `radiospectra documentation <https://docs.sunpy.org/projects/radiospectra/>`__
Expand All @@ -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 <https://docs.sunpy.org/en/latest/dev_guide/contents/newcomers.html>`__.
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 <https://sunpy.org/coc>`__.

.. _SunPy Chat: https://openastronomy.element.io/#/room/#sunpy:openastronomy.org
1 change: 1 addition & 0 deletions changelog/111.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dropped support for Python 3.9
22 changes: 2 additions & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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,
Expand Down
23 changes: 11 additions & 12 deletions radiospectra/net/sources/psp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,19 @@ class RFSClient(GenericClient):
<BLANKLINE>
8 Results from the RFSClient:
<BLANKLINE>
Start Time End Time ... Provider Wavelength
... kHz
----------------------- ----------------------- ... -------- -----------------
2019-10-02 00:00:00.000 2019-10-02 23:59:59.999 ... SPDF 10.0 .. 1700.0
2019-10-03 00:00:00.000 2019-10-03 23:59:59.999 ... SPDF 10.0 .. 1700.0
2019-10-04 00:00:00.000 2019-10-04 23:59:59.999 ... SPDF 10.0 .. 1700.0
2019-10-05 00:00:00.000 2019-10-05 23:59:59.999 ... SPDF 10.0 .. 1700.0
2019-10-02 00:00:00.000 2019-10-02 23:59:59.999 ... SPDF 1300.0 .. 19200.0
2019-10-03 00:00:00.000 2019-10-03 23:59:59.999 ... SPDF 1300.0 .. 19200.0
2019-10-04 00:00:00.000 2019-10-04 23:59:59.999 ... SPDF 1300.0 .. 19200.0
2019-10-05 00:00:00.000 2019-10-05 23:59:59.999 ... SPDF 1300.0 .. 19200.0
Start Time End Time Instrument Source Provider Wavelength
kHz
----------------------- ----------------------- ---------- ------ -------- -----------------
2019-10-02 00:00:00.000 2019-10-02 23:59:59.999 RFS PSP SPDF 10.0 .. 1700.0
2019-10-03 00:00:00.000 2019-10-03 23:59:59.999 RFS PSP SPDF 10.0 .. 1700.0
2019-10-04 00:00:00.000 2019-10-04 23:59:59.999 RFS PSP SPDF 10.0 .. 1700.0
2019-10-05 00:00:00.000 2019-10-05 23:59:59.999 RFS PSP SPDF 10.0 .. 1700.0
2019-10-02 00:00:00.000 2019-10-02 23:59:59.999 RFS PSP SPDF 1300.0 .. 19200.0
2019-10-03 00:00:00.000 2019-10-03 23:59:59.999 RFS PSP SPDF 1300.0 .. 19200.0
2019-10-04 00:00:00.000 2019-10-04 23:59:59.999 RFS PSP SPDF 1300.0 .. 19200.0
2019-10-05 00:00:00.000 2019-10-05 23:59:59.999 RFS PSP SPDF 1300.0 .. 19200.0
<BLANKLINE>
<BLANKLINE>
"""

baseurl = (
Expand Down
6 changes: 4 additions & 2 deletions radiospectra/spectrogram/sources/tests/test_callisto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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 =
Expand All @@ -22,14 +22,14 @@ setenv =
PYTEST_COMMAND = pytest -vvv -s -ra --pyargs radiospectra --cov-report=xml --cov=radiospectra --cov-config={toxinidir}/setup.cfg {toxinidir}/docs
devdeps,build_docs,online: HOME = {envtmpdir}
SUNPY_SAMPLEDIR = {env:SUNPY_SAMPLEDIR:{toxinidir}/.tox/{envname}/sample_data/}
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
deps =
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
oldestdeps: sunpy<5.1
online: pytest-rerunfailures
online: pytest-timeout
pytest-xdist
extras =
all
tests
Expand All @@ -44,7 +44,7 @@ extras =
all
docs
commands =
sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs}
sphinx-build --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs}
python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))'

[testenv:codestyle]
Expand Down

0 comments on commit 5b009c5

Please sign in to comment.