From 316cdb1cd40be5af9d843c551b289f2715bf4c20 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:23:33 +0330 Subject: [PATCH 01/14] feat: add comprehensive Python development environment ignores Add extensive .gitignore patterns for Python development environments including: - Python cache files and compiled artifacts - Virtual environments and environment files - Package distribution directories - Testing and coverage reports - IDE-specific files (VS Code, Rope) - Type checking cache (mypy) - Hatch build system artifacts These patterns prevent accidental commits of generated files and development environment artifacts commonly produced during Python development workflows. --- .gitignore | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/.gitignore b/.gitignore index 60db5bc..da89cca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,68 @@ docs/html node_modules *.tgz + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# IDE +.vscode/ +.ropeproject + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Hatch +.hatch/ From e8c2d1497a2aba773c572ae2e09f6fa752074023 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:23:46 +0330 Subject: [PATCH 02/14] feat: add pyproject.toml for hatch-based Python packaging Add pyproject.toml configuration file to set up modern Python packaging using hatch. This includes project metadata, build system configuration, version management from VERSION.txt, and code formatting tools (black and isort). The configuration enables proper package distribution with wheel builds and defines entry points for the doxygen-awesome-css command-line interface. --- pyproject.toml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e5b33ad --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "doxygen-awesome-css" +dynamic = ["version"] +description = "Custom CSS theme for doxygen html-documentation with lots of customization parameters." +authors = [ + {name = "jothepro", email = "jothepro@github.com"}, + {name = "mohammadraziei", email = "mohammadraziei@github.com"} +] +license = {text = "MIT"} +readme = "README.md" +keywords = ["doxygen", "css", "theme", "awesome"] +dependencies = [] +requires-python = ">=3.8" + +[project.urls] +Homepage = "https://jothepro.github.io/doxygen-awesome-css/" +Repository = "https://github.com/jothepro/doxygen-awesome-css.git" + +[project.scripts] +doxygen-awesome-css = "doxygen_awesome_css.__main__:main" + +[tool.hatch.version] +path = "VERSION.txt" + +[tool.hatch.build.targets.wheel] +packages = ["doxygen_awesome_css"] + +[tool.black] +line-length = 88 +target-version = ['py38'] + +[tool.isort] +profile = "black" +multi_line_output = 3 From a49b8d349b15f9560af0196180098097e0f10332 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:24:43 +0330 Subject: [PATCH 03/14] feat: add Doxygen Awesome CSS installer module Add new Python module for installing Doxygen Awesome CSS theme files. The module provides an Installer class that handles copying CSS and JavaScript files to target directories with proper error handling and logging. This enables programmatic installation of the Doxygen Awesome theme files for documentation projects. --- doxygen_awesome_css/__init__.py | 85 +++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 doxygen_awesome_css/__init__.py diff --git a/doxygen_awesome_css/__init__.py b/doxygen_awesome_css/__init__.py new file mode 100644 index 0000000..e727d42 --- /dev/null +++ b/doxygen_awesome_css/__init__.py @@ -0,0 +1,85 @@ +"""Doxygen Awesome CSS - A custom CSS theme for Doxygen HTML documentation.""" + +import logging +import shutil +import sys +from pathlib import Path +from typing import List + +# Read version from VERSION.txt +_version_file = Path(__file__).parent.parent / "VERSION.txt" +if _version_file.exists(): + __version__ = _version_file.read_text().strip() +else: + __version__ = "0.0.0" + +__license__ = "MIT" + + +class Installer: + """Handles installation of Doxygen Awesome CSS files.""" + + def __init__(self): + self.logger = logging.getLogger(__name__) + self.package_dir = Path(__file__).parent.parent + self.files_to_copy = [ + "doxygen-awesome.css", + "doxygen-awesome-darkmode-toggle.js", + "doxygen-awesome-fragment-copy-button.js", + "doxygen-awesome-interactive-toc.js", + "doxygen-awesome-paragraph-link.js", + "doxygen-awesome-sidebar-only-darkmode-toggle.css", + "doxygen-awesome-sidebar-only.css", + "doxygen-awesome-tabs.js", + ] + + def get_package_files(self) -> List[Path]: + """Get list of package files that exist.""" + package_files = [] + for filename in self.files_to_copy: + file_path = self.package_dir / filename + if file_path.exists(): + package_files.append(file_path) + else: + self.logger.warning(f"{filename} not found in package") + return package_files + + def install(self, target_dir: Path) -> None: + """Install CSS/JS files to target directory.""" + if not target_dir.exists(): + self.logger.error(f"Target directory '{target_dir}' does not exist") + sys.exit(1) + + if not target_dir.is_dir(): + self.logger.error(f"'{target_dir}' is not a directory") + sys.exit(1) + + package_files = self.get_package_files() + + if not package_files: + self.logger.error("No Doxygen Awesome CSS files found in package") + sys.exit(1) + + self.logger.info(f"Installing Doxygen Awesome CSS files to '{target_dir}'...") + + copied_count = 0 + for source_file in package_files: + target_file = target_dir / source_file.name + try: + shutil.copy2(source_file, target_file) + self.logger.debug(f"Copied: {source_file.name}") + copied_count += 1 + except Exception as e: + self.logger.error(f"Error copying {source_file.name}: {e}") + sys.exit(1) + + self.logger.info(f"Successfully installed {copied_count} files to '{target_dir}'") + + # Show installation summary + if logging.getLogger().getEffectiveLevel() == logging.DEBUG: + self.logger.debug("Installed files:") + for source_file in package_files: + self.logger.debug(f" - {source_file.name}") + + +__all__ = ["Installer", "__version__"] From b3ddebbadd2633b1932a33594f25bbbc50ae0c23 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:26:24 +0330 Subject: [PATCH 04/14] feat: add CLI entry point for Doxygen Awesome CSS Add main entry point module to provide command-line interface for installing Doxygen Awesome CSS files. The CLI supports: - Installing CSS/JS files to specified directories - Verbose and quiet output modes - Version information display - Help documentation with usage examples This enables users to easily install the theme files via command line rather than manual file copying. --- doxygen_awesome_css/__main__.py | 90 +++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 doxygen_awesome_css/__main__.py diff --git a/doxygen_awesome_css/__main__.py b/doxygen_awesome_css/__main__.py new file mode 100644 index 0000000..e71b12e --- /dev/null +++ b/doxygen_awesome_css/__main__.py @@ -0,0 +1,90 @@ +"""Main entry point for Doxygen Awesome CSS CLI.""" + +import argparse +import logging +import sys +from pathlib import Path + +from . import Installer, __version__ + + +def setup_logging(verbose: bool = False, quiet: bool = False) -> None: + """Setup logging configuration based on verbosity.""" + if quiet: + level = logging.WARNING + elif verbose: + level = logging.DEBUG + else: + level = logging.INFO + + logging.basicConfig( + level=level, + format="%(message)s", + handlers=[logging.StreamHandler()] + ) + + +def create_parser() -> argparse.ArgumentParser: + """Create argument parser for CLI.""" + parser = argparse.ArgumentParser( + description="Doxygen Awesome CSS - A custom CSS theme for Doxygen HTML documentation", + epilog=""" +Examples: + # Install files to current directory + python -m doxygen_awesome_css --install . + + # Install files with verbose output + python -m doxygen_awesome_css --install ./docs --verbose + + # Show version + python -m doxygen_awesome_css --version + """, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + + parser.add_argument( + "--install", + type=str, + metavar="DIR", + help="Install CSS/JS files to the specified directory", + ) + + parser.add_argument( + "--verbose", "-v", + action="store_true", + help="Enable verbose output (DEBUG level)", + ) + + parser.add_argument( + "--quiet", "-q", + action="store_true", + help="Enable quiet output (WARNING level)", + ) + + parser.add_argument( + "--version", + action="version", + version=f"doxygen-awesome-css {__version__}", + ) + + return parser + + +def main() -> None: + """Main entry point for CLI.""" + parser = create_parser() + args = parser.parse_args() + + setup_logging(verbose=args.verbose, quiet=args.quiet) + logger = logging.getLogger(__name__) + + if args.install: + installer = Installer() + installer.install(Path(args.install)) + else: + logger.info("Doxygen Awesome CSS - A custom CSS theme for Doxygen HTML documentation") + logger.info("Use --help for usage information") + + +if __name__ == "__main__": + main() From 7e467ff6f2069400fdc2aa1ec00338a06452c302 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:26:40 +0330 Subject: [PATCH 05/14] feat: add Python installation instructions and version file Add Python package installation method to README with usage examples for integrating the theme into Python projects. Also create VERSION.txt file to track project version (2.4.1). These changes make the theme more accessible to Python developers and improve version management. --- README.md | 18 ++++++++++++++++++ VERSION.txt | 1 + 2 files changed, 19 insertions(+) create mode 100644 VERSION.txt diff --git a/README.md b/README.md index 2110efb..b77855a 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,24 @@ Similarly, in the [xPack](https://xpack.github.io) ecosystem, this project can b as a development dependency to an [`xpm`](https://xpack.github.io/xpm/) managed project. +### Python + +For Python projects, you can install the theme as a Python package: + +```sh +# Install the package +pip install doxygen-awesome-css + +# Install files to your project directory +python -m doxygen_awesome_css --install . +# Install with verbose output +python -m doxygen_awesome_css --install ./docs --verbose +# Quiet mode (minimal output) +python -m doxygen_awesome_css --install ./docs --quiet +``` + +This method provides a clean way to manage the theme as a dependency and easily install the files where needed. + ### System-wide You can even install the theme system-wide by running `make install`. diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..005119b --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +2.4.1 From 72f66b96476a66eae720c4faab35c290d137e759 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:27:00 +0330 Subject: [PATCH 06/14] feat: add GitHub workflow for automated wheel builds and releases Add a new GitHub Actions workflow that automates the build and release process for Python packages. The workflow includes: - Building source distributions (sdist) on Ubuntu - Building wheels for multiple platforms (Ubuntu and Windows) using cibuildwheel - Automated releases to GitHub with proper tagging - Publishing to PyPI when tags are pushed The workflow triggers on pushes to master, pull requests, and tag pushes (for releases), providing continuous integration and deployment capabilities for the project. --- .github/workflows/wheel.yml | 124 ++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 .github/workflows/wheel.yml diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml new file mode 100644 index 0000000..3eb5cc9 --- /dev/null +++ b/.github/workflows/wheel.yml @@ -0,0 +1,124 @@ +name: create wheels + +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + tags: + - "v*" + +env: + FORCE_COLOR: 3 + +concurrency: + group: github.workflow−{{ github.workflow }}-{{ github.ref }} + cancel-in-progress: true + +jobs: + build_sdist: + name: Build SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: false + + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + +# - name: Ruff Check +# run: pipx run ruff check . + + - name: Build SDist + run: pipx run build --sdist + + - name: Check metadata + run: pipx run twine check dist/* + + - uses: actions/upload-artifact@v4 + with: + path: dist/*.tar.gz + overwrite: true + + + build_wheels: + name: Wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest, windows-latest] + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Build wheels + uses: pypa/cibuildwheel@v2.16.5 + env: +# CIBW_ARCHS_MACOS: universal2 +# CIBW_ARCHS_WINDOWS: auto ARM64 + # Disable building PyPy wheels on all platforms + CIBW_SKIP: pp* +# CIBW_PRERELEASE_PYTHONS: true + + - name: Verify clean directory + run: git diff --exit-code + shell: bash + + - uses: actions/upload-artifact@v4 + with: + name: wheelhouse-${{ matrix.os }} + path: wheelhouse/*.whl + overwrite: false + + + release: + name: Release Assets and Upload to PyPI + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + + steps: + # Determine release type + - name: Determine release type + id: release_type + run: | + if [[ "${{ github.ref }}" =~ ^refs/tags/v.*$ ]]; then + echo "RELEASE_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + echo "IS_TAG=true" >> $GITHUB_ENV + else + echo "RELEASE_NAME=__beta__" >> $GITHUB_ENV + echo "IS_TAG=false" >> $GITHUB_ENV + fi + shell: bash # Use bash for all platforms + + - uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + + + - name: List dist directory + run: tree --du -shaC . # Ensure the directory is not empty + + - name: Create or update release + id: create_release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.RELEASE_NAME }} + name: ${{ env.RELEASE_NAME }} + draft: false + prerelease: ${{ env.IS_TAG == 'false' }} + files: dist/* + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Publishing to PyPi + uses: pypa/gh-action-pypi-publish@release/v1 + if: startsWith(github.ref, 'refs/tags/') + with: + password: ${{ secrets.PYPI_PASSWORD }} + user: ${{ secrets.PYPI_USERNAME }} \ No newline at end of file From 25f83366746596f37d596f9ad6bd82479fdd1e4d Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:37:55 +0330 Subject: [PATCH 07/14] feat: rename wheel workflow file to use .yaml extension Rename .github/workflows/wheel.yml to .github/workflows/wheel.yaml to maintain consistency with other workflow files in the repository that use the .yaml extension. This change standardizes file naming conventions across GitHub Actions workflows. --- .github/workflows/{wheel.yml => wheel.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{wheel.yml => wheel.yaml} (100%) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yaml similarity index 100% rename from .github/workflows/wheel.yml rename to .github/workflows/wheel.yaml From c8c61b19f81c5ba9fbae14cb5f24c5cea7be40ac Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:39:13 +0330 Subject: [PATCH 08/14] feat: change default branch from master to main Update GitHub Actions workflow to use 'main' as the default branch instead of 'master' to align with modern naming conventions and industry standards. The workflow now triggers on pushes to the main branch and tags starting with 'v'. --- .github/workflows/wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index 3eb5cc9..383175f 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -5,7 +5,7 @@ on: pull_request: push: branches: - - master + - main tags: - "v*" From beb5f7da5d058f32d9bd3bf2d7d3dd07abd3dff6 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:49:07 +0330 Subject: [PATCH 09/14] feat: add macOS support to wheel build workflow Add macos-latest to the matrix strategy in the wheel.yaml GitHub workflow to enable building wheels for macOS in addition to existing Ubuntu and Windows support. This expands platform compatibility for the project. --- .github/workflows/wheel.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index 383175f..cd41b88 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -50,7 +50,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v4 From 0876629065c21861864401f0542985ef535812e1 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 13:49:25 +0330 Subject: [PATCH 10/14] feat: centralize package metadata in __about__.py Move package version and license metadata from VERSION.txt and __init__.py to a dedicated __about__.py module. This follows Python packaging best practices by keeping metadata separate from code logic. Update hatch configuration to read version from the new location. --- VERSION.txt | 1 - doxygen_awesome_css/__about__.py | 4 ++++ doxygen_awesome_css/__init__.py | 9 +-------- doxygen_awesome_css/__main__.py | 4 ++-- pyproject.toml | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 VERSION.txt create mode 100644 doxygen_awesome_css/__about__.py diff --git a/VERSION.txt b/VERSION.txt deleted file mode 100644 index 005119b..0000000 --- a/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -2.4.1 diff --git a/doxygen_awesome_css/__about__.py b/doxygen_awesome_css/__about__.py new file mode 100644 index 0000000..206dd86 --- /dev/null +++ b/doxygen_awesome_css/__about__.py @@ -0,0 +1,4 @@ +"""Package metadata for Doxygen Awesome CSS.""" + +__version__ = "2.4.1" +__license__ = "MIT" diff --git a/doxygen_awesome_css/__init__.py b/doxygen_awesome_css/__init__.py index e727d42..09a35b4 100644 --- a/doxygen_awesome_css/__init__.py +++ b/doxygen_awesome_css/__init__.py @@ -6,14 +6,7 @@ from pathlib import Path from typing import List -# Read version from VERSION.txt -_version_file = Path(__file__).parent.parent / "VERSION.txt" -if _version_file.exists(): - __version__ = _version_file.read_text().strip() -else: - __version__ = "0.0.0" - -__license__ = "MIT" +from .__about__ import __version__, __license__ class Installer: diff --git a/doxygen_awesome_css/__main__.py b/doxygen_awesome_css/__main__.py index e71b12e..54bde06 100644 --- a/doxygen_awesome_css/__main__.py +++ b/doxygen_awesome_css/__main__.py @@ -2,10 +2,10 @@ import argparse import logging -import sys from pathlib import Path -from . import Installer, __version__ +from . import Installer +from .__about__ import __version__ def setup_logging(verbose: bool = False, quiet: bool = False) -> None: diff --git a/pyproject.toml b/pyproject.toml index e5b33ad..370d91f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ Repository = "https://github.com/jothepro/doxygen-awesome-css.git" doxygen-awesome-css = "doxygen_awesome_css.__main__:main" [tool.hatch.version] -path = "VERSION.txt" +path = "doxygen_awesome_css/__about__.py" [tool.hatch.build.targets.wheel] packages = ["doxygen_awesome_css"] From 386da4c8d649751ebaf8684a31eef8f475d4c41e Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Thu, 20 Nov 2025 14:14:04 +0330 Subject: [PATCH 11/14] feat: simplify wheel build workflow and use universal wheels - Replace matrix-based multi-OS wheel building with single universal wheel build - Switch from cibuildwheel to standard python build tooling - Remove submodules checkout as they're no longer needed - Simplify artifact upload with single wheelhouse name and overwrite enabled - Maintain PyPI release functionality while streamlining build process --- .github/workflows/wheel.yaml | 37 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index cd41b88..7f91f54 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -45,26 +45,25 @@ jobs: build_wheels: - name: Wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + name: Build universal wheels + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - submodules: true + submodules: false + + - uses: actions/setup-python@v4 + with: + python-version: "3.x" - - name: Build wheels - uses: pypa/cibuildwheel@v2.16.5 - env: -# CIBW_ARCHS_MACOS: universal2 -# CIBW_ARCHS_WINDOWS: auto ARM64 - # Disable building PyPy wheels on all platforms - CIBW_SKIP: pp* -# CIBW_PRERELEASE_PYTHONS: true + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Build universal wheels + run: python -m build --wheel - name: Verify clean directory run: git diff --exit-code @@ -72,9 +71,9 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: wheelhouse-${{ matrix.os }} - path: wheelhouse/*.whl - overwrite: false + name: wheelhouse + path: dist/*.whl + overwrite: true release: @@ -121,4 +120,4 @@ jobs: if: startsWith(github.ref, 'refs/tags/') with: password: ${{ secrets.PYPI_PASSWORD }} - user: ${{ secrets.PYPI_USERNAME }} \ No newline at end of file + user: ${{ secrets.PYPI_USERNAME }} From 63a2f353035889b4be900ac111ce1220a1243876 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Fri, 21 Nov 2025 14:23:22 +0330 Subject: [PATCH 12/14] feat: switch build system from hatch to setuptools - Update pyproject.toml to use setuptools build backend instead of hatchling - Add setup.py with custom build step to copy CSS/JS assets - Fix package directory path in installer to correctly locate assets - Improve installer to create target directory if it doesn't exist - Add setuptools package-data configuration for proper asset inclusion The switch to setuptools provides better compatibility and allows proper inclusion of CSS/JS asset files in the package distribution. The installer now automatically creates missing target directories instead of failing. --- doxygen_awesome_css/__init__.py | 10 ++++++--- pyproject.toml | 24 +++++++++++++++----- setup.py | 40 +++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 setup.py diff --git a/doxygen_awesome_css/__init__.py b/doxygen_awesome_css/__init__.py index 09a35b4..e55c4de 100644 --- a/doxygen_awesome_css/__init__.py +++ b/doxygen_awesome_css/__init__.py @@ -14,7 +14,7 @@ class Installer: def __init__(self): self.logger = logging.getLogger(__name__) - self.package_dir = Path(__file__).parent.parent + self.package_dir = Path(__file__).parent self.files_to_copy = [ "doxygen-awesome.css", "doxygen-awesome-darkmode-toggle.js", @@ -40,8 +40,12 @@ def get_package_files(self) -> List[Path]: def install(self, target_dir: Path) -> None: """Install CSS/JS files to target directory.""" if not target_dir.exists(): - self.logger.error(f"Target directory '{target_dir}' does not exist") - sys.exit(1) + try: + target_dir.mkdir(parents=True, exist_ok=True) + self.logger.info(f"Successfully created directory '{target_dir}'") + except Exception as e: + self.logger.error(f"Failed to create directory '{target_dir}': {e}") + sys.exit(1) if not target_dir.is_dir(): self.logger.error(f"'{target_dir}' is not a directory") diff --git a/pyproject.toml b/pyproject.toml index 370d91f..e5e20d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["setuptools>=63", "wheel"] +build-backend = "setuptools.build_meta" [project] name = "doxygen-awesome-css" @@ -23,12 +23,24 @@ Repository = "https://github.com/jothepro/doxygen-awesome-css.git" [project.scripts] doxygen-awesome-css = "doxygen_awesome_css.__main__:main" -[tool.hatch.version] -path = "doxygen_awesome_css/__about__.py" - -[tool.hatch.build.targets.wheel] +[tool.setuptools] packages = ["doxygen_awesome_css"] +[tool.setuptools.package-data] +doxygen_awesome_css = [ + "doxygen-awesome.css", + "doxygen-awesome-darkmode-toggle.js", + "doxygen-awesome-fragment-copy-button.js", + "doxygen-awesome-interactive-toc.js", + "doxygen-awesome-paragraph-link.js", + "doxygen-awesome-sidebar-only-darkmode-toggle.css", + "doxygen-awesome-sidebar-only.css", + "doxygen-awesome-tabs.js", +] + +[tool.setuptools.dynamic] +version = {attr = "doxygen_awesome_css.__about__.__version__"} + [tool.black] line-length = 88 target-version = ['py38'] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..03b624b --- /dev/null +++ b/setup.py @@ -0,0 +1,40 @@ +from pathlib import Path +import shutil + +from setuptools import setup +from setuptools.command.build_py import build_py as _build_py + + +ASSET_FILES = [ + "doxygen-awesome.css", + "doxygen-awesome-darkmode-toggle.js", + "doxygen-awesome-fragment-copy-button.js", + "doxygen-awesome-interactive-toc.js", + "doxygen-awesome-paragraph-link.js", + "doxygen-awesome-sidebar-only-darkmode-toggle.css", + "doxygen-awesome-sidebar-only.css", + "doxygen-awesome-tabs.js", +] + + +class build_py(_build_py): + """Custom build step that copies CSS/JS assets into the package.""" + + def run(self): + super().run() + self._copy_assets() + + def _copy_assets(self) -> None: + package_dir = Path(self.build_lib) / "doxygen_awesome_css" + source_root = Path(__file__).parent + package_dir.mkdir(parents=True, exist_ok=True) + + for filename in ASSET_FILES: + src = source_root / filename + dest = package_dir / filename + if not src.exists(): + raise FileNotFoundError(f"Asset missing: {src}") + shutil.copy2(src, dest) + + +setup(cmdclass={"build_py": build_py}) From 937d66157985b5880e227d9c7cae90bffb63f738 Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Fri, 21 Nov 2025 14:33:43 +0330 Subject: [PATCH 13/14] feat: remove SDist build from CI workflow Remove the build_sdist job from the GitHub Actions workflow since we're only building and releasing universal wheels. This simplifies the CI pipeline and reduces build time by eliminating redundant package distribution formats. The release job now only depends on the build_wheels job. --- .github/workflows/wheel.yaml | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/.github/workflows/wheel.yaml b/.github/workflows/wheel.yaml index 7f91f54..847727b 100644 --- a/.github/workflows/wheel.yaml +++ b/.github/workflows/wheel.yaml @@ -17,33 +17,6 @@ concurrency: cancel-in-progress: true jobs: - build_sdist: - name: Build SDist - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: false - - - uses: actions/setup-python@v4 - with: - python-version: "3.x" - -# - name: Ruff Check -# run: pipx run ruff check . - - - name: Build SDist - run: pipx run build --sdist - - - name: Check metadata - run: pipx run twine check dist/* - - - uses: actions/upload-artifact@v4 - with: - path: dist/*.tar.gz - overwrite: true - - build_wheels: name: Build universal wheels runs-on: ubuntu-latest @@ -78,7 +51,7 @@ jobs: release: name: Release Assets and Upload to PyPI - needs: [build_wheels, build_sdist] + needs: [build_wheels] runs-on: ubuntu-latest steps: From c8fd14ee85a27540727b92595a3b95f3b92b106e Mon Sep 17 00:00:00 2001 From: mohammadraziei Date: Fri, 21 Nov 2025 16:36:18 +0330 Subject: [PATCH 14/14] feat: bump version to 2.4.1.beta for upcoming release Update package version to 2.4.1.beta to indicate this is a beta release preparing for the next stable version. This helps distinguish development builds from production releases. --- doxygen_awesome_css/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doxygen_awesome_css/__about__.py b/doxygen_awesome_css/__about__.py index 206dd86..8d5d1df 100644 --- a/doxygen_awesome_css/__about__.py +++ b/doxygen_awesome_css/__about__.py @@ -1,4 +1,4 @@ """Package metadata for Doxygen Awesome CSS.""" -__version__ = "2.4.1" +__version__ = "2.4.1.beta" __license__ = "MIT"