diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 8166e9d..0000000 --- a/.coveragerc +++ /dev/null @@ -1,20 +0,0 @@ -[run] -cover_pylib = false -omit = - /home/travis/virtualenv/* - */site-packages/* - */bin/* - -[report] -exclude_lines = - pragma: no cover - def __repr__ - except RuntimeError - except NotImplementedError - except ImportError - except FileNotFoundError - except CalledProcessError - logging.warning - logging.error - logging.critical - if __name__ == .__main__.: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f6c0c7..11aa3d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,8 @@ name: ci env: CMAKE_BUILD_TYPE: Release + CMAKE_BUILD_PARALLEL_LEVEL: 4 + CTEST_PARALLEL_LEVEL: 0 on: push: @@ -11,47 +13,25 @@ on: jobs: - linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - - run: pip install .[tests,lint] + core: + strategy: + matrix: + os: [ubuntu-24.04, macos-latest] - - run: flake8 - - run: mypy - - - run: pytest + runs-on: ${{ matrix.os }} + env: + FC: gfortran-14 - macos: - needs: linux - runs-on: macos-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.9' - - run: pip install .[tests] - - - run: pytest - env: - FC: gfortran-11 - CC: gcc-11 - - windows: - needs: linux - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: '3.x' + - run: pip install .[tests,lint] - - run: pip install -e .[tests] + - run: flake8 + - run: mypy - run: pytest diff --git a/.lgtm.yml b/.lgtm.yml deleted file mode 100644 index b06edf3..0000000 --- a/.lgtm.yml +++ /dev/null @@ -1,4 +0,0 @@ -extraction: - python: - python_setup: - version: 3 diff --git a/.mypy.ini b/.mypy.ini deleted file mode 100644 index 73e19ab..0000000 --- a/.mypy.ini +++ /dev/null @@ -1,11 +0,0 @@ -[mypy] -files = src/ -ignore_missing_imports = True -strict_optional = False -allow_redefinition = True -show_error_context = False -show_column_numbers = True -warn_unreachable = False - -[mypy-xarray] -follow_imports = skip diff --git a/LICENSE.txt b/LICENSE.txt index 8673308..896e8df 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Michael Hirsch +Copyright (c) 2015 Scivision, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/pyproject.toml b/pyproject.toml index 90ccf9c..a6c0f9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,41 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools>=61.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "igrf" +description = "IGRF13, IGRF12, IGRF11 models with simple object-oriented Python interface." +keywords = ["geomagnetic", "igrf"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Science/Research", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Fortran", + "Topic :: Scientific/Engineering :: Atmospheric Science" +] +dynamic = ["readme", "version"] +requires-python = ">=3.9" +dependencies = ["xarray", "numpy"] + +[project.scripts] +findssh = "igrf.__main__:cli" + +[project.optional-dependencies] +tests = ["pytest"] +lint = ["flake8", "flake8-bugbear", "flake8-builtins", "flake8-blind-except", "mypy"] + +[tool.setuptools.dynamic] +readme = {file = ["README.md"], content-type = "text/markdown"} +version = {attr = "igrf.__version__"} [tool.black] line-length = 100 + +[tool.mypy] +files = "src/" +ignore_missing_imports = true +strict_optional = false +allow_redefinition = true +warn_unreachable = false diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3138c11..0000000 --- a/setup.cfg +++ /dev/null @@ -1,53 +0,0 @@ -[metadata] -name = igrf -version = 13.0.2 -author = Michael Hirsch, Ph.D. -author_email = scivision@users.noreply.github.com -description = IGRF13, IGRF12, IGRF11 models with simple object-oriented Python interface. -url = https://github.com/space-physics/igrf -keywords = - geomagnetic - igrf -classifiers = - Development Status :: 5 - Production/Stable - Environment :: Console - Intended Audience :: Science/Research - Operating System :: OS Independent - Programming Language :: Fortran - Programming Language :: Python :: 3 - Topic :: Scientific/Engineering :: Atmospheric Science -license_files = - LICENSE.txt -long_description = file: README.md -long_description_content_type = text/markdown - -[options] -python_requires = >= 3.7 -include_package_data = True -zip_safe = False -packages = find: -install_requires = - xarray - numpy -package_dir= - =src - -[options.packages.find] -where=src - -[options.extras_require] -tests = - pytest -lint = - flake8 - flake8-bugbear - flake8-builtins - flake8-blind-except - mypy - types-python-dateutil -plot = - matplotlib - -[options.entry_points] -console_scripts = - igrf = igrf.__main__:cli diff --git a/setup.py b/setup.py deleted file mode 100644 index d6e6e85..0000000 --- a/setup.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python3 -import setuptools -import site - -# PEP517 workaround -site.ENABLE_USER_SITE = True - -setuptools.setup() diff --git a/src/igrf/__init__.py b/src/igrf/__init__.py index 8619750..e586be0 100644 --- a/src/igrf/__init__.py +++ b/src/igrf/__init__.py @@ -1,5 +1,8 @@ """ use IGRF via f2py from Python """ + +__version__ = "13.0.2" + from .base import igrf, grid from .utils import mag_vector2incl_decl, latlon2colat, latlonworldgrid