Skip to content

Commit

Permalink
Generate API reference
Browse files Browse the repository at this point in the history
  • Loading branch information
danilopeixoto committed Dec 12, 2021
1 parent 501b0bb commit a939428
Show file tree
Hide file tree
Showing 22 changed files with 77 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ python:
- requirements: docs/requirements.txt

sphinx:
configuration: docs/conf.py
configuration: docs/metastore/conf.py
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,17 @@ pytest --cov --cov-fail-under 80

> **Note** Set the `--cov-fail-under` flag to 80% to validate the code coverage metric.
Build package:
Generate documentation:

```
python setup.py bdist_wheel
sphinx-apidoc -f -e -T -d 2 -o docs/metastore/api-reference/ metastore/
```

Publish package:

```
twine upload dist/*
```

Build documentation:
Build documentation (optional):

```
cd docs/
sphinx-build -b html . build/
sphinx-build -b html metastore/ build/
```

## Documentation
Expand Down
2 changes: 0 additions & 2 deletions docs/changelog.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/license.md

This file was deleted.

File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
```{toctree}
:maxdepth: 2
:caption: Modules
:glob:
*
```
7 changes: 7 additions & 0 deletions docs/metastore/api-reference/metastore.package.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
metastore.package module
========================

.. automodule:: metastore.package
:members:
:undoc-members:
:show-inheritance:
19 changes: 19 additions & 0 deletions docs/metastore/api-reference/metastore.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
metastore package
=================

Submodules
----------

.. toctree::
:maxdepth: 2

metastore.package
metastore.utils

Module contents
---------------

.. automodule:: metastore
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/metastore/api-reference/metastore.utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
metastore.utils module
======================

.. automodule:: metastore.utils
:members:
:undoc-members:
:show-inheritance:
2 changes: 2 additions & 0 deletions docs/metastore/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```{include} ../../CHANGELOG.md
```
6 changes: 6 additions & 0 deletions docs/conf.py → docs/metastore/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
'sphinx.ext.autodoc',
'myst_parser'
]

autodoc_default_options = {
'special-members': True
}

source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown'
}
exclude_patterns = [
Expand Down
14 changes: 4 additions & 10 deletions docs/contributing.md → docs/metastore/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,15 @@ pytest --cov --cov-fail-under 80
Set the `--cov-fail-under` flag to 80% to validate the code coverage metric.
```

Build package:
Generate documentation:

```
python setup.py bdist_wheel
sphinx-apidoc -f -e -T -d 2 -o docs/metastore/api-reference/ metastore/
```

Publish package:

```
twine upload dist/*
```

Build documentation:
Build documentation (optional):

```
cd docs/
sphinx-build -b html . build/
sphinx-build -b html metastore/ build/
```
File renamed without changes.
4 changes: 4 additions & 0 deletions docs/metastore/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License

```{include} ../../LICENSE.md
```
File renamed without changes.
15 changes: 14 additions & 1 deletion metastore/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@
Package description information.
'''

#: Package display name.
__title__ = 'Metastore'
__version__ = '1.0.0.dev4'

#: Package version.
__version__ = '1.0.0.dev5'

#: Package description.
__description__ = 'Metastore Python SDK.'

#: Package author name.
__author__ = 'Metastore Developers'

#: Package author email.
__email__ = 'metastoredevelopers@gmail.com'

#: Package license name.
__license__ = 'BSD-3-Clause'

#: Package copyright.
__copyright__ = 'Copyright (c) 2022, Metastore Developers. All rights reserved.'


Expand Down
2 changes: 1 addition & 1 deletion metastore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def timezone_aware(date: datetime) -> datetime:
'''
Convert naive to timezone-aware datetime (UTC timezone).
Arguments:
Parameters:
date (datetime): Datetime object.
Returns:
datetime: A timezone-aware datetime.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def get_package_info(path: str) -> Dict[str, str]:
'''
Get package description information.
Arguments:
Parameters:
path (str): Path to directory defining package main module.
Returns:
Dict[str, str]: A dictionary containing package information.
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from metastore import utils


def test_timezone_aware_should_return_same_timezone_aware_datetime_with_timezone_aware_datetime_argument(): # pylint: disable=C0301
def test_timezone_aware_should_return_same_timezone_aware_datetime_with_timezone_aware_datetime_parameter(): # pylint: disable=C0301
'''
Test converting naive to timezone-aware datetime (UTC timezone)
with timezone-aware datetime argument.
with timezone-aware datetime parameter.
Raises:
AssertionError: Expected value does not match the returned value.
Expand All @@ -22,10 +22,10 @@ def test_timezone_aware_should_return_same_timezone_aware_datetime_with_timezone
assert actual_datetime == expected_datetime


def test_timezone_aware_should_return_new_timezone_aware_datetime_with_naive_timezone_datetime_argument(): # pylint: disable=C0301
def test_timezone_aware_should_return_new_timezone_aware_datetime_with_naive_timezone_datetime_parameter(): # pylint: disable=C0301
'''
Test converting naive to timezone-aware datetime (UTC timezone)
with naive datetime argument.
with naive datetime parameter.
Raises:
AssertionError: Expected value does not match the returned value.
Expand Down

0 comments on commit a939428

Please sign in to comment.