Add detailed compatibility documentation and version detection: - Add Wiki.js 2.x compatibility badge and requirements to README - Create comprehensive docs/compatibility.md guide - Detailed version support matrix (2.2 through 2.5.308+) - API schema differences between 2.x and 3.x - Version detection examples and troubleshooting - Known compatibility issues and solutions - Future 3.x support planning - Enhance test_connection() in both sync and async clients - Add API version compatibility detection - Better error messages for incompatible versions - Detect Wiki.js 3.x and provide clear guidance - Update package metadata - Add Wiki.js compatibility keywords to setup.py and pyproject.toml - Add compatibility documentation link to project URLs SDK supports Wiki.js 2.x (versions 2.2 - 2.5.308+) Wiki.js 3.x (alpha) not yet supported due to different API schema 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
91 lines
3.3 KiB
Python
91 lines
3.3 KiB
Python
#!/usr/bin/env python3
|
|
"""Setup script for Wiki.js Python SDK."""
|
|
|
|
from setuptools import setup, find_packages
|
|
import os
|
|
|
|
|
|
def read_version():
|
|
"""Read version from wikijs/version.py."""
|
|
version_file = os.path.join("wikijs", "version.py")
|
|
with open(version_file, "r", encoding="utf-8") as f:
|
|
for line in f:
|
|
if line.startswith("__version__"):
|
|
return line.split("=")[1].strip().strip('"').strip("'")
|
|
raise RuntimeError("Unable to find version string.")
|
|
|
|
|
|
def read_readme():
|
|
"""Read README.md for long description."""
|
|
with open("README.md", "r", encoding="utf-8") as f:
|
|
return f.read()
|
|
|
|
|
|
def read_requirements():
|
|
"""Read requirements.txt for dependencies."""
|
|
with open("requirements.txt", "r", encoding="utf-8") as f:
|
|
return [line.strip() for line in f if line.strip() and not line.startswith("#")]
|
|
|
|
|
|
def read_dev_requirements():
|
|
"""Read requirements-dev.txt for development dependencies."""
|
|
try:
|
|
with open("requirements-dev.txt", "r", encoding="utf-8") as f:
|
|
deps = []
|
|
for line in f:
|
|
line = line.strip()
|
|
if line and not line.startswith("#") and not line.startswith("-r"):
|
|
deps.append(line)
|
|
return deps
|
|
except FileNotFoundError:
|
|
return []
|
|
|
|
|
|
setup(
|
|
name="wikijs-python-sdk",
|
|
version=read_version(),
|
|
description="A professional Python SDK for Wiki.js API integration",
|
|
long_description=read_readme(),
|
|
long_description_content_type="text/markdown",
|
|
author="leomiranda",
|
|
author_email="lmiranda@hotserv.cloud",
|
|
url="https://gitea.hotserv.cloud/lmiranda/py-wikijs",
|
|
project_urls={
|
|
"Bug Reports": "https://gitea.hotserv.cloud/lmiranda/py-wikijs/issues",
|
|
"Source": "https://gitea.hotserv.cloud/lmiranda/py-wikijs",
|
|
"Documentation": "https://gitea.hotserv.cloud/lmiranda/py-wikijs/src/branch/main/docs",
|
|
"Compatibility": "https://gitea.hotserv.cloud/lmiranda/py-wikijs/src/branch/main/docs/compatibility.md",
|
|
"Wiki.js": "https://js.wiki",
|
|
},
|
|
packages=find_packages(),
|
|
include_package_data=True,
|
|
package_data={
|
|
"wikijs": ["py.typed"],
|
|
},
|
|
install_requires=read_requirements(),
|
|
extras_require={
|
|
"dev": read_dev_requirements(),
|
|
"async": ["aiohttp>=3.8.0"],
|
|
"cli": ["click>=8.0.0", "rich>=12.0.0"],
|
|
"all": ["aiohttp>=3.8.0", "click>=8.0.0", "rich>=12.0.0"],
|
|
},
|
|
python_requires=">=3.8",
|
|
classifiers=[
|
|
"Development Status :: 3 - Alpha",
|
|
"Intended Audience :: Developers",
|
|
"License :: OSI Approved :: MIT License",
|
|
"Operating System :: OS Independent",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.8",
|
|
"Programming Language :: Python :: 3.9",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
|
"Topic :: Documentation",
|
|
"Typing :: Typed",
|
|
],
|
|
keywords=["wiki", "wikijs", "wiki.js", "api", "sdk", "client", "http", "rest", "graphql", "wiki.js-2.x"],
|
|
zip_safe=False,
|
|
) |