Skip to content

switch to tomli #22

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 ----------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down
283 changes: 149 additions & 134 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"}
]
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"
]

build-backend = 'setuptools.build_meta'
requires = [
"extension_helpers",
"oldest-supported-numpy",
"setuptools>=45",
"setuptools_scm>=6.2",
"wheel",
]

[tool.setuptools]
package-dir = {"" = "src"}
build-backend = 'setuptools.build_meta'

[tool.setuptools_scm]
[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 = "[email protected]"}
]
maintainers = [
{name = "Nathaniel Starkman", email = "[email protected]"}
]
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",
"tomlkit",
]
test = [
"coverage[toml]",
"matplotlib",
"pytest",
"pytest-astropy",
]
docs = [
"graphviz",
"matplotlib",
"sphinx-astropy",
"sphinx",
"tomli",
]

[project.urls]
repository = "https://github.com/nstarman/interpolated-coordinates"
documentation = "https://github.com/nstarman/interpolated-coordinates"
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]
package-dir = {"" = "src"}

[tool.setuptools_scm]


[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_",
]
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.*
Expand Down