Repository: dh-tech/undate-python (language: python)

Issue:
consolidate tox config and setup.cfg



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index d79e325..de49a27 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -1,4 +1,4 @@
-name: style check
+name: style + docs check
 
 on:
   pull_request:
@@ -13,10 +13,10 @@ jobs:
 
     steps:
       - uses: actions/checkout@v3
-      - name: Set up Python 3.9
+      - name: Set up Python 3.10
         uses: actions/setup-python@v4
         with:
-          python-version: 3.9
+          python-version: "3.10"
           cache: 'pip'
           cache-dependency-path: '**/setup.cfg'
       - name: Install package with dependencies
@@ -24,3 +24,5 @@ jobs:
         if: steps.python-cache.outputs.cache-hit != 'true'
       - name: Run black
         run: black src --check --diff
+      - name: Check that documentation can be built
+        run: tox -e docs
diff --git a/setup.cfg b/setup.cfg
index 2dc4afd..b1dca43 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -8,13 +8,17 @@ description = "library for working with uncertain, fuzzy, or "
 long_description = file: README.md
 license="Apache License, Version 2.0",
 long_description_content_type = text/markdown
-url = https://github.com/dh-tech/hackathon-2022
+url = https://github.com/dh-tech/undate-python
 project_urls =
     Project Home = https://dh-tech.github.io
     Bug Tracker = https://github.com/dh-tech/undate-python/issues
 classifiers =
     Development Status :: 2 - Pre-Alpha
     Programming Language :: Python :: 3
+    Programming Language :: Python :: 3.8
+    Programming Language :: Python :: 3.9
+    Programming Language :: Python :: 3.10
+    Programming Language :: Python :: 3.11
     Intended Audience :: Developers
     License :: OSI Approved :: Apache Software License
     Operating System :: OS Independent
@@ -22,6 +26,13 @@ classifiers =
     Topic :: Utilities
     Typing :: Typed
 
+# When supported python versions change, update all the following places:
+# - classifiers
+# - minimum version required in python_requires
+# - tox envlist
+# - gh-actions
+# - python versions in matrix config in unit_tests.yml
+
 [options]
 package_dir =
     = src
@@ -29,6 +40,7 @@ packages = find:
 python_requires = >=3.8
 install_requires =
   python-dateutil
+
 [options.extras_require]
 all =
   %(dev)s
@@ -37,13 +49,62 @@ dev =
   black>=22.10.0
   pre-commit>=2.20.0
   tox
-  sphinx
   twine
   wheel
-  pytest-cov
+  %(docs)s
 test =
   pytest>=7.2
   pytest-ordering
+  pytest-cov
+docs =
+  sphinx
+  sphinx_rtd_theme
+  m2r2
 
 [options.packages.find]
 where = src
+
+[tox:tox]
+envlist = py38, py39, py310, py311
+isolated_build = True
+
+[gh-actions]
+python =
+    3.8: py38
+    3.9: py39
+    3.10: py310
+    3.11: py311
+
+[pytest]
+minversion = 6.0
+addopts = -ra -q
+testpaths =
+    tests
+
+[testenv]
+deps =
+    {[options.extras_require]test}
+    -e ./[test]
+commands = pytest {posargs}
+
+[testenv:flake8]
+deps =
+    flake8
+commands =
+    flake8 --ignore=E501,E402,F401 src/undate/ tests/
+
+[testenv:coverage]
+deps =
+    {[options.extras_require]test}
+commands =
+    pytest --cov=./ --cov-report=xml
+
+[testenv:docs]
+description = invoke sphinx-build to build the HTML docs
+# NOTE: base python should match whatever we're using in GitHub Actions
+basepython = python3.10
+deps =
+    -e ./[docs]
+    {[options.extras_require]docs}
+commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
+           python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
diff --git a/tox.ini b/tox.ini
deleted file mode 100644
index cb8a73e..0000000
--- a/tox.ini
+++ /dev/null
@@ -1,46 +0,0 @@
-[tox]
-envlist = py38, py39, py310, py311
-isolated_build = True
-
-[gh-actions]
-python =
-    3.8: py38
-    3.9: py39
-    3.10: py310
-    3.11: py311
-
-[pytest]
-minversion = 6.0
-addopts = -ra -q
-testpaths =
-    tests
-
-[testenv]
-deps =
-    pytest
-    -e ./[test]
-commands = pytest {posargs}
-
-[testenv:flake8]
-deps =
-    flake8
-commands =
-    flake8 --ignore=E501,E402,F401 src/undate/ tests/
-
-[testenv:coverage]
-deps =
-    pytest
-    pytest-cov
-commands =
-    pytest --cov=./ --cov-report=xml
-
-[testenv:docs]
-description = invoke sphinx-build to build the HTML docs
-basepython = python3.10
-deps =
-    -e ./[docs]
-    sphinx
-    sphinx_rtd_theme
-    m2r2
-commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
-           python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'


Test patch:
diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml
index 70b0c63..15b2668 100644
--- a/.github/workflows/unit_tests.yml
+++ b/.github/workflows/unit_tests.yml
@@ -10,7 +10,8 @@ on:
   pull_request:
 
 env:
-  COV_PYTHON_VERSION: "3.9"
+  # python version used to calculate and submit code coverage
+  COV_PYTHON_VERSION: "3.10"
 
 jobs:
   python-unit: