Skip to content

Commit

Permalink
Add extra requires and enable readthedocs config (#143)
Browse files Browse the repository at this point in the history
Extend `setup.py` with extra requires, update the contribute page
accordingly. Enable readthedocs config with the docs requires.
  • Loading branch information
psss authored Nov 3, 2021
1 parent 173d27c commit 0dd2c38
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Config for building https://fmf.readthedocs.io/
version: 2
python:
install:
- method: pip
path: .
extra_requirements: [docs]
9 changes: 7 additions & 2 deletions docs/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ your commits to the project::
pip install pre-commit
pre-commit install

Or simply install all extra dependencies to make sure you have
everything needed for the development ready on your system::

pip install '.[all]'


Makefile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -121,15 +126,15 @@ To run tests using pytest with the test coverage overview::
Install pytest and coverage using dnf or pip::

dnf install python3-pytest python3-coverage
pip install pytest coveralls
pip install .[tests]


Docs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For building documentation locally install necessary modules::

pip install sphinx sphinx_rtd_theme mock
pip install .[docs]

Make sure docutils are installed in order to build man pages::

Expand Down
17 changes: 14 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,20 @@
__provides__ = ['fmf']
__desc__ = 'Flexible Metadata Format'
__scripts__ = ['bin/fmf']
__irequires__ = [

# Prepare install requires and extra requires
install_requires = [
'PyYAML',
'filelock'
]
]
extras_require = {
'docs': ['sphinx>=3', 'sphinx_rtd_theme'],
'tests': ['pytest', 'python-coveralls', 'pre-commit'],
}
extras_require['all'] = [
dependency
for extra in extras_require.values()
for dependency in extra]

pip_src = 'https://pypi.python.org/packages/source'
__deplinks__ = []
Expand Down Expand Up @@ -56,7 +66,8 @@
keywords=['metadata', 'testing'],
dependency_links=__deplinks__,
description=__desc__,
install_requires=__irequires__,
install_requires=install_requires,
extras_require=extras_require,
name=__pkg__,
package_dir=__pkgdir__,
packages=__pkgs__,
Expand Down

0 comments on commit 0dd2c38

Please sign in to comment.