diff --git a/.github/workflows/generate_docs.yml b/.github/workflows/generate_docs.yml index 567ee3d09..b2f2f8152 100644 --- a/.github/workflows/generate_docs.yml +++ b/.github/workflows/generate_docs.yml @@ -15,7 +15,7 @@ jobs: uses: actions/setup-python@v5 id: setup-python with: - python-version: "3.9" + python-version: "3.11" - name: Set up Poetry uses: Gr1N/setup-poetry@v9 with: diff --git a/.readthedocs.yml b/.readthedocs.yml index 542539f05..d2ab01404 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,16 +3,14 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.9" + python: "3.11" + jobs: + post_create_environment: + - pip install poetry==1.8.2 + post_install: + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --only main,docs sphinx: configuration: docs/conf.py - -python: - install: - - method: pip - path: . - extra_requirements: - - docs \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b4fc1c3c4..abfe8a46f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ All notable changes to this project will be documented in this file. * ... * ### Major Changes - * ... + * Removed the `docs` extra and converted it to a Poetry dependency group. * ### Known Issues * ... diff --git a/docs/conf.py b/docs/conf.py index f75d78ef9..82ebabd2e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,24 +1,27 @@ """Sphinx Configuration File.""" -import datetime import os import pathlib import sys + import toml -sys.path.insert(0, os.path.abspath('../')) +sys.path.insert(0, os.path.abspath("../")) # -- General configuration ------------------------------------------------ -extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.coverage', - 'sphinx.ext.viewcode', - 'sphinx.ext.napoleon'] +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.coverage", + "sphinx.ext.intersphinx", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", +] -source_suffix = '.rst' +source_suffix = ".rst" -master_doc = 'index' +master_doc = "index" root_path = pathlib.Path(__file__).parent.parent pyproj_file = root_path / "pyproject.toml" @@ -27,57 +30,70 @@ project = proj_config["tool"]["poetry"]["name"] company = "National Instruments" author = company -copyright = f"{datetime.datetime.now().year}, {company}" +copyright = f"2017-%Y, {company}" # Release is the full version, version is only the major component release = proj_config["tool"]["poetry"]["version"] version = ".".join(release.split(".")[:2]) description = proj_config["tool"]["poetry"]["description"] -language = 'en' +language = "en" -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] -pygments_style = 'sphinx' +pygments_style = "sphinx" todo_include_todos = False +intersphinx_mapping = { + "grpc": ("https://grpc.github.io/grpc/python/", None), + "numpy": ("https://numpy.org/doc/stable/", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), + "python": ("https://docs.python.org/3", None), +} # -- Options for HTML output ---------------------------------------------- -html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" html_static_path = [] # -- Options for HTMLHelp output ------------------------------------------ -htmlhelp_basename = 'NI-DAQmxPythonAPIdoc' +htmlhelp_basename = "NI-DAQmxPythonAPIdoc" # -- Options for LaTeX output --------------------------------------------- -latex_elements = { -} +latex_elements = {} latex_documents = [ - (master_doc, 'NI-DAQmxPythonAPI.tex', 'NI-DAQmx Python API Documentation', - 'National Instruments', 'manual'), + ( + master_doc, + "NI-DAQmxPythonAPI.tex", + "NI-DAQmx Python API Documentation", + "National Instruments", + "manual", + ), ] # -- Options for manual page output --------------------------------------- -man_pages = [ - (master_doc, 'ni-daqmxpythonapi', 'NI-DAQmx Python API Documentation', - [author], 1) -] +man_pages = [(master_doc, "ni-daqmxpythonapi", "NI-DAQmx Python API Documentation", [author], 1)] # -- Options for Texinfo output ------------------------------------------- texinfo_documents = [ - (master_doc, 'NI-DAQmxPythonAPI', 'NI-DAQmx Python API Documentation', - author, 'NI-DAQmxPythonAPI', 'One line description of project.', - 'Miscellaneous'), + ( + master_doc, + "NI-DAQmxPythonAPI", + "NI-DAQmx Python API Documentation", + author, + "NI-DAQmxPythonAPI", + "One line description of project.", + "Miscellaneous", + ), ] diff --git a/poetry.lock b/poetry.lock index 8c4a3096f..10033275a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -4,7 +4,7 @@ name = "alabaster" version = "0.7.16" description = "A light, configurable Sphinx theme" -optional = true +optional = false python-versions = ">=3.9" files = [ {file = "alabaster-0.7.16-py3-none-any.whl", hash = "sha256:b46733c07dce03ae4e150330b975c75737fa60f0a7c591b6c8bf4928a28e2c92"}, @@ -15,7 +15,7 @@ files = [ name = "babel" version = "2.17.0" description = "Internationalization utilities" -optional = true +optional = false python-versions = ">=3.8" files = [ {file = "babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2"}, @@ -472,7 +472,7 @@ files = [ name = "docutils" version = "0.21.2" description = "Docutils -- Python Documentation Utilities" -optional = true +optional = false python-versions = ">=3.9" files = [ {file = "docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2"}, @@ -950,36 +950,13 @@ all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2 name = "imagesize" version = "1.4.1" description = "Getting image size from png/jpeg/jpeg2000/gif file" -optional = true +optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, ] -[[package]] -name = "importlib-metadata" -version = "8.7.0" -description = "Read metadata from Python packages" -optional = true -python-versions = ">=3.9" -files = [ - {file = "importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd"}, - {file = "importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000"}, -] - -[package.dependencies] -zipp = ">=3.20" - -[package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] -cover = ["pytest-cov"] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -enabler = ["pytest-enabler (>=2.2)"] -perf = ["ipython"] -test = ["flufl.flake8", "importlib_resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] -type = ["pytest-mypy"] - [[package]] name = "importlib-resources" version = "6.5.2" @@ -1032,7 +1009,7 @@ plugins = ["setuptools"] name = "jinja2" version = "3.1.6" description = "A very fast and expressive template engine." -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"}, @@ -2139,6 +2116,21 @@ typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.1 [package.extras] jupyter = ["ipywidgets (>=7.5.1,<9)"] +[[package]] +name = "roman-numerals-py" +version = "3.1.0" +description = "Manipulate well-formed Roman numerals" +optional = false +python-versions = ">=3.9" +files = [ + {file = "roman_numerals_py-3.1.0-py3-none-any.whl", hash = "sha256:9da2ad2fb670bcf24e81070ceb3be72f6c11c440d73bd579fbeca1e9f330954c"}, + {file = "roman_numerals_py-3.1.0.tar.gz", hash = "sha256:be4bf804f083a4ce001b5eb7e3c0862479d10f94c936f6c4e5f250aa5ff5bd2d"}, +] + +[package.extras] +lint = ["mypy (==1.15.0)", "pyright (==1.1.394)", "ruff (==0.9.7)"] +test = ["pytest (>=8)"] + [[package]] name = "setuptools" version = "80.0.0" @@ -2183,45 +2175,44 @@ files = [ [[package]] name = "sphinx" -version = "7.4.7" +version = "8.2.3" description = "Python documentation generator" -optional = true -python-versions = ">=3.9" +optional = false +python-versions = ">=3.11" files = [ - {file = "sphinx-7.4.7-py3-none-any.whl", hash = "sha256:c2419e2135d11f1951cd994d6eb18a1835bd8fdd8429f9ca375dc1f3281bd239"}, - {file = "sphinx-7.4.7.tar.gz", hash = "sha256:242f92a7ea7e6c5b406fdc2615413890ba9f699114a9c09192d7dfead2ee9cfe"}, + {file = "sphinx-8.2.3-py3-none-any.whl", hash = "sha256:4405915165f13521d875a8c29c8970800a0141c14cc5416a38feca4ea5d9b9c3"}, + {file = "sphinx-8.2.3.tar.gz", hash = "sha256:398ad29dee7f63a75888314e9424d40f52ce5a6a87ae88e7071e80af296ec348"}, ] [package.dependencies] -alabaster = ">=0.7.14,<0.8.0" +alabaster = ">=0.7.14" babel = ">=2.13" colorama = {version = ">=0.4.6", markers = "sys_platform == \"win32\""} docutils = ">=0.20,<0.22" imagesize = ">=1.3" -importlib-metadata = {version = ">=6.0", markers = "python_version < \"3.10\""} Jinja2 = ">=3.1" packaging = ">=23.0" Pygments = ">=2.17" requests = ">=2.30.0" +roman-numerals-py = ">=1.0.0" snowballstemmer = ">=2.2" -sphinxcontrib-applehelp = "*" -sphinxcontrib-devhelp = "*" -sphinxcontrib-htmlhelp = ">=2.0.0" -sphinxcontrib-jsmath = "*" -sphinxcontrib-qthelp = "*" +sphinxcontrib-applehelp = ">=1.0.7" +sphinxcontrib-devhelp = ">=1.0.6" +sphinxcontrib-htmlhelp = ">=2.0.6" +sphinxcontrib-jsmath = ">=1.0.1" +sphinxcontrib-qthelp = ">=1.0.6" sphinxcontrib-serializinghtml = ">=1.1.9" -tomli = {version = ">=2", markers = "python_version < \"3.11\""} [package.extras] docs = ["sphinxcontrib-websupport"] -lint = ["flake8 (>=6.0)", "importlib-metadata (>=6.0)", "mypy (==1.10.1)", "pytest (>=6.0)", "ruff (==0.5.2)", "sphinx-lint (>=0.9)", "tomli (>=2)", "types-docutils (==0.21.0.20240711)", "types-requests (>=2.30.0)"] -test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=8.0)", "setuptools (>=70.0)", "typing_extensions (>=4.9)"] +lint = ["betterproto (==2.0.0b6)", "mypy (==1.15.0)", "pypi-attestations (==0.0.21)", "pyright (==1.1.395)", "pytest (>=8.0)", "ruff (==0.9.9)", "sphinx-lint (>=0.9)", "types-Pillow (==10.2.0.20240822)", "types-Pygments (==2.19.0.20250219)", "types-colorama (==0.4.15.20240311)", "types-defusedxml (==0.7.0.20240218)", "types-docutils (==0.21.0.20241128)", "types-requests (==2.32.0.20241016)", "types-urllib3 (==1.26.25.14)"] +test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=8.0)", "pytest-xdist[psutil] (>=3.4)", "setuptools (>=70.0)", "typing_extensions (>=4.9)"] [[package]] name = "sphinx-rtd-theme" version = "3.0.2" description = "Read the Docs theme for Sphinx" -optional = true +optional = false python-versions = ">=3.8" files = [ {file = "sphinx_rtd_theme-3.0.2-py2.py3-none-any.whl", hash = "sha256:422ccc750c3a3a311de4ae327e82affdaf59eb695ba4936538552f3b00f4ee13"}, @@ -2240,7 +2231,7 @@ dev = ["bump2version", "transifex-client", "twine", "wheel"] name = "sphinxcontrib-applehelp" version = "2.0.0" description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" -optional = true +optional = false python-versions = ">=3.9" files = [ {file = "sphinxcontrib_applehelp-2.0.0-py3-none-any.whl", hash = "sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5"}, @@ -2256,7 +2247,7 @@ test = ["pytest"] name = "sphinxcontrib-devhelp" version = "2.0.0" description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp documents" -optional = true +optional = false python-versions = ">=3.9" files = [ {file = "sphinxcontrib_devhelp-2.0.0-py3-none-any.whl", hash = "sha256:aefb8b83854e4b0998877524d1029fd3e6879210422ee3780459e28a1f03a8a2"}, @@ -2272,7 +2263,7 @@ test = ["pytest"] name = "sphinxcontrib-htmlhelp" version = "2.1.0" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" -optional = true +optional = false python-versions = ">=3.9" files = [ {file = "sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl", hash = "sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8"}, @@ -2288,7 +2279,7 @@ test = ["html5lib", "pytest"] name = "sphinxcontrib-jquery" version = "4.1" description = "Extension to include jQuery on newer Sphinx releases" -optional = true +optional = false python-versions = ">=2.7" files = [ {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, @@ -2302,7 +2293,7 @@ Sphinx = ">=1.8" name = "sphinxcontrib-jsmath" version = "1.0.1" description = "A sphinx extension which renders display math in HTML via JavaScript" -optional = true +optional = false python-versions = ">=3.5" files = [ {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, @@ -2316,7 +2307,7 @@ test = ["flake8", "mypy", "pytest"] name = "sphinxcontrib-qthelp" version = "2.0.0" description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp documents" -optional = true +optional = false python-versions = ">=3.9" files = [ {file = "sphinxcontrib_qthelp-2.0.0-py3-none-any.whl", hash = "sha256:b18a828cdba941ccd6ee8445dbe72ffa3ef8cbe7505d8cd1fa0d42d3f2d5f3eb"}, @@ -2332,7 +2323,7 @@ test = ["defusedxml (>=0.7.1)", "pytest"] name = "sphinxcontrib-serializinghtml" version = "2.0.0" description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)" -optional = true +optional = false python-versions = ">=3.9" files = [ {file = "sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl", hash = "sha256:6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331"}, @@ -2572,10 +2563,9 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", type = ["pytest-mypy"] [extras] -docs = ["Sphinx", "sphinx_rtd_theme", "toml"] grpc = ["grpcio", "protobuf"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "dad86e4d157651379c51a35f0fbfe22c34dbe6de8e209477ea97633beb6c916a" +content-hash = "e8553dbf39bba488fa6f594810f54a8392bf0579e44eba588d74466e6a3ca120" diff --git a/pyproject.toml b/pyproject.toml index b04cba27a..e7bcd3c40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,28 +4,32 @@ version = "1.2.0-dev0" license = "MIT" description = "NI-DAQmx Python API" authors = ["NI "] -maintainers = ["Zach Hindes ", "Maxx Boehme ", "Brad Keryan "] +maintainers = [ + "Zach Hindes ", + "Maxx Boehme ", + "Brad Keryan ", +] readme = "README.rst" repository = "https://github.com/ni/nidaqmx-python" documentation = "https://nidaqmx-python.readthedocs.io" keywords = ["nidaqmx", "nidaq", "daqmx", "daq"] classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Intended Audience :: Manufacturing", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: System :: Hardware :: Hardware Drivers" + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Manufacturing", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: System :: Hardware :: Hardware Drivers", ] exclude = ["nidaqmx/tests"] packages = [{ include = "nidaqmx", from = "generated" }] @@ -33,20 +37,14 @@ packages = [{ include = "nidaqmx", from = "generated" }] [tool.poetry.dependencies] python = "^3.9" numpy = [ - {version = ">=1.22", python = ">=3.9,<3.12"}, - {version = ">=1.26", python = ">=3.12,<3.13"}, - {version = ">=2.1", python = "^3.13"}, + { version = ">=1.22", python = ">=3.9,<3.12" }, + { version = ">=1.26", python = ">=3.12,<3.13" }, + { version = ">=2.1", python = "^3.13" }, ] deprecation = ">=2.1" -# Documentation, must be in main dependencies (but optional) list for -# readthedocs integration. -# See https://github.com/readthedocs/readthedocs.org/issues/4912. -Sphinx = {version=">=5.0", optional=true} -sphinx_rtd_theme = {version=">=1.0", optional=true} -grpcio = {version=">=1.49.0,<2.0", optional=true} -protobuf = {version=">=4.21", optional=true} +grpcio = { version = ">=1.49.0,<2.0", optional = true } +protobuf = { version = ">=4.21", optional = true } hightime = "^0.2.2" -toml = {version=">=0.10.2", optional=true} tzlocal = "^5.0" python-decouple = ">=3.8" click = ">=8.0.0" @@ -55,25 +53,32 @@ requests = ">=2.25.0" [tool.poetry.extras] -docs = ["sphinx", "sphinx_rtd_theme", "toml"] grpc = ["grpcio", "protobuf"] [tool.poetry.group.codegen.dependencies] click = "^8.1" Mako = "^1.2" grpcio-tools = [ - {version = "1.49.1", python = ">=3.9,<3.12"}, - {version = "1.59.0", python = ">=3.12,<3.13"}, - {version = "1.67.0", python = "^3.13"}, + { version = "1.49.1", python = ">=3.9,<3.12" }, + { version = "1.59.0", python = ">=3.12,<3.13" }, + { version = "1.67.0", python = "^3.13" }, ] mypy-protobuf = ">=3.4" +[tool.poetry.group.docs] +optional = true + +[tool.poetry.group.docs.dependencies] +Sphinx = { version = ">=8.2", python = "^3.11" } +sphinx-rtd-theme = ">=1.0.0" +toml = ">=0.10.2" + [tool.poetry.group.examples] # The "examples" group is optional because matplotlib does not distribute wheels for 32-bit Windows. optional = true [tool.poetry.group.examples.dependencies] -matplotlib = {version=">=3.9.0", python = ">=3.9"} +matplotlib = { version = ">=3.9.0", python = ">=3.9" } nptdms = ">=1.9.0" [tool.poetry.group.lint.dependencies] diff --git a/tox.ini b/tox.ini index 49425f32e..d055ebd2c 100644 --- a/tox.ini +++ b/tox.ini @@ -36,9 +36,9 @@ commands = [testenv:docs] # base_python should match the version specified in .readthedocs.yml and the PR workflow. -base_python = python3.9 +base_python = python3.11 commands = poetry run python --version - poetry install -v --only main --extras docs + poetry install -v --only main,docs # Use -W to treat warnings as errors. poetry run sphinx-build -b html -W docs docs/_build