From fe3cfed552935ceddbece8d9c0ae2f1d86450bad Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Sat, 14 Sep 2024 10:59:20 +0200 Subject: [PATCH 1/5] Move to modern project management with pyproject.toml --- pyproject.toml | 16 ++++++++++++++++ source/requirements.txt | 8 -------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 pyproject.toml delete mode 100644 source/requirements.txt diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..d4a030b4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[project] +name = "two-avogadro-cc" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "breathe>=4.35.0", + "linkify-it-py>=2.0.3", + "myst-parser>=4.0.0", + "pydata-sphinx-theme>=0.15.4", + "sphinx>=8.0.2", + "sphinx-copybutton>=0.5.2", + "sphinx-design>=0.6.1", + "sphinxext-rediraffe>=0.2.7", +] diff --git a/source/requirements.txt b/source/requirements.txt deleted file mode 100644 index 330115c8..00000000 --- a/source/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -sphinx -myst-parser -breathe -pydata-sphinx-theme -sphinx-design -sphinx-copybutton -linkify-it-py -sphinxext.rediraffe From b3f46d066380933b558def10e6972a9af923e764 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Sat, 14 Sep 2024 11:09:52 +0200 Subject: [PATCH 2/5] Better description and version no --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d4a030b4..0babac1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "two-avogadro-cc" -version = "0.1.0" -description = "Add your description here" +version = "2.dev0" +description = "Documentation and development website for Avogadro2" readme = "README.md" requires-python = ">=3.10" dependencies = [ From d1f67f979e5e19d6e75785ff6cbf45cbcc3ca661 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Wed, 25 Sep 2024 14:00:22 +0200 Subject: [PATCH 3/5] Add sphinx-togglebutton as dependency and update GitHub Actions workflow Signed-off-by: Matthew J. Milner --- .github/workflows/build.yml | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96aa5a1d..b34d9413 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: - name: Install Sphinx and requirements run: | - pip install -U sphinx myst-parser breathe pydata-sphinx-theme sphinxext-rediraffe sphinx-design sphinx-copybutton linkify-it-py pygments + pip install -U breathe>=4.35.0 linkify-it-py>=2.0.3 myst-parser>=4.0.0 pydata-sphinx-theme>=0.15.4 sphinx>=8.0.2 sphinx-copybutton>=0.5.2 sphinx-design>=0.6.1 sphinxext-rediraffe>=0.2.7 sphinx-togglebutton>=0.3.2 - name: Configure run: | diff --git a/pyproject.toml b/pyproject.toml index 0babac1a..b961080b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "two-avogadro-cc" version = "2.dev0" description = "Documentation and development website for Avogadro2" readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.11" dependencies = [ "breathe>=4.35.0", "linkify-it-py>=2.0.3", @@ -13,4 +13,5 @@ dependencies = [ "sphinx-copybutton>=0.5.2", "sphinx-design>=0.6.1", "sphinxext-rediraffe>=0.2.7", + "sphinx-togglebutton>=0.3.2", ] From be31f4a8efaa89bb280be49eb59e4d0a087775b1 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Wed, 25 Sep 2024 16:28:10 +0200 Subject: [PATCH 4/5] Use uv for dependency resolution and installation from pyproject.toml Signed-off-by: Matthew J. Milner --- .github/workflows/build.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b34d9413..c6fb1e6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 -# build the doxygen XML for breathe + # build the doxygen XML for breathe - name: Checkout openchemistry uses: actions/checkout@v4 with: @@ -38,9 +38,14 @@ jobs: sudo apt-get -qq update sudo apt-get -qq install doxygen ninja-build libeigen3-dev libglew-dev libxml2-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5x11extras5-dev libqt5svg5-dev + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + - name: Install Sphinx and requirements - run: | - pip install -U breathe>=4.35.0 linkify-it-py>=2.0.3 myst-parser>=4.0.0 pydata-sphinx-theme>=0.15.4 sphinx>=8.0.2 sphinx-copybutton>=0.5.2 sphinx-design>=0.6.1 sphinxext-rediraffe>=0.2.7 sphinx-togglebutton>=0.3.2 + run: uv pip install --system --break-system-packages -r pyproject.toml - name: Configure run: | From daa45dd605f724c2ace1711496c5468b6907c70b Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Wed, 25 Sep 2024 16:32:14 +0200 Subject: [PATCH 5/5] Use GitHub's setup-python action to make sure a specific Python version is used, also remove uv cache option Signed-off-by: Matthew J. Milner --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6fb1e6a..e7bfab3c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,9 +40,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v2 + + - name: "Set up Python" + uses: actions/setup-python@v5 with: - enable-cache: true - cache-dependency-glob: "uv.lock" + python-version-file: ".python-version" - name: Install Sphinx and requirements run: uv pip install --system --break-system-packages -r pyproject.toml