Skip to content

Commit

Permalink
release commit
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Aug 2, 2024
1 parent 8c1403e commit 6d6c4b9
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [ 3.9, '3.10', '3.11','3.12']
python-version: [ '3.9', '3.10', '3.11', '3.12' ]

steps:
- uses: actions/checkout@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/upload-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -22,6 +25,3 @@ jobs:
hatch build
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ BITPlan's Professional SemanticMediaWiki

[![Join the discussion at https://github.com/BITPlan/ProfiWiki/discussions](https://img.shields.io/github/discussions/BITPlan/ProfiWiki)](https://github.com/BITPlan/ProfiWiki/discussions)
[![pypi](https://img.shields.io/pypi/pyversions/ProfiWiki)](https://pypi.org/project/ProfiWiki/)
[![Github Actions Build](https://github.com/BITPlan/ProfiWiki/workflows/Build/badge.svg?branch=main)](https://github.com/BITPlan/ProfiWiki/actions?query=workflow%3ABuild+branch%3Amain)
[![Github Actions Build](https://github.com/BITPlan/ProfiWiki/actions/workflows/build.yml/badge.svg)](https://github.com/BITPlan/ProfiWiki/actions/workflows/build.yml)
[![PyPI Status](https://img.shields.io/pypi/v/ProfiWiki.svg)](https://pypi.python.org/pypi/ProfiWiki/)
[![GitHub issues](https://img.shields.io/github/issues/BITPlan/ProfiWiki.svg)](https://github.com/BITPlan/ProfiWiki/issues)
[![GitHub issues](https://img.shields.io/github/issues-closed/BITPlan/ProfiWiki.svg)](https://github.com/BITPlan/ProfiWiki/issues/?q=is%3Aissue+is%3Aclosed)
[![GitHub](https://img.shields.io/github/license/BITPlan/ProfiWiki.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![GitHub closed issues](https://img.shields.io/github/issues-closed/BITPlan/ProfiWiki.svg)](https://github.com/BITPlan/ProfiWiki/issues/?q=is%3Aissue+is%3Aclosed)
[![API Docs](https://img.shields.io/badge/API-Documentation-blue)](https://BITPlan.github.io/ProfiWiki/)
[![License](https://img.shields.io/github/license/BITPlan/ProfiWiki.svg)](https://www.apache.org/licenses/LICENSE-2.0)
[![BITPlan](http://wiki.bitplan.com/images/wiki/thumb/3/38/BITPlanLogoFontLessTransparent.png/198px-BITPlanLogoFontLessTransparent.png)](http://www.bitplan.com)

[![Mediawiki](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/MediaWiki_logo_1.png/128px-MediaWiki_logo_1.png)](https://www.mediawiki.org/wiki/MediaWiki)
[![SemanticMediaWiki](http://semantic-mediawiki.org/w/images/7/7c/SMW_logo_142px.png)](http://www.semantic-mediawiki.org/)

Semantic MediaWiki with fully automated install.
Semantic MediaWiki with fully automated install.
Will get your Semantic MediaWiki running in a few minutes.

### Documentation
* [Wiki](https://wiki.bitplan.com/index.php/ProfiWiki)
### Features
* Docker compose based
* based on official Mediawiki docker image
### Links
### Links
* https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/1218
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ProfiWiki API Documentation

::: profiwiki
options:
show_submodules: true
18 changes: 18 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
site_name: ProfiWiki API Documentation
theme:
name: material
plugins:
- search
- mkdocstrings:
handlers:
python:
setup_commands:
- import sys
- import os
- sys.path.insert(0, os.path.abspath("."))
selection:
docstring_style: google
rendering:
show_source: true
nav:
- API: index.md
2 changes: 1 addition & 1 deletion profiwiki/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Version(object):
description = """BITPlan's professional Semantic Mediawiki"""
version = profiwiki.__version__
date = "2023-04-01"
updated = "2024-04-19"
updated = "2024-08-02"
authors = "Wolfgang Fahl"
doc_url = "https://wiki.bitplan.com/index.php/ProfiWiki"
chat_url = "https://github.com/BITPlan/ProfiWiki/discussions"
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ readme = "README.md"
license= "Apache-2.0"
dependencies = [
#https://pypi.org/project/pymediawikidocker/
"pymediawikidocker>=0.12.1",
"pymediawikidocker>=0.13.0",
#https://pypi.org/project/py-3rdparty-mediawiki/
"py-3rdparty-mediawiki"
]
Expand Down Expand Up @@ -54,9 +54,10 @@ test = [
]

[tool.hatch.build.targets.wheel]
packages = [
"profiwiki",
]
only-include = ["profiwiki"]

[tool.hatch.build.targets.wheel.sources]
"profiwiki" = "profiwiki"

[project.scripts]
profiwiki = "profiwiki.profiwiki_cmd:main"
88 changes: 88 additions & 0 deletions scripts/doc
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash
# create docs for a configurable project
# WF 2024-07-30 - updated

# Extract project name from pyproject.toml
PROJECT_NAME=$(grep "\[project\]" pyproject.toml -A1 | grep name | cut -d '=' -f2 | tr -d ' "')
PACKAGE_NAME=$(grep "\[tool.hatch.build.targets.wheel.sources\]" pyproject.toml -A1 | tail -1 | cut -d '=' -f2 | tr -d ' "')


# Function to print usage information
print_usage() {
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " -pr, --project NAME Set the project name (default: $PROJECT_NAME)"
echo " -pa, --package NAME Set the package name (default: $PACKAGE_NAME)"
echo " -d, --deploy Deploy the documentation after building"
echo " -h, --help Display this help message"
}

# Parse command line arguments
DEPLOY=false
while [[ "$#" -gt 0 ]]; do
case $1 in
-pr|--project) PROJECT_NAME="$2"; shift ;;
-pa|--package) PACKAGE_NAME="$2"; shift ;;
-d|--deploy) DEPLOY=true ;;
-h|--help) print_usage; exit 0 ;;
*) echo "Unknown parameter: $1"; print_usage; exit 1 ;;
esac
shift
done

# Ensure we're in the correct directory
if [[ ! -d "$PACKAGE_NAME" ]]; then
echo "Error: $PACKAGE_NAME package directory not found. Are you in the correct directory?"
exit 1
fi

# Check if mkdocs is installed
if ! command -v mkdocs &> /dev/null; then
pip install mkdocs mkdocs-material mkdocstrings[python]
fi

# Create or update mkdocs.yml
cat << EOF > mkdocs.yml
site_name: $PROJECT_NAME API Documentation
theme:
name: material
plugins:
- search
- mkdocstrings:
handlers:
python:
setup_commands:
- import sys
- import os
- sys.path.insert(0, os.path.abspath("."))
selection:
docstring_style: google
rendering:
show_source: true
nav:
- API: index.md
EOF

# Create or update index.md
index_md=docs/index.md
mkdir -p docs
cat << EOF > $index_md
# $PROJECT_NAME API Documentation
::: $PACKAGE_NAME
options:
show_submodules: true
EOF

# Ignore DeprecationWarnings during build
export PYTHONWARNINGS="ignore::DeprecationWarning"

# Build the documentation
mkdocs build --config-file ./mkdocs.yml

# Deploy if requested
if [ "$DEPLOY" = true ]; then
mkdocs gh-deploy --force --config-file ./mkdocs.yml
fi

echo "Documentation process completed for $PROJECT_NAME."
8 changes: 8 additions & 0 deletions scripts/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# WF 2024-07-31
# prepare a release
scripts/doc -d

# Commit with a message that includes the current ISO timestamp
git commit -a -m "release commit"
git push

0 comments on commit 6d6c4b9

Please sign in to comment.