File tree Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 3
3
"""
4
4
5
5
import datetime
6
- from importlib . metadata import metadata
6
+ import importlib
7
7
8
- # ruff: isort: off
9
- from sphinx_gallery .sorting import ExplicitOrder , ExampleTitleSortKey
10
- from pygmt .clib import required_gmt_version
8
+ from packaging .requirements import Requirement
11
9
from pygmt import __commit__ , __version__
10
+ from pygmt .clib import required_gmt_version
12
11
from pygmt .sphinx_gallery import PyGMTScraper
12
+ from sphinx_gallery .sorting import ExampleTitleSortKey , ExplicitOrder
13
13
14
- # ruff: isort: on
15
-
16
- requires_python = metadata ("pygmt" )["Requires-Python" ]
17
- requires_gmt = f">={ required_gmt_version } "
14
+ # Dictionary for dependency name and minimum required version.
15
+ requirements = {
16
+ Requirement (requirement ).name : str (Requirement (requirement ).specifier )
17
+ for requirement in importlib .metadata .requires ("pygmt" )
18
+ }
19
+ requirements .update (
20
+ {
21
+ "python" : importlib .metadata .metadata ("pygmt" )["Requires-Python" ],
22
+ "gmt" : f">={ required_gmt_version } " ,
23
+ }
24
+ )
18
25
19
26
extensions = [
20
27
"myst_parser" ,
51
58
]
52
59
# These enable substitutions using {{ key }} in the Markdown files
53
60
myst_substitutions = {
54
- "requires_python" : requires_python ,
55
- "requires_gmt" : requires_gmt ,
61
+ "requires" : requirements ,
56
62
}
57
63
58
64
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ development version.
59
59
60
60
## Which Python?
61
61
62
- PyGMT is tested to run on Python {{ requires_python }}.
62
+ PyGMT is tested to run on Python {{ requires.python }}.
63
63
64
64
We recommend using the [ Miniforge] ( https://github.com/conda-forge/miniforge#miniforge3 )
65
65
Python distribution to ensure you have all dependencies installed and
@@ -69,7 +69,7 @@ your computer and doesn't interfere with any other Python installations on your
69
69
70
70
## Which GMT?
71
71
72
- PyGMT requires Generic Mapping Tools (GMT) {{ requires_gmt }} since there are many
72
+ PyGMT requires Generic Mapping Tools (GMT) {{ requires.gmt }} since there are many
73
73
changes being made to GMT itself in response to the development of PyGMT.
74
74
75
75
Compiled conda packages of GMT for Linux, macOS and Windows are provided through
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ after their initial release.
12
12
13
13
| PyGMT Version | GMT | Python | NumPy | Pandas | Xarray |
14
14
| ---| ---| ---| ---| ---| ---|
15
- | [ Dev] [ ] * [[ Docs] [ Docs Dev ]] | >=6.3.0 | >=3.10 | >=1.24 | >=1.5 | >=2022.09 |
15
+ | [ Dev] [ ] * [[ Docs] [ Docs Dev ]] | {{ requires.gmt }} | {{ requires.python }} | {{ requires.numpy }} | {{ requires.pandas }} | {{ requires.xarray }} |
16
16
| [ v0.12.0] [ ] [[ Docs] [ Docs v0.12.0 ]] | >=6.3.0 | >=3.10 | >=1.23 | >=1.5 | >=2022.06 |
17
17
| [ v0.11.0] [ ] [[ Docs] [ Docs v0.11.0 ]] | >=6.3.0 | >=3.9 | >=1.23 | | |
18
18
| [ v0.10.0] [ ] [[ Docs] [ Docs v0.10.0 ]] | >=6.3.0 | >=3.9 | >=1.22 | | |
You can’t perform that action at this time.
0 commit comments