From 272bc8fe186d46c156768e61929d1deb724ebd26 Mon Sep 17 00:00:00 2001 From: nstarman Date: Sun, 22 May 2022 23:24:51 -0400 Subject: [PATCH 1/2] switch to tomli Signed-off-by: nstarman --- docs/conf.py | 10 +- pyproject.toml | 285 ++++++++++++++++++++++++++----------------------- tox.ini | 4 +- 3 files changed, 158 insertions(+), 141 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 8bb27c9..348b32b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,7 +32,7 @@ from importlib import import_module # THIRD PARTY -import tomlkit +import tomli from sphinx_astropy.conf.v1 import * # noqa: F401, F403 from sphinx_astropy.conf.v1 import ( exclude_patterns, @@ -44,8 +44,8 @@ # Get configuration information from pyproject.toml path = pathlib.Path(__file__).parent.parent / "pyproject.toml" -with path.open() as f: - toml = tomlkit.load(f) +with path.open(mode="rb") as f: + toml = tomli.load(f) setup_cfg = toml["project"] # -- General configuration ---------------------------------------------------- @@ -193,14 +193,14 @@ # -- Resolving issue number to links in changelog ----------------------------- -github_issues_url = setup_cfg["urls"]["repository"] + "/issues/" +github_issues_url = setup_cfg["urls"][0]["repository"] + "/issues/" # -- Options for linkcheck output ------------------------------------------- linkcheck_retry = 5 linkcheck_ignore = [ - setup_cfg["urls"]["repository"] + r"/(?:issues|pull)/\d+", + setup_cfg["urls"][0]["repository"] + r"/(?:issues|pull)/\d+", ] linkcheck_timeout = 180 linkcheck_anchors = False diff --git a/pyproject.toml b/pyproject.toml index 6dae6fe..502d7fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,152 +1,167 @@ -[project] -name = "interpolated_coordinates" -version = "0.1.0" -description = "Univariate Interpolations of Astropy Coordinates" -readme = "README.rst" -requires-python = ">=3.8" -license = {file = "licenses/LICENSE.rst"} -keywords = ["interpolate", "interpolation", "coordinates", "astronomy"] -authors = [ - {name = "Nathaniel Starkman"} -] -maintainers = [ - {name = "Nathaniel Starkman", email = "n.starkman@mail.utoronto.ca"} -] -classifiers = [ - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Topic :: Scientific/Engineering :: Astronomy", - "Topic :: Scientific/Engineering :: Physics", -] -dependencies = [ - "astropy>=5.0", - "numpy", - "scipy", -] - [build-system] -requires = [ - "setuptools>=45", - "setuptools_scm>=6.2", - "extension_helpers", - "wheel" -] + requires = [ + "extension_helpers", + "oldest-supported-numpy", + "setuptools>=45", + "setuptools_scm>=6.2", + "wheel", + ] + + build-backend = 'setuptools.build_meta' + +[project] + name = "interpolated_coordinates" + version = "0.1.0" + description = "Univariate Interpolations of Astropy Coordinates" + readme = "README.rst" + requires-python = ">=3.8" + license = {file = "licenses/LICENSE.rst"} + keywords = ["interpolate", "interpolation", "coordinates", "astronomy"] + authors = [ + {name = "Nathaniel Starkman", email = "n.starkman@mail.utoronto.ca"} + ] + maintainers = [ + {name = "Nathaniel Starkman", email = "n.starkman@mail.utoronto.ca"} + ] + classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Astronomy", + "Topic :: Scientific/Engineering :: Physics", + ] + dependencies = [ + "astropy>=5.0", + "numpy>=1.18", + "scipy", + ] + + [[project.optional-dependencies]] + test = [ + "coverage[toml]", + "matplotlib", + "pytest", + "pytest-astropy", + ] + docs = [ + "graphviz", + "matplotlib", + "sphinx-astropy", + "sphinx", + "tomli", + ] + + [[project.urls]] + homepage = "https://github.com/nstarman/interpolated-coordinates" + repository = "https://github.com/nstarman/interpolated-coordinates" + documentation = "https://github.com/nstarman/interpolated-coordinates" -build-backend = 'setuptools.build_meta' [tool.setuptools] -package-dir = {"" = "src"} + package-dir = {"" = "src"} [tool.setuptools_scm] -[project.optional-dependencies] -test = [ - "coverage[toml]", - "matplotlib", - "pytest", - "pytest-astropy", -] -docs = [ - "graphviz", - "matplotlib", - "sphinx-astropy", - "sphinx", - "tomlkit", -] - -[project.urls] -repository = "https://github.com/nstarman/interpolated-coordinates" -documentation = "https://github.com/nstarman/interpolated-coordinates" - [tool.autopep8] -max_line_length = 100 -in-place = true -recursive = true + max_line_length = 100 + in-place = true + recursive = true [tool.black] -line-length = 100 -include = '\.pyi?$' -exclude = ''' -/( - \.git - | \.hg - | \.mypy_cache - | \.tox - | \.venv - | _build - | buck-out - | build - | dist -)/ -''' + line-length = 100 + include = '\.pyi?$' + exclude = ''' + /( + \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | _build + | buck-out + | build + | dist + )/ + ''' [tool.isort] -line_length = 100 -multi_line_output = 3 -include_trailing_comma = "True" -force_grid_wrap = 0 -use_parentheses = "True" -ensure_newline_before_comments = "True" -sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] -known_localfolder = "interpolated_coordinates" -known_third_party = ["astropy", "interpolated_coordinates", "matplotlib", "numpy", "pytest", "scipy"] -import_heading_stdlib = "STDLIB" -import_heading_thirdparty = "THIRD PARTY" -import_heading_localfolder = "LOCAL" + profile = "black" + line_length = 100 + multi_line_output = 3 + include_trailing_comma = "True" + force_grid_wrap = 0 + use_parentheses = "True" + ensure_newline_before_comments = "True" + sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] + known_localfolder = "interpolated_coordinates" + known_third_party = ["astropy", "interpolated_coordinates", "matplotlib", "numpy", "pytest", "scipy"] + import_heading_stdlib = "STDLIB" + import_heading_thirdparty = "THIRD PARTY" + import_heading_localfolder = "LOCAL" [tool.mypy] -disallow_untyped_defs = true -ignore_missing_imports = true -no_implicit_optional = true -warn_return_any = true -warn_redundant_casts = true -warn_unused_configs = true -warn_unreachable = true -exclude = '''(^|/)tests/''' - -[tool.pytest.ini_options] -testpaths = [ - "src/interpolated_coordinates", - "docs", -] -astropy_header = "True" -doctest_plus = "enabled" -text_file_format = "rst" -addopts = "--doctest-rst" -filterwarnings = [ - # tomlkit - "ignore:The config value `project' has type `String', defaults to `str'.", - "ignore:The config value `htmlhelp_basename' has type `String', defaults to `str'.", -] - -[tool.coverage.run] -omit = [ - "*/interpolated_coordinates/_astropy_init*", - "*/interpolated_coordinates/conftest.py", - "*/interpolated_coordinates/*setup_package*", - "*/interpolated_coordinates/tests/*", - "*/interpolated_coordinates/*/tests/*", - "*/interpolated_coordinates/_version*", -] - -[tool.coverage.report] -exclude_lines = [ - # Have to re-enable the standard pragma - "pragma: no cover", - # Don't complain about packages we have installed - "except ImportError", - # Don't complain if tests don't hit assertions - "raise AssertionError", - "raise NotImplementedError", - # Don't complain about script hooks - "'def main(.*):'", - # Ignore branches that don't pertain to this version of Python - "pragma: py{ignore_python_version}", - # Don't complain about IPython completion helper - "def _ipython_key_completions_", -] + disallow_untyped_defs = true + ignore_missing_imports = true + no_implicit_optional = true + warn_return_any = true + warn_redundant_casts = true + warn_unused_configs = true + warn_unreachable = true + exclude = '''(^|/)tests/''' + + [[tool.mypy.overrides]] + module = "*/tests/*" + ignore_errors = true + + [[tool.mypy.overrides]] + module = "docs/*" + ignore_errors = true + + +[tool.pytest] + + [[tool.pytest.ini_options]] + testpaths = ["src/interpolated_coordinates", "docs"] + astropy_header = "True" + doctest_plus = "enabled" + text_file_format = "rst" + addopts = "--doctest-rst" + filterwarnings = [ + # tomlkit + "ignore:The config value `project' has type `String', defaults to `str'.", + "ignore:The config value `htmlhelp_basename' has type `String', defaults to `str'.", + ] + + +[tool.coverage] + + [[tool.coverage.run]] + omit = [ + "*/interpolated_coordinates/_astropy_init*", + "*/interpolated_coordinates/conftest.py", + "*/interpolated_coordinates/*setup_package*", + "*/interpolated_coordinates/tests/*", + "*/interpolated_coordinates/*/tests/*", + "*/interpolated_coordinates/_version*", + ] + + [[tool.coverage.report]] + exclude_lines = [ + # Have to re-enable the standard pragma + "pragma: no cover", + # Don't complain about packages we have installed + "except ImportError", + # Don't complain if tests don't hit assertions + "raise AssertionError", + "raise NotImplementedError", + # Don't complain about script hooks + "'def main(.*):'", + # Ignore branches that don't pertain to this version of Python + "pragma: py{ignore_python_version}", + # Don't complain about IPython completion helper + "def _ipython_key_completions_", + ] diff --git a/tox.ini b/tox.ini index a2c9f6e..2bf1abe 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{38,39,310}-test{,-image,-alldeps,-oldestdeps,-devdeps}{,-cov}{,-clocale} - py{38,39,310}-test-numpy{118,119,120,121} + py{38,39,310}-test-numpy{118,119,120,121,122} py{38,39,310}-test-astropy{50,lts} build_docs linkcheck @@ -45,6 +45,7 @@ description = numpy119: with numpy 1.19.* numpy120: with numpy 1.20.* numpy121: with numpy 1.21.* + numpy122: with numpy 1.22.* astropy50: with astropy 5.0.* astropylts: with the latest astropy LTS double: twice in a row to check for global state changes @@ -55,6 +56,7 @@ deps = numpy119: numpy==1.19.* numpy120: numpy==1.20.* numpy121: numpy==1.21.* + numpy122: numpy==1.22.* astropy50: astropy==5.0.* astropylts: astropy==5.0.* From 391d3517fa71b1c6d180fa0946d6c5bff44baa7a Mon Sep 17 00:00:00 2001 From: nstarman Date: Mon, 23 May 2022 01:28:03 -0400 Subject: [PATCH 2/2] fix format Signed-off-by: nstarman --- pyproject.toml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 502d7fb..d1cd486 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,25 +37,25 @@ "scipy", ] - [[project.optional-dependencies]] - test = [ - "coverage[toml]", - "matplotlib", - "pytest", - "pytest-astropy", - ] - docs = [ - "graphviz", - "matplotlib", - "sphinx-astropy", - "sphinx", - "tomli", - ] +[project.optional-dependencies] + test = [ + "coverage[toml]", + "matplotlib", + "pytest", + "pytest-astropy", + ] + docs = [ + "graphviz", + "matplotlib", + "sphinx-astropy", + "sphinx", + "tomli", + ] - [[project.urls]] - homepage = "https://github.com/nstarman/interpolated-coordinates" - repository = "https://github.com/nstarman/interpolated-coordinates" - documentation = "https://github.com/nstarman/interpolated-coordinates" +[project.urls] + homepage = "https://interpolated-coordinates.readthedocs.io/en/latest/" + repository = "https://github.com/GalOrrery/interpolated-coordinates" + documentation = "https://interpolated-coordinates.readthedocs.io/en/latest/" [tool.setuptools]