Skip to content

Commit

Permalink
Merge pull request #231 from Billingegroup/doc-version-src
Browse files Browse the repository at this point in the history
feat: Configure default Python min/max version in documentation
  • Loading branch information
sbillinge authored Jan 3, 2025
2 parents a4bb51f + 6e92ce8 commit 63a9a0b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license_holders": "The Trustees of Columbia University in the City of New York",
"project_name": "diffpy.my-project",
"github_org": "diffpy",
"github_repo_name": "diffpy.my-project",
"github_repo_name": "{{ cookiecutter.project_name|replace(' ', '-')|lower }}",
"conda_pypi_package_dist_name": "{{ cookiecutter.project_name|replace(' ', '-')|lower }}",
"package_dir_name": "{{ cookiecutter.project_name|replace(' ', '_')|replace('-', '_')|lower }}",
"project_short_description": "Python package for doing science.",
Expand Down
10 changes: 10 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
sys.path.insert(0, str(Path("../..").resolve()))
sys.path.insert(0, str(Path("../../src").resolve()))

# Here provide the default values for the Python version range
PYTHON_MAX_VERSION = 3.13
PYTHON_MIN_VERSION = 3.11

# Replace e.g., |PYTHON_MAX_VERSION| with actual value in .rst files
rst_epilog = f"""
.. |PYTHON_MAX_VERSION| replace:: {PYTHON_MAX_VERSION}
.. |PYTHON_MIN_VERSION| replace:: {PYTHON_MIN_VERSION}
"""

# abbreviations
ab_authors = "Billinge Group members and community contributors"

Expand Down
2 changes: 1 addition & 1 deletion doc/source/frequently_asked_questions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ GitHub Actions
How do I set different Python versions for GitHub CI?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The default is Python 3.13 for ``_tests-on-pr.yml`` and ``_publish-docs-on-release.yml``. Python 3.11, 3.12, and 3.13 are used for ``_matrix-and-codecov-on-merge-to-main.yml``. To override the default, modify the three ``.yml`` files above in ``.github/workflows/`` as shown below:
The default Python version is |PYTHON_MAX_VERSION| for ``_tests-on-pr.yml`` and ``_publish-docs-on-release.yml``. Python |PYTHON_MIN_VERSION| through |PYTHON_MAX_VERSION| are for ``_matrix-and-codecov-on-merge-to-main.yml``. To override the default, modify the three ``.yml`` files above in ``.github/workflows/`` as shown below:

1. Add ``python_version`` in ``.github/workflows/tests-on-pr.yml``:

Expand Down
23 changes: 23 additions & 0 deletions news/doc-python-version.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Configure `PYTHON_MAX_VERSION` and `PYTHON_MIN_VERSION` in `doc/source/conf.py` to increase maintainability throughout the documentation.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>

0 comments on commit 63a9a0b

Please sign in to comment.