Skip to content

Commit 5475a85

Browse files
authored
Implement Read the docs. (#181)
* Implement Read the docs. * New docs URL. * Legacy documentation message.
1 parent eaf1037 commit 5475a85

File tree

8 files changed

+39
-23
lines changed

8 files changed

+39
-23
lines changed

.readthedocs.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
build:
4+
image: latest
5+
6+
conda:
7+
environment: requirements/cf-units.yml
8+
9+
sphinx:
10+
configuration: doc/source/conf.py
11+
fail_on_warning: false
12+
13+
python:
14+
install:
15+
- method: setuptools
16+
path: .

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [cf-units](https://scitools.org.uk/cf-units/docs/latest/)
1+
# [cf-units](https://cf-units.readthedocs.io/en/latest/)
22

33
#### Units of measure as defined by the Climate and Forecast (CF) metadata conventions.
44

@@ -43,7 +43,7 @@ conventions.
4343
Provision of a wrapper class to support Unidata/UCAR UDUNITS-2 library, and the
4444
cftime calendar functionality.
4545

46-
Documentation can be found at <https://scitools.org.uk/cf-units/docs/latest/>.
46+
Documentation can be found at <https://cf-units.readthedocs.io/en/latest/>.
4747

4848
### Example
4949

doc/source/conf.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,7 @@
44
# See COPYING and COPYING.LESSER in the root of the repository for full
55
# licensing details.
66

7-
# -*- coding: utf-8 -*-
8-
#
9-
# cf_units documentation build configuration file, created by
10-
# sphinx-quickstart on Thu Jan 21 12:03:35 2016.
11-
#
12-
# This file is execfile()d with the current directory set to its
13-
# containing dir.
14-
#
15-
# Note that not all possible configuration values are present in this
16-
# autogenerated file.
17-
#
18-
# All configuration values have a default; values that are commented out
19-
# serve to show the default.
20-
21-
import cf_units
7+
from importlib import metadata
228

239
extensions = [
2410
"sphinx.ext.autodoc",
@@ -35,18 +21,13 @@
3521
project = "cf-units"
3622
copyright = "Copyright cf-units contributors"
3723

38-
39-
current_version = cf_units.__version__
24+
current_version = metadata.version("cf_units")
4025
version = current_version.split("+")[0]
4126
release = current_version
4227

43-
4428
# -- Options for HTML output ----------------------------------------------
4529

4630
html_theme = "alabaster"
4731

48-
html_static_path = ["_static"]
49-
50-
5132
# Example configuration for intersphinx: refer to the Python standard library.
5233
intersphinx_mapping = {"http://docs.python.org/": None}

doc/source/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Contents:
1414
unit
1515
utilities
1616

17+
cf-units is part of SciTools, for more information see https://scitools.org.uk/.
18+
For **cf-units 2.0** and earlier documentation please see the
19+
`legacy documentation <https://scitools.org.uk/cf-units/docs/v2.0/>`_.
1720

1821

1922
Indices and tables

requirements/py37.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ dependencies:
2525
# dev dependencies
2626
- pip
2727
- pre-commit
28+
29+
# docs dependencies
30+
- setuptools_scm
31+
- sphinx

requirements/py38.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ dependencies:
2525
# dev dependencies
2626
- pip
2727
- pre-commit
28+
29+
# docs dependencies
30+
- setuptools_scm
31+
- sphinx

requirements/py39.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ dependencies:
2525
# dev dependencies
2626
- pip
2727
- pre-commit
28+
29+
# docs dependencies
30+
- setuptools_scm
31+
- sphinx

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ python_requires =
4949
zip_safe = False
5050

5151
[options.extras_require]
52+
docs =
53+
setuptools_scm
54+
sphinx
5255
test =
5356
codecov
5457
cython
@@ -58,6 +61,7 @@ test =
5861
pytest-cov
5962
all =
6063
pre-commit
64+
%(docs)s
6165
%(test)s
6266

6367
[flake8]

0 commit comments

Comments
 (0)