Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary fix for version dependency issues #137

Merged
merged 55 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
09bd280
Merge pull request #120 from aburrell/rc_v2.0.1
aburrell Apr 11, 2023
4e31f91
Merge branch 'main' into develop
ljlamarche Nov 7, 2024
aaf5074
BUG: Pin numpy and python versionas a temporary fix to version compat…
ljlamarche Nov 7, 2024
962c4f3
TST: updated test versions
aburrell Nov 7, 2024
6414c95
TST: added RTD yaml
aburrell Nov 7, 2024
ba2f394
DOC: update python versions
aburrell Nov 7, 2024
6f7db5a
MAINT: updated supported python versions
aburrell Nov 7, 2024
89ed40c
BUG: avoid installing apexpy on RTD
aburrell Nov 7, 2024
824acce
DOC: updated changelog
aburrell Nov 7, 2024
eee6dc9
BUG: fix RTD requirements installation
aburrell Nov 7, 2024
c4b7674
Merge branch 'develop' into develop
aburrell Nov 7, 2024
83364bd
MAINT: cycled python versions
aburrell Nov 7, 2024
f40451e
TST: updated test requirements
aburrell Nov 7, 2024
595da0b
BUG: debug test file
aburrell Nov 7, 2024
15edecc
Merge branch 'develop' of https://github.com/ljlamarche/apexpy into p…
aburrell Nov 7, 2024
1470711
BUG: fixed typo in action name
aburrell Nov 7, 2024
6fc45bd
STY: removed whitespace
aburrell Nov 7, 2024
d395b0d
BUG: remove gcc version
aburrell Nov 7, 2024
91269e3
BUG: fixed pip call
aburrell Nov 7, 2024
72b0f6f
BUG: fixes for test bugs
aburrell Nov 7, 2024
171ed0c
BUG: fix to macos
aburrell Nov 7, 2024
03f50ff
BUG: try os in quotes
aburrell Nov 7, 2024
dc51e95
BUG: removed comment
aburrell Nov 7, 2024
3b79447
BUG: try and fix include block
aburrell Nov 7, 2024
9381b18
BUG: include syntax
aburrell Nov 7, 2024
530fb45
BUG: fixed contains call
aburrell Nov 7, 2024
b16253d
BUG: gcc install
aburrell Nov 7, 2024
4cf831f
BUG: debugging gcc installation
aburrell Nov 7, 2024
fa76409
BUG: remove tab
aburrell Nov 7, 2024
0662d34
BUG: separate Mac installation
aburrell Nov 7, 2024
b91f578
BUG: removed gfortran install
aburrell Nov 7, 2024
a72defb
BUG: fixed closing bracket location
aburrell Nov 7, 2024
b9abef1
BUG: fixed gfortran call
aburrell Nov 7, 2024
15c0357
BUG: try bumping GCC version
aburrell Nov 7, 2024
0dc3069
TST: Fix copy_file utility funtion so that correct file name is retur…
ljlamarche Nov 8, 2024
16caf57
BUG: added xml debug statement
aburrell Nov 8, 2024
8b1eced
BUG: removed tab
aburrell Nov 8, 2024
cd91902
BUG: new debug line
aburrell Nov 8, 2024
0c6cb66
BUG: remove debug lines
aburrell Nov 8, 2024
2374519
BUG: try to specify directory one level up
aburrell Nov 8, 2024
cddf9dd
BUG: remove tab
aburrell Nov 8, 2024
585ea44
BUG: attempt to specify output coverage name
aburrell Nov 8, 2024
eb2c6bb
BUG: removed tab
aburrell Nov 8, 2024
95419a5
BUG: changed filename
aburrell Nov 8, 2024
c1a8e66
BUG: added more debug lines
aburrell Nov 8, 2024
a200885
BUG: removed tabs
aburrell Nov 8, 2024
047d27d
BUG: change debug command
aburrell Nov 8, 2024
35d45e3
BUG: try removing rootdir
aburrell Nov 8, 2024
8f44170
BUG: remove tab
aburrell Nov 8, 2024
a5f2573
BUG: try simplifying call
aburrell Nov 8, 2024
f49a490
REV: try coverage again
aburrell Nov 8, 2024
cc13551
BUG: revert to coverage
aburrell Nov 8, 2024
326ce56
BUG: remove tab
aburrell Nov 8, 2024
250db1d
BUG: remove rcfile call
aburrell Nov 8, 2024
b347348
BUG: removed other rcfile call
aburrell Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 50 additions & 37 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,51 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11"]
include:
- python-version: "3.9"
os: "macos-13"
- python-version: "3.10"
os: "macos-13"
- python-version: "3.11"
os: "macos-latest"

name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'

- name: Install standard and test dependencies on Mac/Linux
if: ${{ matrix.os != 'windows-latest' }}
run: pip install build coverage coveralls flake8 numpy pytest

- name: Install standard and test dependencies on Windows
- name: Install Windows-specific dependencies for non-pip install
if: ${{ matrix.os == 'windows-latest' }}
run: |
choco install ninja mingw
choco install rtools --no-progress
echo "c:\rtools40\ucrt64\bin;" >> $env:GITHUB_PATH
gfortran --version
pip install coverage coveralls flake8 meson-python numpy pytest scipy
pip install flake8 meson-python pytest pytest-cov pytest-xdist scipy
pip install "numpy>=1.19.5,<2"

- name: Install on Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pip install .[test]

- name: Install on MacOS-13
if: ${{ matrix.os == 'macos-13' }}
run: |
python -m build .
pip install .
brew reinstall gcc@14
CC=/usr/local/bin/gcc-14 pip install .[test]

- name: Install on MacOS
- name: Install on MacOS-Latest
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew reinstall gcc
CC=/usr/local/bin/gcc-12 python -m build .
CC=/usr/local/bin/gcc-12 pip install .
brew reinstall gcc@14
CC=/opt/homebrew/bin/gcc-14 pip install .[test]

- name: Install on Windows
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -73,33 +80,27 @@ jobs:
if: ${{ matrix.os != 'windows-latest' }}
run: |
cd ..
coverage run --rcfile=apexpy/setup.cfg -m pytest
coverage run -m pytest
coverage report
coverage xml
mv coverage.xml apexpy/.

- name: Run unit and integration tests on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
cd ..
coverage run --rcfile=apexpy\setup.cfg -m pytest

- name: Publish results to coveralls upon success on Mac/Linux
if: ${{ matrix.os != 'windows-latest' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ..
coverage combine
coverage report -m
coveralls --rcfile=apexpy/setup.cfg --service=github
coverage run -m pytest
coverage report
coverage xml
mv coverage.xml apexpy\.

- name: Publish results to coveralls upon success on Windows
if: ${{ matrix.os == 'windows-latest' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ..
coverage combine
coverage report -m
coveralls --rcfile=apexpy\setup.cfg --service=github
- name: Publish results to coveralls upon success
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run=${{ join(matrix.*, '-') }}
parallel: true
format: cobertura

- name: Create a Windows wheel
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -112,3 +113,15 @@ jobs:
with:
path: dist/*.whl
if-no-files-found: warn

finish:
name: Finish Coverage Analysis
needs: build
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
21 changes: 21 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Declare the Python requirements required to build your docs
# This method avoids a local build of the package
python:
install:
- requirements: docs/requirements.txt
6 changes: 4 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
Changelog
=========

2.X.X (2023-XX-XX)
-----------------
2.0.2 (2024-11-XX)
------------------
* Updated supported Python versions (3.9-3.11)
* Added a ReadTheDocs yaml
* Migrate to using importlib to keep track of package data files

2.0.1 (2023-04-11)
Expand Down
24 changes: 13 additions & 11 deletions apexpy/tests/test_Apex.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def copy_file(self, original, max_attempts=100):
except Exception:
pass

return
return self.temp_file

def test_default_datafile(self):
"""Test that the class initializes with the default datafile."""
Expand All @@ -185,11 +185,12 @@ def test_custom_datafile(self):
del apex_out_orig

# Create copy of datafile
self.copy_file(original_file)
custom_file = self.copy_file(original_file)

self.apex_out = apexpy.Apex(datafile=self.temp_file)
assert self.apex_out.datafile == self.temp_file
apex_out = apexpy.Apex(datafile=custom_file)
assert apex_out.datafile == custom_file

os.remove(custom_file)
return

def test_init_with_bad_datafile(self):
Expand All @@ -201,8 +202,8 @@ def test_init_with_bad_datafile(self):

def test_default_fortranlib(self):
"""Test that the class initializes with the default fortranlib."""
self.apex_out = apexpy.Apex()
assert os.path.isfile(self.apex_out.fortranlib)
apex_out = apexpy.Apex()
assert os.path.isfile(apex_out.fortranlib)
return

def test_custom_fortranlib(self):
Expand All @@ -214,11 +215,12 @@ def test_custom_fortranlib(self):
del apex_out_orig

# Create copy of datafile
self.copy_file(original_lib)
custom_lib = self.copy_file(original_lib)

self.apex_out = apexpy.Apex(fortranlib=self.temp_file)
assert self.apex_out.fortranlib == self.temp_file
apex_out = apexpy.Apex(fortranlib=custom_lib)
assert apex_out.fortranlib == custom_lib

os.remove(custom_lib)
return

def test_init_with_bad_fortranlib(self):
Expand All @@ -230,8 +232,8 @@ def test_init_with_bad_fortranlib(self):

def test_igrf_fn(self):
"""Test the default igrf_fn."""
self.apex_out = apexpy.Apex()
assert os.path.isfile(self.apex_out.igrf_fn)
apex_out = apexpy.Apex()
assert os.path.isfile(apex_out.igrf_fn)
return

def test_repr_eval(self):
Expand Down
11 changes: 7 additions & 4 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ The recommended (and most straightforward) method for users to install

pip install apexpy

You should be able to import :py:mod:`apexpy` and run basic conversions as shown in the
examples. If you get errors or warnings upon importing, see below for more
advanced options and troubleshooting.
You should be able to import :py:mod:`apexpy` and run basic conversions as shown
in the examples. If you get errors or warnings upon importing, see below for
more advanced options and troubleshooting.


.. _installation-tested:
Expand All @@ -26,7 +26,10 @@ Tested environments
The package has been tested with the following setups (others might work, too):

* Windows (64 bit Python), Linux (64 bit), and Mac (64 bit)
* Python 3.7, 3.8, 3.9, 3.10
* Python 3.9, 3.10, 3.11

Note that :py:mod:`apexpy` is NOT currently compatable with Python 3.12 or
`NumPy 2.0 <https://numpy.org/doc/stable/numpy_2_0_migration_guide.html#numpy-2-migration-guide>`_.


Advanced Installation
Expand Down
11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ description = "A Python wrapper for Apex coordinates"
maintainers = [
{name = "Angeline G. Burrell", email = "[email protected]"},
]
requires-python = ">=3.7"
requires-python = ">=3.9,<3.12"
dependencies = [
# TODO: update to "pin-compatible" once possible, see
# https://github.com/FFY00/meson-python/issues/29
"numpy>=1.19.5",
"numpy>=1.19.5,<2",
]
readme = "README.rst"
keywords = [
Expand All @@ -43,10 +43,9 @@ classifiers = [
"Programming Language :: Fortran",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries",
"Topic :: Scientific/Engineering :: Physics",
Expand All @@ -64,9 +63,11 @@ apexpy = {reference = 'apexpy.__main__:main', type = 'console'}

[project.optional-dependencies]
test = [
"coverage",
"flake8",
"pytest",
"pytest-cov",
"pytest-xdist",
"pytest-xdist"
]
doc = ["sphinx>=1.3", "sphinx-rtd-theme"]

Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ classifiers =
Operating System :: MacOS :: MacOS X
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Physics
Topic :: Utilities
Expand Down
Loading