Skip to content

Commit

Permalink
Pre-commit + CI + devdeps (#111)
Browse files Browse the repository at this point in the history
* Pre-commit

* Tweak test and add devdeps

* Changelog for 1.10

* Add changelog readme
  • Loading branch information
nabobalis committed Nov 17, 2023
1 parent b0551a0 commit 4f7f398
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
envs: |
- windows: py310
- macos: py39
- linux: py311-devdeps
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -69,6 +70,7 @@ jobs:
needs: [test]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main
with:
python-version: '3.9'
test_extras: 'tests'
test_command: 'pytest -p no:warnings --pyargs sunpy_soar'
submodules: false
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ repos:
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.4'
rev: 'v0.1.5'
hooks:
- id: ruff
args: ['--fix']
- repo: https://github.com/psf/black
rev: 23.10.1
rev: 23.11.0
hooks:
- id: black
exclude: ".*(.fits|.fts|.fit|.txt|.csv)$"
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
1.1.0 (2023-11-16)
==================

Also includes changes from v1.9

Removals
--------

- Removed the Identifier attribute, which is replaced by the Product attribute. (`#100 <https://github.com/sunpy/sunpy-soar/pull/100>`__)


New Features
------------

- Now query returns time sorted table of results. (`#96 <https://github.com/sunpy/sunpy-soar/pull/96>`__)


Bug Fixes
---------

- Fixing upper case to lower case descriptors (products) for SOAR 1.11 (`#94 <https://github.com/sunpy/sunpy-soar/pull/94>`__)


Internal Changes
----------------

- Retemplate sunpy-soar to follow the sunpy package structure (`#95 <https://github.com/sunpy/sunpy-soar/pull/95>`__)

1.8
===

Expand Down
1 change: 0 additions & 1 deletion changelog/100.removal.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/94.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/95.trivial.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/96.feature.rst

This file was deleted.

34 changes: 34 additions & 0 deletions changelog/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
=========
Changelog
=========

.. note::

This README was adapted from the pytest changelog readme under the terms of the MIT licence.

This directory contains "news fragments" which are short files that contain a small **ReST**-formatted text that will be added to the next ``CHANGELOG``.

The ``CHANGELOG`` will be read by users, so this description should be aimed at SunPy users instead of describing internal changes which are only relevant to the developers.

Make sure to use full sentences with correct case and punctuation, for example::

Add support for Helioprojective coordinates in `sunpy.coordinates.frames`.

Please try to use Sphinx intersphinx using backticks.

Each file should be named like ``<PULL REQUEST>.<TYPE>[.<COUNTER>].rst``, where ``<PULL REQUEST>`` is a pull request number, ``COUNTER`` is an optional number if a PR needs multiple entries with the same type and ``<TYPE>`` is one of:

* ``breaking``: A change which requires users to change code and is not backwards compatible. (Not to be used for removal of deprecated features.)
* ``feature``: New user facing features and any new behavior.
* ``bugfix``: Fixes a reported bug.
* ``doc``: Documentation addition or improvement, like rewording an entire session or adding missing docs.
* ``deprecation``: Feature deprecation
* ``removal``: Feature removal.
* ``trivial``: A change which has no user facing effect or is tiny change.

So for example: ``123.feature.rst``, ``456.bugfix.rst``.

If you are unsure what pull request type to use, don't hesitate to ask in your PR.

Note that the ``towncrier`` tool will automatically reflow your text, so it will work best if you stick to a single paragraph, but multiple sentences and links are OK and encouraged.
You can install ``towncrier`` and then run ``towncrier --draft`` if you want to get a preview of how your change will look in the final release notes.
8 changes: 4 additions & 4 deletions sunpy_soar/tests/test_sunpy_soar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@

def test_search():
instrument = a.Instrument("EUI")
time = a.Time("2021-02-11", "2021-02-12")
time = a.Time("2022-02-11", "2022-02-12")
level = a.Level(1)
product = a.soar.Product("eui-fsi174-image")

res = Fido.search(instrument, time, level, product)
assert len(res) == 1
assert len(res[0]) == 37
assert u.allclose(res[0, 0]["Filesize"], 3.45 * u.Mbyte)
assert len(res[0]) == 660
assert u.allclose(res[0, 0]["Filesize"], 2.439 * u.Mbyte)

# check passing upper case descriptor
product = a.soar.Product("EUI-FSI174-IMAGE")
res = Fido.search(time, level, product)
assert res.file_num == 37
assert res.file_num == 660

files = Fido.fetch(res[0, 0])
assert len(files) == 1
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{39,310,311}
py{39,310,311}{,-devdeps}
build_docs
codestyle
isolated_build = true
Expand All @@ -12,13 +12,15 @@ whitelist_externals=
changedir = .tmp/{envname}
description =
run tests
devdeps: with the latest developer version of key dependencies
setenv =
MPLBACKEND = agg
COLUMNS = 180
PYTEST_COMMAND = pytest -vvv -s -raR --pyargs sunpy_soar --cov-report=xml --cov=sunpy_soar {toxinidir}/docs
deps =
pytest-xdist
pytest-cov
devdeps: git+https://github.com/sunpy/sunpy
extras =
tests
commands =
Expand Down

0 comments on commit 4f7f398

Please sign in to comment.