Skip to content

Commit

Permalink
Bump minversions, update CI (#240)
Browse files Browse the repository at this point in the history
* Bump minversions, update CI

* Lots of clean-up
  • Loading branch information
pllim authored Oct 12, 2023
1 parent 3be55e1 commit 9eab781
Show file tree
Hide file tree
Showing 21 changed files with 76 additions and 305 deletions.
61 changes: 45 additions & 16 deletions .github/workflows/spherical_geometry.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
name: Spherical Geometry CI

# Change 'on' section and add code coverage.

on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
schedule:
# Run every Monday at 6am UTC
- cron: '0 6 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Python Testing ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -35,46 +40,70 @@ jobs:
python -m pip install -e .[test]
- name: Test with pytest
run: |
pip freeze
pytest
devdeps:
name: Python Testing with dev versions of dependencies
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
python -m pip install --pre --upgrade --extra-index-url https://pypi.anaconda.org/astropy/simple astropy
python -m pip install -e .[test]
- name: Test with pytest
run: |
pip freeze
pytest
doc_build:
name: Document Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.11'
- name: Install dependencies
run: |
sudo apt-get install graphviz texlive-latex-extra dvipng
python -m pip install --upgrade pip
python -m pip install -e .[docs]
- name: Build documents with sphinx
run: |
pip freeze
sphinx-build docs build/docs
code_coverage:
name: Code Coverage Report
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test]
- name: Test with pytest and code coverage
run: |
pip freeze
pytest --cov-report=xml --cov=. --cov-config=setup.cfg
- name: Upload coverage to codecoverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml

Expand All @@ -83,11 +112,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.11'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand Down
10 changes: 8 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Release Notes
=============

1.2.24 (unreleased)
===================
1.3 (unreleased)
================

- Add documentation to ``polygon.py`` for the ``SphericalPolygon``
method ``multi_union`` has exponential time behavior and cannot
Expand All @@ -18,6 +18,12 @@ Release Notes
https://github.com/spacetelescope/spherical_geometry/issues/232
is resolved. [#233]

- Removed unused ``spherical_geometry.utils`` module. [#239]

- Minimum supported version for Python is now 3.9. [#239]

- Minimum supported version for NumPy is now 1.20. [#239]


1.2.23 (10-October-2022)
========================
Expand Down
5 changes: 2 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ include README.rst
include CHANGES.rst

include setup.cfg
include pyproject.toml

recursive-include *.pyx *.c *.pxd
recursive-include *.c
recursive-include docs *
recursive-include licenses *
recursive-include cextern *
recursive-include scripts *

prune build
prune docs/_build
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion licenses/LICENSE.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2011,2014 Association of Universities for Research in
Copyright (C) 2011-2023 Association of Universities for Research in
Astronomy (AURA)

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build-system]
requires = ["setuptools>=38.2.5", "setuptools_scm", "wheel", "oldest-supported-numpy"]
requires = ["setuptools>=38.2.5", "setuptools_scm", "numpy>=1.25,<2"]
19 changes: 7 additions & 12 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
[build_sphinx]
source-dir = docs
build-dir = docs/_build
all_files = 1

[upload_docs]
upload-dir = docs/_build/html
show-response = 1

[tools:pytest]
minversion = 4.2
[tool:pytest]
minversion = 6
junit_family = xunit2
norecursedirs = .git build docs/_build
xfail_strict = true
filterwarnings =
error
ignore:numpy\.ndarray size changed:RuntimeWarning
ignore:numpy\.ufunc size changed:RuntimeWarning

[metadata]
package_name = spherical_geometry
Expand All @@ -32,4 +28,3 @@ omit =
spherical_geometry/tests/*
# And list again for running against installed versions
*/spherical_geometry/tests/*

9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ def qd_config(arg):
exit(1)

# Get some values from the setup.cfg
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
from configparser import ConfigParser
conf = ConfigParser()
conf.read(['setup.cfg'])
metadata = dict(conf.items('metadata'))
Expand Down Expand Up @@ -134,9 +131,9 @@ def qd_config(arg):
description=DESCRIPTION,
install_requires=[
'astropy>=5.0.4',
'numpy>=1.18',
'numpy>=1.20',
],
python_requiers='>=3.8',
python_requiers='>=3.9',
extras_require={
'test': [
'pytest',
Expand Down
8 changes: 3 additions & 5 deletions spherical_geometry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
__version__ = 'unknown'
from .version import version as __version__
except ImportError:
__version__ = ''
4 changes: 1 addition & 3 deletions spherical_geometry/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
This contains the code that does the actual unioning of regions.
"""
# TODO: Weak references for memory management problems?
from __future__ import absolute_import, division, unicode_literals, print_function

# STDLIB
import itertools
import weakref

# THIRD-PARTY
import numpy as np

# LOCAL
from .utils.compat import weakref
from . import great_circle_arc as gca
from . import vector
from .polygon import (SingleSphericalPolygon, SphericalPolygon,
Expand Down
3 changes: 0 additions & 3 deletions spherical_geometry/great_circle_arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
section of those circles between two points on the unit sphere.
"""

from __future__ import with_statement, division, absolute_import, unicode_literals

import math
from .vector import two_d

# THIRD-PARTY
Expand Down
1 change: 0 additions & 1 deletion spherical_geometry/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
The `spherical_geometry.polygon` module defines the `SphericalPolygon` class for
managing polygons on the unit sphere.
"""
from __future__ import division, print_function, unicode_literals, absolute_import

# STDLIB
from copy import copy, deepcopy
Expand Down
3 changes: 0 additions & 3 deletions spherical_geometry/tests/setup_package.py

This file was deleted.

2 changes: 0 additions & 2 deletions spherical_geometry/tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import os
import os.path
import math
Expand Down
5 changes: 2 additions & 3 deletions spherical_geometry/tests/test_intersection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, absolute_import

# STDLIB
import codecs
import functools
Expand All @@ -8,10 +6,10 @@
import os
import random
import sys
import pytest

# THIRD-PARTY
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal

# LOCAL
Expand Down Expand Up @@ -121,6 +119,7 @@ def test3():
return [poly1, poly3]


@pytest.mark.filterwarnings("ignore:CPERROR.*")
def test4():
from astropy.io import fits
from astropy import wcs as pywcs
Expand Down
5 changes: 3 additions & 2 deletions spherical_geometry/tests/test_union.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, absolute_import

# STDLIB
import codecs
import functools
Expand All @@ -11,6 +9,7 @@

# THIRD-PARTY
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal

# LOCAL
Expand Down Expand Up @@ -113,6 +112,7 @@ def test2():
return [poly1, poly2, poly3, poly4, poly5, poly6]


@pytest.mark.filterwarnings("ignore:CPERROR.*")
def test5():
from astropy.io import fits
from astropy import wcs as pywcs
Expand All @@ -139,6 +139,7 @@ def test6():
null_union = chipA1.union(chipA2)


@pytest.mark.filterwarnings("ignore:CPERROR.*")
@union_test(0, 90)
def test7():
from astropy.io import fits
Expand Down
4 changes: 0 additions & 4 deletions spherical_geometry/utils/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions spherical_geometry/utils/compat/__init__.py

This file was deleted.

19 changes: 0 additions & 19 deletions spherical_geometry/utils/compat/weakref.py

This file was deleted.

Loading

0 comments on commit 9eab781

Please sign in to comment.