diff --git a/docs/generate_docs.sh b/docs/generate_docs.sh new file mode 100755 index 000000000..2622383a1 --- /dev/null +++ b/docs/generate_docs.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Chemins vers les packages racines (doivent contenir __init__.py et des sous-modules) +SCALEWAY_PKG="../scaleway/scaleway" +CORE_PKG="../scaleway-core/scaleway_core" +ASYNC_PKG="../scaleway-async/scaleway_async" + +# Vérifier que les dossiers racines existent et sont bien des packages +for pkg in "$SCALEWAY_PKG" "$CORE_PKG" "$ASYNC_PKG"; do + if [ ! -d "$pkg" ]; then + echo "❌ Erreur : Le dossier '$pkg' n'existe pas." + exit 1 + fi + if [ ! -f "$pkg/__init__.py" ] ; then + echo "⚠️ Attention : '$pkg' ne semble pas être un package Python (pas de __init__.py)." + fi + echo "✅ Package trouvé : $pkg" +done + +# Exporter PYTHONPATH pour que tous les modules soient accessibles +export PYTHONPATH="..:$PYTHONPATH" + +# Générer la doc pour chaque package racine (pdoc explore automatiquement les sous-modules) +echo "📚 Génération de la documentation avec pdoc..." +poetry run pdoc \ + -o html \ + -d google \ + "$SCALEWAY_PKG" \ + "$CORE_PKG" \ + "$ASYNC_PKG" + +if [ $? -eq 0 ]; then + echo "✅ Documentation générée avec succès dans le dossier 'html/'." +else + echo "❌ Échec de la génération de la documentation." + exit 1 +fi \ No newline at end of file diff --git a/scaleway-async/scaleway_async/__init__.py b/scaleway-async/scaleway_async/__init__.py index c22dc86a4..40d19a47a 100644 --- a/scaleway-async/scaleway_async/__init__.py +++ b/scaleway-async/scaleway_async/__init__.py @@ -52,4 +52,7 @@ "ServiceInfo", "TimeSeriesPoint", "TimeSeries", + "InstanceV1API", ] + +from scaleway_async.instance.v1 import InstanceV1API diff --git a/scaleway-async/scaleway_async/bridge.py b/scaleway-async/scaleway_async/bridge.py new file mode 100644 index 000000000..d3d97c2d1 --- /dev/null +++ b/scaleway-async/scaleway_async/bridge.py @@ -0,0 +1,24 @@ +# scaleway_async/bridge.py +from scaleway_core.bridge import ( + Money, + Region, + ALL_REGIONS, + Zone, + ALL_ZONES, + ScwFile, + ServiceInfo, + TimeSeriesPoint, + TimeSeries, +) + +__all__ = [ + "Money", + "Region", + "ALL_REGIONS", + "Zone", + "ALL_ZONES", + "ScwFile", + "ServiceInfo", + "TimeSeriesPoint", + "TimeSeries", +] diff --git a/scaleway/scaleway/__init__.py b/scaleway/scaleway/__init__.py index 040211548..f4dd43189 100644 --- a/scaleway/scaleway/__init__.py +++ b/scaleway/scaleway/__init__.py @@ -2,54 +2,10 @@ import importlib.metadata -__version__: str = importlib.metadata.version(__name__) +__version__ = importlib.metadata.version(__name__) -from scaleway_core.api import ( - API, - ScalewayException, -) +# import internal dependencies +from ._dependancies import * -from scaleway_core.client import Client - -from scaleway_core.profile import ( - Profile, - ProfileConfig, - ProfileDefaults, -) - -from scaleway_core.utils.waiter import ( - WaitForOptions, - WaitForStopCondition, -) - -from scaleway_core.bridge import ( - Money, - Region, - ALL_REGIONS, - Zone, - ALL_ZONES, - ScwFile, - ServiceInfo, - TimeSeriesPoint, - TimeSeries, -) - -__all__ = [ - "API", - "ScalewayException", - "Client", - "Profile", - "ProfileConfig", - "ProfileDefaults", - "WaitForOptions", - "WaitForStopCondition", - "Money", - "Region", - "ALL_REGIONS", - "Zone", - "ALL_ZONES", - "ScwFile", - "ServiceInfo", - "TimeSeriesPoint", - "TimeSeries", -] +# optional: explicitly define __all__ for public API +# __all__ = _dependancies.__all__ diff --git a/scaleway/scaleway/_dependancies.py b/scaleway/scaleway/_dependancies.py new file mode 100644 index 000000000..6264fcc55 --- /dev/null +++ b/scaleway/scaleway/_dependancies.py @@ -0,0 +1,52 @@ +# scaleway_async/_dependancies.py + +from scaleway_core.api import ( + API, + ScalewayException, +) + +from scaleway_core.client import Client + +from scaleway_core.profile import ( + Profile, + ProfileConfig, + ProfileDefaults, +) + +from scaleway_core.utils.waiter import ( + WaitForOptions, + WaitForStopCondition, +) + +from scaleway_core.bridge import ( + Money, + Region, + ALL_REGIONS, + Zone, + ALL_ZONES, + ScwFile, + ServiceInfo, + TimeSeriesPoint, + TimeSeries, +) + +__all__ = [ + "API", + "ScalewayException", + "Client", + "Profile", + "ProfileConfig", + "ProfileDefaults", + "WaitForOptions", + "WaitForStopCondition", + "Money", + "Region", + "ALL_REGIONS", + "Zone", + "ALL_ZONES", + "ScwFile", + "ServiceInfo", + "TimeSeriesPoint", + "TimeSeries", +] +