add missing tox and config files

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: Idabe9dfdc1827bf88f614b66eef1546728b15c1f
This commit is contained in:
EstherLerouzic
2025-02-25 17:05:39 +01:00
parent a4db5527e4
commit 733af3d088
11 changed files with 388 additions and 0 deletions

13
docs/biblio.bib Normal file
View File

@@ -0,0 +1,13 @@
@inproceedings{LeRouzic:21,
author = {E. Le Rouzic and A Lindgren and S. Melin and D. Provencher and R. Subramanian and R. Joyce and F. Moore and D. Reeves and A. Rambaldi and P. Kaczmarek and K. Weeks and S. Neidlinger and G. Agrawal and S. Krishnamoha and B. Raszczyk and T. Uhlar and R. Casellas and O. Gonzalez de Dios and V. Lopez},
booktitle = {Optical Fiber Communication Conference (OFC) 2021},
journal = {Optical Fiber Communication Conference (OFC) 2021},
keywords = {Erbium-doped fiber amplifiers; Modes; Optical circuits; Optical components; Optical networks; Optical systems},
pages = {M1B.2},
publisher = {Optica Publishing Group},
title = {Operationalizing partially disaggregated optical networks: An open standards-driven multi-vendor demonstration},
year = {2021},
url = {https://opg.optica.org/abstract.cfm?URI=OFC-2021-M1B.2},
doi = {10.1364/OFC.2021.M1B.2},
abstract = {We present and demonstrate service provisioning in partially disaggregated multi-vendor network automation scenarios with online physical impairment validation. This work uses and extends standard interfaces (OpenConfig and ONF Transport API) to retrieve network information interacting with TIP GNPy tool.},
}

187
docs/conf.py Normal file
View File

@@ -0,0 +1,187 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# gnpy-api documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 18 14:41:01 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.githubpages',
'sphinxcontrib.bibtex',
'sphinx.ext.graphviz',
'myst_parser',
]
myst_enable_extensions = [
"deflist",
"dollarmath",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'gnpy'
copyright = '2018 - 2025, Telecom Infra Project - OOPT PSE Group'
author = 'Telecom Infra Project - OOPT PSE Group'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme_options = {
'logo': 'images/GNPy-logo.png',
'logo_name': False,
}
html_logo = 'images/GNPy-logo.png'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
]
}
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'gnpyapidoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'gnpyapi.tex', 'GNPy API Documentation',
'Telecom Infra Project - OOPT PSE Group', 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'gnpyapi', 'GNPy API Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'gnpyapi', 'GNPy API Documentation',
author, 'gnpyapi', 'One line description of project.',
'Miscellaneous'),
]
autodoc_default_options = {
'members': True,
'undoc-members': True,
'private-members': True,
'show-inheritance': True,
}
graphviz_output_format = 'svg'
bibtex_bibfiles = ['biblio.bib']

BIN
docs/images/GNPy-logo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

20
docs/index.rst Normal file
View File

@@ -0,0 +1,20 @@
GNPy API : Optical Route Planning API
=====================================================================
`GNPy <http://github.com/telecominfraproject/oopt-gnpy-api>`_ is an open-source,
community-developped API for GNPy library.
tbd
.. toctree::
:maxdepth: 4
intro
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

4
docs/intro.rst Normal file
View File

@@ -0,0 +1,4 @@
Introduction
============
tbd

36
docs/make.bat Normal file
View File

@@ -0,0 +1,36 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=GNPyAPI
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
echo.then set the SPHINXBUILD environment variable to point to the full
echo.path of the 'sphinx-build' executable. Alternatively you may add the
echo.Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd

68
setup.cfg Normal file
View File

@@ -0,0 +1,68 @@
[metadata]
name = gnpyapi
description-file = README.md
description-content-type = text/markdown; variant=GFM
author = Telecom Infra Project
author-email = tbd
license = BSD-3-Clause
home-page = https://github.com/Telecominfraproject/oopt-gnpy-api
project_urls =
Bug Tracker = https://github.com/Telecominfraproject/oopt-gnpy-api/issues
Documentation = https://gnpyapi.readthedocs.io/
python-requires = >=3.8
classifier =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Science/Research
Intended Audience :: Telecommunications Industry
License :: OSI Approved :: BSD License
Natural Language :: English
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Physics
Topic :: System :: Networking
keywords =
optics
network
fiber
communication
route
planning
optimization
api
[pbr]
warnerrors = True
[files]
packages = gnpyapi
[options]
install_requires =
setuptools
gnpy==2.12.0
flask>=1.1.2
Flask-Injector
[options.extras_require]
tests =
build>=1.0.3,<2
pytest>=7.4.3,<8
pyang>=2.6.1,<3
docs =
alabaster>=0.7.12,<1
docutils>=0.17.1,<1
myst-parser>=0.16.1,<1
Pygments>=2.11.2,<3
rstcheck
Sphinx>=5.3.0,<6
sphinxcontrib-bibtex>=2.4.1,<3

5
setup.py Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/python3
import setuptools
setuptools.setup(setup_requires=['pbr'], pbr=True)

1
tests/__init__.py Normal file
View File

@@ -0,0 +1 @@
#!/usr/bin/env python

10
tests/test_api.py Normal file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: Esther Le Rouzic
# @Date: 2025-02-03
def test_sample():
"""Just for the ci
"""
assert True

44
tox.ini Normal file
View File

@@ -0,0 +1,44 @@
[tox]
skipsdist = True
[testenv]
extras = tests
deps =
cover: pytest-cov
linters: flake8
linters: pep8-naming
linters: mccabe
linters: flake8-noqa
linters-diff-ci: flake8-html
changedir = {toxinidir}
usedevelop = True
setenv =
cover: CI_COVERAGE_OPTS=--cov=gnpyapi --cov=tests --cov-report=
commands =
pytest {env:CI_COVERAGE_OPTS:} -vv {posargs}
cover: coverage html -d cover
cover: coverage xml -o cover/coverage.xml
python -m build
[testenv:docs]
extras = docs
allowlist_externals =
/bin/sh
commands =
sphinx-build -E -W --keep-going -q -b html docs/ doc/build/html
/bin/sh -c "rstcheck --ignore-roles cite docs/*.rst"
[testenv:linters]
commands =
flake8 {posargs}
[testenv:linters-diff-ci]
allowlist_externals = bash
commands =
flake8 {posargs} --format html --htmldir linters --exit-zero
bash -c "git diff -U0 origin/$(git rev-parse --abbrev-ref HEAD) | flake8 --diff {posargs}"
[flake8]
max-line-length = 120
max-complexity = 15
ignore = N806 W503