Skip to content

Commit

Permalink
Fix: force versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
lwasser committed Nov 7, 2024
1 parent 6fbb588 commit 603e073
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
10 changes: 10 additions & 0 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,13 @@ hatch build
```

Hatch will store the build distribution files in the `dist/` directory of the cloned repo.

## Making a release

Currently we are using a manual versioning process where you need to
update the version of the package in our `__init__.py` file. Please
be sure to do this before cutting a new release on GitHub.

Once you have updated the version of the package, you are ready to make a release on GitHub.

A new tagged release will push the newly built theme to PyPI.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[build-system]
requires = ["hatchling", "hatch-vcs", "sphinx-theme-builder @ https://github.com/pradyunsg/sphinx-theme-builder/archive/87214d0671c943992c05e3db01dca997e156e8d6.zip",]
requires = ["sphinx-theme-builder @ https://github.com/pradyunsg/sphinx-theme-builder/archive/87214d0671c943992c05e3db01dca997e156e8d6.zip",]
build-backend = "sphinx_theme_builder"

[tool.sphinx-theme-builder]
node-version = "16.13.2"
node-version = "22.9.0"
theme-name = "pyos_sphinx_theme"

[project]
name = "pyos-sphinx-theme"
description = "PyOS Documentation Theme."
dynamic = ["version"]
readme = "README.md"
authors = [{ name = "Leah Wasser", email = "leah@pyopensci.org" }]
authors = [{ name = "pyOpenSci Community", email = "pyopensci@pyopensci.org" }]
maintainers = [
{ name = "pyOpenSci", email = "admin@pyopensci.org" }, # Optional
{ name = "pyOpenSci", email = "pyopensci@pyopensci.org" },
]

requires-python = ">=3.9"
Expand Down
31 changes: 20 additions & 11 deletions src/pyos_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# from sphinx_book_theme import hash_assets_for_files
from sphinx.util import logging

__version__ = "0.1.dev0"
__version__ = "0.2.dev0"
current_year = datetime.now().year
organization_name = "pyOpenSci"

Expand All @@ -17,18 +17,22 @@
THIS_PATH = Path(__file__).parent.resolve()
THEME_PATH = THIS_PATH / "theme" / "pyos_sphinx_theme"
TEMPLATE_PATH = THEME_PATH / "templates"
LOGO_LIGHT = str((THEME_PATH / "static" / "images" / "logo-light-mode.png").absolute()).replace(
"\\", "/"
)
LOGO_DARK = str((THEME_PATH / "static" / "images" / "logo-dark-mode.png").absolute()).replace(
"\\", "/"
)
LOGO_LIGHT = str(
(THEME_PATH / "static" / "images" / "logo-light-mode.png").absolute()
).replace("\\", "/")
LOGO_DARK = str(
(THEME_PATH / "static" / "images" / "logo-dark-mode.png").absolute()
).replace("\\", "/")

PYOPENSCI_LOGO_PACKAGE_GUIDE = str(
(THEME_PATH / "static" / "images" / "pyopensci-logo-package-guide.png").absolute()
(
THEME_PATH / "static" / "images" / "pyopensci-logo-package-guide.png"
).absolute()
).replace("\\", "/")
PYOPENSCI_PYTHON_PACKAGE_GUIDE = str(
(THEME_PATH / "static" / "images" / "pyopensci-python-package-guide.png").absolute()
(
THEME_PATH / "static" / "images" / "pyopensci-python-package-guide.png"
).absolute()
).replace("\\", "/")


Expand Down Expand Up @@ -64,7 +68,10 @@ def update_config(app):
]

if "logo" not in theme_options:
theme_options["logo"] = {"image_dark": LOGO_DARK, "image_light": LOGO_LIGHT}
theme_options["logo"] = {
"image_dark": LOGO_DARK,
"image_light": LOGO_LIGHT,
}

if "header_links_before_dropdown" not in theme_options:
theme_options["header_links_before_dropdown"] = 4
Expand All @@ -81,7 +88,9 @@ def update_config(app):
app.config.copyright = f"{current_year}, {organization_name}"

# If no html_logo is set then use a stock pyOpenSci logo
if not config_provided_by_user(app, "html_logo") and not social_cards.get("image"):
if not config_provided_by_user(app, "html_logo") and not social_cards.get(
"image"
):
line_color = "#6D597A"
social_cards["image"] = str(LOGO_LIGHT)
social_cards["line_color"] = line_color
Expand Down

0 comments on commit 603e073

Please sign in to comment.