From dcc5a08c92d7752fbcd78cd8a39d5851a77ee718 Mon Sep 17 00:00:00 2001 From: Matthew Barber Date: Tue, 3 Jan 2023 12:30:33 +0000 Subject: [PATCH 1/3] Rudimentary pkg and folder-per-persion docs --- spec/{ => 2022.12}/API_specification/array_object.rst | 0 spec/{ => 2022.12}/API_specification/broadcasting.rst | 0 spec/{ => 2022.12}/API_specification/constants.rst | 0 spec/{ => 2022.12}/API_specification/creation_functions.rst | 0 spec/{ => 2022.12}/API_specification/data_type_functions.rst | 0 spec/{ => 2022.12}/API_specification/data_types.rst | 0 spec/{ => 2022.12}/API_specification/elementwise_functions.rst | 0 .../API_specification/function_and_method_signatures.rst | 0 spec/{ => 2022.12}/API_specification/index.rst | 0 spec/{ => 2022.12}/API_specification/indexing.rst | 0 spec/{ => 2022.12}/API_specification/indexing_functions.rst | 0 spec/{ => 2022.12}/API_specification/linear_algebra_functions.rst | 0 spec/{ => 2022.12}/API_specification/manipulation_functions.rst | 0 spec/{ => 2022.12}/API_specification/searching_functions.rst | 0 spec/{ => 2022.12}/API_specification/set_functions.rst | 0 spec/{ => 2022.12}/API_specification/sorting_functions.rst | 0 spec/{ => 2022.12}/API_specification/statistical_functions.rst | 0 spec/{ => 2022.12}/API_specification/type_promotion.rst | 0 spec/{ => 2022.12}/API_specification/utility_functions.rst | 0 spec/{ => 2022.12}/API_specification/version.rst | 0 spec/{ => 2022.12}/assumptions.md | 0 spec/{ => 2022.12}/benchmark_suite.md | 0 spec/{ => 2022.12}/changelog.rst | 0 spec/{ => 2022.12}/design_topics/C_API.rst | 0 spec/{ => 2022.12}/design_topics/accuracy.rst | 0 spec/{ => 2022.12}/design_topics/complex_numbers.rst | 0 spec/{ => 2022.12}/design_topics/copies_views_and_mutation.rst | 0 spec/{ => 2022.12}/design_topics/data_dependent_output_shapes.rst | 0 spec/{ => 2022.12}/design_topics/data_interchange.rst | 0 spec/{ => 2022.12}/design_topics/device_support.rst | 0 spec/{ => 2022.12}/design_topics/index.rst | 0 spec/{ => 2022.12}/design_topics/parallelism.rst | 0 spec/{ => 2022.12}/design_topics/static_typing.rst | 0 spec/{ => 2022.12}/extensions/fourier_transform_functions.rst | 0 spec/{ => 2022.12}/extensions/index.rst | 0 spec/{ => 2022.12}/extensions/linear_algebra_functions.rst | 0 spec/{ => 2022.12}/future_API_evolution.md | 0 spec/{ => 2022.12}/index.rst | 0 spec/{ => 2022.12}/purpose_and_scope.md | 0 spec/{ => 2022.12}/usage_data.md | 0 spec/{ => 2022.12}/use_cases.md | 0 spec/{ => 2022.12}/verification_test_suite.md | 0 .../array_api => src/array_api_stubs/_2022_12}/__init__.py | 0 .../array_api => src/array_api_stubs/_2022_12}/_types.py | 0 .../array_api => src/array_api_stubs/_2022_12}/array_object.py | 0 .../array_api => src/array_api_stubs/_2022_12}/constants.py | 0 .../array_api_stubs/_2022_12}/creation_functions.py | 0 .../array_api_stubs/_2022_12}/data_type_functions.py | 0 .../array_api => src/array_api_stubs/_2022_12}/data_types.py | 0 .../array_api_stubs/_2022_12}/elementwise_functions.py | 0 .../array_api => src/array_api_stubs/_2022_12}/fft.py | 0 .../array_api_stubs/_2022_12}/indexing_functions.py | 0 .../array_api => src/array_api_stubs/_2022_12}/linalg.py | 0 .../array_api_stubs/_2022_12}/linear_algebra_functions.py | 0 .../array_api_stubs/_2022_12}/manipulation_functions.py | 0 .../array_api_stubs/_2022_12}/searching_functions.py | 0 .../array_api => src/array_api_stubs/_2022_12}/set_functions.py | 0 .../array_api_stubs/_2022_12}/sorting_functions.py | 0 .../array_api_stubs/_2022_12}/statistical_functions.py | 0 .../array_api_stubs/_2022_12}/utility_functions.py | 0 60 files changed, 0 insertions(+), 0 deletions(-) rename spec/{ => 2022.12}/API_specification/array_object.rst (100%) rename spec/{ => 2022.12}/API_specification/broadcasting.rst (100%) rename spec/{ => 2022.12}/API_specification/constants.rst (100%) rename spec/{ => 2022.12}/API_specification/creation_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/data_type_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/data_types.rst (100%) rename spec/{ => 2022.12}/API_specification/elementwise_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/function_and_method_signatures.rst (100%) rename spec/{ => 2022.12}/API_specification/index.rst (100%) rename spec/{ => 2022.12}/API_specification/indexing.rst (100%) rename spec/{ => 2022.12}/API_specification/indexing_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/linear_algebra_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/manipulation_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/searching_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/set_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/sorting_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/statistical_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/type_promotion.rst (100%) rename spec/{ => 2022.12}/API_specification/utility_functions.rst (100%) rename spec/{ => 2022.12}/API_specification/version.rst (100%) rename spec/{ => 2022.12}/assumptions.md (100%) rename spec/{ => 2022.12}/benchmark_suite.md (100%) rename spec/{ => 2022.12}/changelog.rst (100%) rename spec/{ => 2022.12}/design_topics/C_API.rst (100%) rename spec/{ => 2022.12}/design_topics/accuracy.rst (100%) rename spec/{ => 2022.12}/design_topics/complex_numbers.rst (100%) rename spec/{ => 2022.12}/design_topics/copies_views_and_mutation.rst (100%) rename spec/{ => 2022.12}/design_topics/data_dependent_output_shapes.rst (100%) rename spec/{ => 2022.12}/design_topics/data_interchange.rst (100%) rename spec/{ => 2022.12}/design_topics/device_support.rst (100%) rename spec/{ => 2022.12}/design_topics/index.rst (100%) rename spec/{ => 2022.12}/design_topics/parallelism.rst (100%) rename spec/{ => 2022.12}/design_topics/static_typing.rst (100%) rename spec/{ => 2022.12}/extensions/fourier_transform_functions.rst (100%) rename spec/{ => 2022.12}/extensions/index.rst (100%) rename spec/{ => 2022.12}/extensions/linear_algebra_functions.rst (100%) rename spec/{ => 2022.12}/future_API_evolution.md (100%) rename spec/{ => 2022.12}/index.rst (100%) rename spec/{ => 2022.12}/purpose_and_scope.md (100%) rename spec/{ => 2022.12}/usage_data.md (100%) rename spec/{ => 2022.12}/use_cases.md (100%) rename spec/{ => 2022.12}/verification_test_suite.md (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/__init__.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/_types.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/array_object.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/constants.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/creation_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/data_type_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/data_types.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/elementwise_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/fft.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/indexing_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/linalg.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/linear_algebra_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/manipulation_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/searching_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/set_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/sorting_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/statistical_functions.py (100%) rename {spec/API_specification/array_api => src/array_api_stubs/_2022_12}/utility_functions.py (100%) diff --git a/spec/API_specification/array_object.rst b/spec/2022.12/API_specification/array_object.rst similarity index 100% rename from spec/API_specification/array_object.rst rename to spec/2022.12/API_specification/array_object.rst diff --git a/spec/API_specification/broadcasting.rst b/spec/2022.12/API_specification/broadcasting.rst similarity index 100% rename from spec/API_specification/broadcasting.rst rename to spec/2022.12/API_specification/broadcasting.rst diff --git a/spec/API_specification/constants.rst b/spec/2022.12/API_specification/constants.rst similarity index 100% rename from spec/API_specification/constants.rst rename to spec/2022.12/API_specification/constants.rst diff --git a/spec/API_specification/creation_functions.rst b/spec/2022.12/API_specification/creation_functions.rst similarity index 100% rename from spec/API_specification/creation_functions.rst rename to spec/2022.12/API_specification/creation_functions.rst diff --git a/spec/API_specification/data_type_functions.rst b/spec/2022.12/API_specification/data_type_functions.rst similarity index 100% rename from spec/API_specification/data_type_functions.rst rename to spec/2022.12/API_specification/data_type_functions.rst diff --git a/spec/API_specification/data_types.rst b/spec/2022.12/API_specification/data_types.rst similarity index 100% rename from spec/API_specification/data_types.rst rename to spec/2022.12/API_specification/data_types.rst diff --git a/spec/API_specification/elementwise_functions.rst b/spec/2022.12/API_specification/elementwise_functions.rst similarity index 100% rename from spec/API_specification/elementwise_functions.rst rename to spec/2022.12/API_specification/elementwise_functions.rst diff --git a/spec/API_specification/function_and_method_signatures.rst b/spec/2022.12/API_specification/function_and_method_signatures.rst similarity index 100% rename from spec/API_specification/function_and_method_signatures.rst rename to spec/2022.12/API_specification/function_and_method_signatures.rst diff --git a/spec/API_specification/index.rst b/spec/2022.12/API_specification/index.rst similarity index 100% rename from spec/API_specification/index.rst rename to spec/2022.12/API_specification/index.rst diff --git a/spec/API_specification/indexing.rst b/spec/2022.12/API_specification/indexing.rst similarity index 100% rename from spec/API_specification/indexing.rst rename to spec/2022.12/API_specification/indexing.rst diff --git a/spec/API_specification/indexing_functions.rst b/spec/2022.12/API_specification/indexing_functions.rst similarity index 100% rename from spec/API_specification/indexing_functions.rst rename to spec/2022.12/API_specification/indexing_functions.rst diff --git a/spec/API_specification/linear_algebra_functions.rst b/spec/2022.12/API_specification/linear_algebra_functions.rst similarity index 100% rename from spec/API_specification/linear_algebra_functions.rst rename to spec/2022.12/API_specification/linear_algebra_functions.rst diff --git a/spec/API_specification/manipulation_functions.rst b/spec/2022.12/API_specification/manipulation_functions.rst similarity index 100% rename from spec/API_specification/manipulation_functions.rst rename to spec/2022.12/API_specification/manipulation_functions.rst diff --git a/spec/API_specification/searching_functions.rst b/spec/2022.12/API_specification/searching_functions.rst similarity index 100% rename from spec/API_specification/searching_functions.rst rename to spec/2022.12/API_specification/searching_functions.rst diff --git a/spec/API_specification/set_functions.rst b/spec/2022.12/API_specification/set_functions.rst similarity index 100% rename from spec/API_specification/set_functions.rst rename to spec/2022.12/API_specification/set_functions.rst diff --git a/spec/API_specification/sorting_functions.rst b/spec/2022.12/API_specification/sorting_functions.rst similarity index 100% rename from spec/API_specification/sorting_functions.rst rename to spec/2022.12/API_specification/sorting_functions.rst diff --git a/spec/API_specification/statistical_functions.rst b/spec/2022.12/API_specification/statistical_functions.rst similarity index 100% rename from spec/API_specification/statistical_functions.rst rename to spec/2022.12/API_specification/statistical_functions.rst diff --git a/spec/API_specification/type_promotion.rst b/spec/2022.12/API_specification/type_promotion.rst similarity index 100% rename from spec/API_specification/type_promotion.rst rename to spec/2022.12/API_specification/type_promotion.rst diff --git a/spec/API_specification/utility_functions.rst b/spec/2022.12/API_specification/utility_functions.rst similarity index 100% rename from spec/API_specification/utility_functions.rst rename to spec/2022.12/API_specification/utility_functions.rst diff --git a/spec/API_specification/version.rst b/spec/2022.12/API_specification/version.rst similarity index 100% rename from spec/API_specification/version.rst rename to spec/2022.12/API_specification/version.rst diff --git a/spec/assumptions.md b/spec/2022.12/assumptions.md similarity index 100% rename from spec/assumptions.md rename to spec/2022.12/assumptions.md diff --git a/spec/benchmark_suite.md b/spec/2022.12/benchmark_suite.md similarity index 100% rename from spec/benchmark_suite.md rename to spec/2022.12/benchmark_suite.md diff --git a/spec/changelog.rst b/spec/2022.12/changelog.rst similarity index 100% rename from spec/changelog.rst rename to spec/2022.12/changelog.rst diff --git a/spec/design_topics/C_API.rst b/spec/2022.12/design_topics/C_API.rst similarity index 100% rename from spec/design_topics/C_API.rst rename to spec/2022.12/design_topics/C_API.rst diff --git a/spec/design_topics/accuracy.rst b/spec/2022.12/design_topics/accuracy.rst similarity index 100% rename from spec/design_topics/accuracy.rst rename to spec/2022.12/design_topics/accuracy.rst diff --git a/spec/design_topics/complex_numbers.rst b/spec/2022.12/design_topics/complex_numbers.rst similarity index 100% rename from spec/design_topics/complex_numbers.rst rename to spec/2022.12/design_topics/complex_numbers.rst diff --git a/spec/design_topics/copies_views_and_mutation.rst b/spec/2022.12/design_topics/copies_views_and_mutation.rst similarity index 100% rename from spec/design_topics/copies_views_and_mutation.rst rename to spec/2022.12/design_topics/copies_views_and_mutation.rst diff --git a/spec/design_topics/data_dependent_output_shapes.rst b/spec/2022.12/design_topics/data_dependent_output_shapes.rst similarity index 100% rename from spec/design_topics/data_dependent_output_shapes.rst rename to spec/2022.12/design_topics/data_dependent_output_shapes.rst diff --git a/spec/design_topics/data_interchange.rst b/spec/2022.12/design_topics/data_interchange.rst similarity index 100% rename from spec/design_topics/data_interchange.rst rename to spec/2022.12/design_topics/data_interchange.rst diff --git a/spec/design_topics/device_support.rst b/spec/2022.12/design_topics/device_support.rst similarity index 100% rename from spec/design_topics/device_support.rst rename to spec/2022.12/design_topics/device_support.rst diff --git a/spec/design_topics/index.rst b/spec/2022.12/design_topics/index.rst similarity index 100% rename from spec/design_topics/index.rst rename to spec/2022.12/design_topics/index.rst diff --git a/spec/design_topics/parallelism.rst b/spec/2022.12/design_topics/parallelism.rst similarity index 100% rename from spec/design_topics/parallelism.rst rename to spec/2022.12/design_topics/parallelism.rst diff --git a/spec/design_topics/static_typing.rst b/spec/2022.12/design_topics/static_typing.rst similarity index 100% rename from spec/design_topics/static_typing.rst rename to spec/2022.12/design_topics/static_typing.rst diff --git a/spec/extensions/fourier_transform_functions.rst b/spec/2022.12/extensions/fourier_transform_functions.rst similarity index 100% rename from spec/extensions/fourier_transform_functions.rst rename to spec/2022.12/extensions/fourier_transform_functions.rst diff --git a/spec/extensions/index.rst b/spec/2022.12/extensions/index.rst similarity index 100% rename from spec/extensions/index.rst rename to spec/2022.12/extensions/index.rst diff --git a/spec/extensions/linear_algebra_functions.rst b/spec/2022.12/extensions/linear_algebra_functions.rst similarity index 100% rename from spec/extensions/linear_algebra_functions.rst rename to spec/2022.12/extensions/linear_algebra_functions.rst diff --git a/spec/future_API_evolution.md b/spec/2022.12/future_API_evolution.md similarity index 100% rename from spec/future_API_evolution.md rename to spec/2022.12/future_API_evolution.md diff --git a/spec/index.rst b/spec/2022.12/index.rst similarity index 100% rename from spec/index.rst rename to spec/2022.12/index.rst diff --git a/spec/purpose_and_scope.md b/spec/2022.12/purpose_and_scope.md similarity index 100% rename from spec/purpose_and_scope.md rename to spec/2022.12/purpose_and_scope.md diff --git a/spec/usage_data.md b/spec/2022.12/usage_data.md similarity index 100% rename from spec/usage_data.md rename to spec/2022.12/usage_data.md diff --git a/spec/use_cases.md b/spec/2022.12/use_cases.md similarity index 100% rename from spec/use_cases.md rename to spec/2022.12/use_cases.md diff --git a/spec/verification_test_suite.md b/spec/2022.12/verification_test_suite.md similarity index 100% rename from spec/verification_test_suite.md rename to spec/2022.12/verification_test_suite.md diff --git a/spec/API_specification/array_api/__init__.py b/src/array_api_stubs/_2022_12/__init__.py similarity index 100% rename from spec/API_specification/array_api/__init__.py rename to src/array_api_stubs/_2022_12/__init__.py diff --git a/spec/API_specification/array_api/_types.py b/src/array_api_stubs/_2022_12/_types.py similarity index 100% rename from spec/API_specification/array_api/_types.py rename to src/array_api_stubs/_2022_12/_types.py diff --git a/spec/API_specification/array_api/array_object.py b/src/array_api_stubs/_2022_12/array_object.py similarity index 100% rename from spec/API_specification/array_api/array_object.py rename to src/array_api_stubs/_2022_12/array_object.py diff --git a/spec/API_specification/array_api/constants.py b/src/array_api_stubs/_2022_12/constants.py similarity index 100% rename from spec/API_specification/array_api/constants.py rename to src/array_api_stubs/_2022_12/constants.py diff --git a/spec/API_specification/array_api/creation_functions.py b/src/array_api_stubs/_2022_12/creation_functions.py similarity index 100% rename from spec/API_specification/array_api/creation_functions.py rename to src/array_api_stubs/_2022_12/creation_functions.py diff --git a/spec/API_specification/array_api/data_type_functions.py b/src/array_api_stubs/_2022_12/data_type_functions.py similarity index 100% rename from spec/API_specification/array_api/data_type_functions.py rename to src/array_api_stubs/_2022_12/data_type_functions.py diff --git a/spec/API_specification/array_api/data_types.py b/src/array_api_stubs/_2022_12/data_types.py similarity index 100% rename from spec/API_specification/array_api/data_types.py rename to src/array_api_stubs/_2022_12/data_types.py diff --git a/spec/API_specification/array_api/elementwise_functions.py b/src/array_api_stubs/_2022_12/elementwise_functions.py similarity index 100% rename from spec/API_specification/array_api/elementwise_functions.py rename to src/array_api_stubs/_2022_12/elementwise_functions.py diff --git a/spec/API_specification/array_api/fft.py b/src/array_api_stubs/_2022_12/fft.py similarity index 100% rename from spec/API_specification/array_api/fft.py rename to src/array_api_stubs/_2022_12/fft.py diff --git a/spec/API_specification/array_api/indexing_functions.py b/src/array_api_stubs/_2022_12/indexing_functions.py similarity index 100% rename from spec/API_specification/array_api/indexing_functions.py rename to src/array_api_stubs/_2022_12/indexing_functions.py diff --git a/spec/API_specification/array_api/linalg.py b/src/array_api_stubs/_2022_12/linalg.py similarity index 100% rename from spec/API_specification/array_api/linalg.py rename to src/array_api_stubs/_2022_12/linalg.py diff --git a/spec/API_specification/array_api/linear_algebra_functions.py b/src/array_api_stubs/_2022_12/linear_algebra_functions.py similarity index 100% rename from spec/API_specification/array_api/linear_algebra_functions.py rename to src/array_api_stubs/_2022_12/linear_algebra_functions.py diff --git a/spec/API_specification/array_api/manipulation_functions.py b/src/array_api_stubs/_2022_12/manipulation_functions.py similarity index 100% rename from spec/API_specification/array_api/manipulation_functions.py rename to src/array_api_stubs/_2022_12/manipulation_functions.py diff --git a/spec/API_specification/array_api/searching_functions.py b/src/array_api_stubs/_2022_12/searching_functions.py similarity index 100% rename from spec/API_specification/array_api/searching_functions.py rename to src/array_api_stubs/_2022_12/searching_functions.py diff --git a/spec/API_specification/array_api/set_functions.py b/src/array_api_stubs/_2022_12/set_functions.py similarity index 100% rename from spec/API_specification/array_api/set_functions.py rename to src/array_api_stubs/_2022_12/set_functions.py diff --git a/spec/API_specification/array_api/sorting_functions.py b/src/array_api_stubs/_2022_12/sorting_functions.py similarity index 100% rename from spec/API_specification/array_api/sorting_functions.py rename to src/array_api_stubs/_2022_12/sorting_functions.py diff --git a/spec/API_specification/array_api/statistical_functions.py b/src/array_api_stubs/_2022_12/statistical_functions.py similarity index 100% rename from spec/API_specification/array_api/statistical_functions.py rename to src/array_api_stubs/_2022_12/statistical_functions.py diff --git a/spec/API_specification/array_api/utility_functions.py b/src/array_api_stubs/_2022_12/utility_functions.py similarity index 100% rename from spec/API_specification/array_api/utility_functions.py rename to src/array_api_stubs/_2022_12/utility_functions.py From 314d1a9297ba602e0eefa8a805b69310c7f1409b Mon Sep 17 00:00:00 2001 From: Matthew Barber Date: Tue, 3 Jan 2023 17:08:29 +0000 Subject: [PATCH 2/3] Move old `2021.12` docs to respective sub-folders --- spec/{ => 2021.12}/API_specification/array_object.rst | 0 spec/{ => 2021.12}/API_specification/broadcasting.rst | 0 spec/{ => 2021.12}/API_specification/constants.rst | 0 spec/{ => 2021.12}/API_specification/creation_functions.rst | 0 spec/{ => 2021.12}/API_specification/data_type_functions.rst | 0 spec/{ => 2021.12}/API_specification/data_types.rst | 0 spec/{ => 2021.12}/API_specification/elementwise_functions.rst | 0 .../API_specification/function_and_method_signatures.rst | 0 spec/{ => 2021.12}/API_specification/index.rst | 0 spec/{ => 2021.12}/API_specification/indexing.rst | 0 spec/{ => 2021.12}/API_specification/linear_algebra_functions.rst | 0 spec/{ => 2021.12}/API_specification/manipulation_functions.rst | 0 spec/{ => 2021.12}/API_specification/searching_functions.rst | 0 spec/{ => 2021.12}/API_specification/set_functions.rst | 0 spec/{ => 2021.12}/API_specification/sorting_functions.rst | 0 spec/{ => 2021.12}/API_specification/statistical_functions.rst | 0 spec/{ => 2021.12}/API_specification/type_promotion.rst | 0 spec/{ => 2021.12}/API_specification/utility_functions.rst | 0 spec/{ => 2021.12}/assumptions.md | 0 spec/{ => 2021.12}/benchmark_suite.md | 0 spec/{ => 2021.12}/conf.py | 0 spec/{ => 2021.12}/design_topics/C_API.rst | 0 spec/{ => 2021.12}/design_topics/accuracy.rst | 0 spec/{ => 2021.12}/design_topics/copies_views_and_mutation.rst | 0 spec/{ => 2021.12}/design_topics/data_dependent_output_shapes.rst | 0 spec/{ => 2021.12}/design_topics/data_interchange.rst | 0 spec/{ => 2021.12}/design_topics/device_support.rst | 0 spec/{ => 2021.12}/design_topics/index.rst | 0 spec/{ => 2021.12}/design_topics/parallelism.rst | 0 spec/{ => 2021.12}/design_topics/static_typing.rst | 0 spec/{ => 2021.12}/extensions/index.rst | 0 spec/{ => 2021.12}/extensions/linear_algebra_functions.rst | 0 spec/{ => 2021.12}/future_API_evolution.md | 0 spec/{ => 2021.12}/index.rst | 0 spec/{ => 2021.12}/purpose_and_scope.md | 0 spec/{ => 2021.12}/usage_data.md | 0 spec/{ => 2021.12}/use_cases.md | 0 spec/{ => 2021.12}/verification_test_suite.md | 0 .../signatures => src/array_api_stubs/_2021_12}/__init__.py | 0 .../signatures => src/array_api_stubs/_2021_12}/_types.py | 0 .../signatures => src/array_api_stubs/_2021_12}/array_object.py | 0 .../signatures => src/array_api_stubs/_2021_12}/constants.py | 0 .../array_api_stubs/_2021_12}/creation_functions.py | 0 .../array_api_stubs/_2021_12}/data_type_functions.py | 0 .../signatures => src/array_api_stubs/_2021_12}/data_types.py | 0 .../array_api_stubs/_2021_12}/elementwise_functions.py | 0 .../signatures => src/array_api_stubs/_2021_12}/linalg.py | 0 .../array_api_stubs/_2021_12}/linear_algebra_functions.py | 0 .../array_api_stubs/_2021_12}/manipulation_functions.py | 0 .../array_api_stubs/_2021_12}/searching_functions.py | 0 .../signatures => src/array_api_stubs/_2021_12}/set_functions.py | 0 .../array_api_stubs/_2021_12}/sorting_functions.py | 0 .../array_api_stubs/_2021_12}/statistical_functions.py | 0 .../array_api_stubs/_2021_12}/utility_functions.py | 0 54 files changed, 0 insertions(+), 0 deletions(-) rename spec/{ => 2021.12}/API_specification/array_object.rst (100%) rename spec/{ => 2021.12}/API_specification/broadcasting.rst (100%) rename spec/{ => 2021.12}/API_specification/constants.rst (100%) rename spec/{ => 2021.12}/API_specification/creation_functions.rst (100%) rename spec/{ => 2021.12}/API_specification/data_type_functions.rst (100%) rename spec/{ => 2021.12}/API_specification/data_types.rst (100%) rename spec/{ => 2021.12}/API_specification/elementwise_functions.rst (100%) rename spec/{ => 2021.12}/API_specification/function_and_method_signatures.rst (100%) rename spec/{ => 2021.12}/API_specification/index.rst (100%) rename spec/{ => 2021.12}/API_specification/indexing.rst (100%) rename spec/{ => 2021.12}/API_specification/linear_algebra_functions.rst (100%) rename spec/{ => 2021.12}/API_specification/manipulation_functions.rst (100%) rename spec/{ => 2021.12}/API_specification/searching_functions.rst (100%) rename spec/{ => 2021.12}/API_specification/set_functions.rst (100%) rename spec/{ => 2021.12}/API_specification/sorting_functions.rst (100%) rename spec/{ => 2021.12}/API_specification/statistical_functions.rst (100%) rename spec/{ => 2021.12}/API_specification/type_promotion.rst (100%) rename spec/{ => 2021.12}/API_specification/utility_functions.rst (100%) rename spec/{ => 2021.12}/assumptions.md (100%) rename spec/{ => 2021.12}/benchmark_suite.md (100%) rename spec/{ => 2021.12}/conf.py (100%) rename spec/{ => 2021.12}/design_topics/C_API.rst (100%) rename spec/{ => 2021.12}/design_topics/accuracy.rst (100%) rename spec/{ => 2021.12}/design_topics/copies_views_and_mutation.rst (100%) rename spec/{ => 2021.12}/design_topics/data_dependent_output_shapes.rst (100%) rename spec/{ => 2021.12}/design_topics/data_interchange.rst (100%) rename spec/{ => 2021.12}/design_topics/device_support.rst (100%) rename spec/{ => 2021.12}/design_topics/index.rst (100%) rename spec/{ => 2021.12}/design_topics/parallelism.rst (100%) rename spec/{ => 2021.12}/design_topics/static_typing.rst (100%) rename spec/{ => 2021.12}/extensions/index.rst (100%) rename spec/{ => 2021.12}/extensions/linear_algebra_functions.rst (100%) rename spec/{ => 2021.12}/future_API_evolution.md (100%) rename spec/{ => 2021.12}/index.rst (100%) rename spec/{ => 2021.12}/purpose_and_scope.md (100%) rename spec/{ => 2021.12}/usage_data.md (100%) rename spec/{ => 2021.12}/use_cases.md (100%) rename spec/{ => 2021.12}/verification_test_suite.md (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/__init__.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/_types.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/array_object.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/constants.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/creation_functions.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/data_type_functions.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/data_types.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/elementwise_functions.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/linalg.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/linear_algebra_functions.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/manipulation_functions.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/searching_functions.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/set_functions.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/sorting_functions.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/statistical_functions.py (100%) rename {spec/API_specification/signatures => src/array_api_stubs/_2021_12}/utility_functions.py (100%) diff --git a/spec/API_specification/array_object.rst b/spec/2021.12/API_specification/array_object.rst similarity index 100% rename from spec/API_specification/array_object.rst rename to spec/2021.12/API_specification/array_object.rst diff --git a/spec/API_specification/broadcasting.rst b/spec/2021.12/API_specification/broadcasting.rst similarity index 100% rename from spec/API_specification/broadcasting.rst rename to spec/2021.12/API_specification/broadcasting.rst diff --git a/spec/API_specification/constants.rst b/spec/2021.12/API_specification/constants.rst similarity index 100% rename from spec/API_specification/constants.rst rename to spec/2021.12/API_specification/constants.rst diff --git a/spec/API_specification/creation_functions.rst b/spec/2021.12/API_specification/creation_functions.rst similarity index 100% rename from spec/API_specification/creation_functions.rst rename to spec/2021.12/API_specification/creation_functions.rst diff --git a/spec/API_specification/data_type_functions.rst b/spec/2021.12/API_specification/data_type_functions.rst similarity index 100% rename from spec/API_specification/data_type_functions.rst rename to spec/2021.12/API_specification/data_type_functions.rst diff --git a/spec/API_specification/data_types.rst b/spec/2021.12/API_specification/data_types.rst similarity index 100% rename from spec/API_specification/data_types.rst rename to spec/2021.12/API_specification/data_types.rst diff --git a/spec/API_specification/elementwise_functions.rst b/spec/2021.12/API_specification/elementwise_functions.rst similarity index 100% rename from spec/API_specification/elementwise_functions.rst rename to spec/2021.12/API_specification/elementwise_functions.rst diff --git a/spec/API_specification/function_and_method_signatures.rst b/spec/2021.12/API_specification/function_and_method_signatures.rst similarity index 100% rename from spec/API_specification/function_and_method_signatures.rst rename to spec/2021.12/API_specification/function_and_method_signatures.rst diff --git a/spec/API_specification/index.rst b/spec/2021.12/API_specification/index.rst similarity index 100% rename from spec/API_specification/index.rst rename to spec/2021.12/API_specification/index.rst diff --git a/spec/API_specification/indexing.rst b/spec/2021.12/API_specification/indexing.rst similarity index 100% rename from spec/API_specification/indexing.rst rename to spec/2021.12/API_specification/indexing.rst diff --git a/spec/API_specification/linear_algebra_functions.rst b/spec/2021.12/API_specification/linear_algebra_functions.rst similarity index 100% rename from spec/API_specification/linear_algebra_functions.rst rename to spec/2021.12/API_specification/linear_algebra_functions.rst diff --git a/spec/API_specification/manipulation_functions.rst b/spec/2021.12/API_specification/manipulation_functions.rst similarity index 100% rename from spec/API_specification/manipulation_functions.rst rename to spec/2021.12/API_specification/manipulation_functions.rst diff --git a/spec/API_specification/searching_functions.rst b/spec/2021.12/API_specification/searching_functions.rst similarity index 100% rename from spec/API_specification/searching_functions.rst rename to spec/2021.12/API_specification/searching_functions.rst diff --git a/spec/API_specification/set_functions.rst b/spec/2021.12/API_specification/set_functions.rst similarity index 100% rename from spec/API_specification/set_functions.rst rename to spec/2021.12/API_specification/set_functions.rst diff --git a/spec/API_specification/sorting_functions.rst b/spec/2021.12/API_specification/sorting_functions.rst similarity index 100% rename from spec/API_specification/sorting_functions.rst rename to spec/2021.12/API_specification/sorting_functions.rst diff --git a/spec/API_specification/statistical_functions.rst b/spec/2021.12/API_specification/statistical_functions.rst similarity index 100% rename from spec/API_specification/statistical_functions.rst rename to spec/2021.12/API_specification/statistical_functions.rst diff --git a/spec/API_specification/type_promotion.rst b/spec/2021.12/API_specification/type_promotion.rst similarity index 100% rename from spec/API_specification/type_promotion.rst rename to spec/2021.12/API_specification/type_promotion.rst diff --git a/spec/API_specification/utility_functions.rst b/spec/2021.12/API_specification/utility_functions.rst similarity index 100% rename from spec/API_specification/utility_functions.rst rename to spec/2021.12/API_specification/utility_functions.rst diff --git a/spec/assumptions.md b/spec/2021.12/assumptions.md similarity index 100% rename from spec/assumptions.md rename to spec/2021.12/assumptions.md diff --git a/spec/benchmark_suite.md b/spec/2021.12/benchmark_suite.md similarity index 100% rename from spec/benchmark_suite.md rename to spec/2021.12/benchmark_suite.md diff --git a/spec/conf.py b/spec/2021.12/conf.py similarity index 100% rename from spec/conf.py rename to spec/2021.12/conf.py diff --git a/spec/design_topics/C_API.rst b/spec/2021.12/design_topics/C_API.rst similarity index 100% rename from spec/design_topics/C_API.rst rename to spec/2021.12/design_topics/C_API.rst diff --git a/spec/design_topics/accuracy.rst b/spec/2021.12/design_topics/accuracy.rst similarity index 100% rename from spec/design_topics/accuracy.rst rename to spec/2021.12/design_topics/accuracy.rst diff --git a/spec/design_topics/copies_views_and_mutation.rst b/spec/2021.12/design_topics/copies_views_and_mutation.rst similarity index 100% rename from spec/design_topics/copies_views_and_mutation.rst rename to spec/2021.12/design_topics/copies_views_and_mutation.rst diff --git a/spec/design_topics/data_dependent_output_shapes.rst b/spec/2021.12/design_topics/data_dependent_output_shapes.rst similarity index 100% rename from spec/design_topics/data_dependent_output_shapes.rst rename to spec/2021.12/design_topics/data_dependent_output_shapes.rst diff --git a/spec/design_topics/data_interchange.rst b/spec/2021.12/design_topics/data_interchange.rst similarity index 100% rename from spec/design_topics/data_interchange.rst rename to spec/2021.12/design_topics/data_interchange.rst diff --git a/spec/design_topics/device_support.rst b/spec/2021.12/design_topics/device_support.rst similarity index 100% rename from spec/design_topics/device_support.rst rename to spec/2021.12/design_topics/device_support.rst diff --git a/spec/design_topics/index.rst b/spec/2021.12/design_topics/index.rst similarity index 100% rename from spec/design_topics/index.rst rename to spec/2021.12/design_topics/index.rst diff --git a/spec/design_topics/parallelism.rst b/spec/2021.12/design_topics/parallelism.rst similarity index 100% rename from spec/design_topics/parallelism.rst rename to spec/2021.12/design_topics/parallelism.rst diff --git a/spec/design_topics/static_typing.rst b/spec/2021.12/design_topics/static_typing.rst similarity index 100% rename from spec/design_topics/static_typing.rst rename to spec/2021.12/design_topics/static_typing.rst diff --git a/spec/extensions/index.rst b/spec/2021.12/extensions/index.rst similarity index 100% rename from spec/extensions/index.rst rename to spec/2021.12/extensions/index.rst diff --git a/spec/extensions/linear_algebra_functions.rst b/spec/2021.12/extensions/linear_algebra_functions.rst similarity index 100% rename from spec/extensions/linear_algebra_functions.rst rename to spec/2021.12/extensions/linear_algebra_functions.rst diff --git a/spec/future_API_evolution.md b/spec/2021.12/future_API_evolution.md similarity index 100% rename from spec/future_API_evolution.md rename to spec/2021.12/future_API_evolution.md diff --git a/spec/index.rst b/spec/2021.12/index.rst similarity index 100% rename from spec/index.rst rename to spec/2021.12/index.rst diff --git a/spec/purpose_and_scope.md b/spec/2021.12/purpose_and_scope.md similarity index 100% rename from spec/purpose_and_scope.md rename to spec/2021.12/purpose_and_scope.md diff --git a/spec/usage_data.md b/spec/2021.12/usage_data.md similarity index 100% rename from spec/usage_data.md rename to spec/2021.12/usage_data.md diff --git a/spec/use_cases.md b/spec/2021.12/use_cases.md similarity index 100% rename from spec/use_cases.md rename to spec/2021.12/use_cases.md diff --git a/spec/verification_test_suite.md b/spec/2021.12/verification_test_suite.md similarity index 100% rename from spec/verification_test_suite.md rename to spec/2021.12/verification_test_suite.md diff --git a/spec/API_specification/signatures/__init__.py b/src/array_api_stubs/_2021_12/__init__.py similarity index 100% rename from spec/API_specification/signatures/__init__.py rename to src/array_api_stubs/_2021_12/__init__.py diff --git a/spec/API_specification/signatures/_types.py b/src/array_api_stubs/_2021_12/_types.py similarity index 100% rename from spec/API_specification/signatures/_types.py rename to src/array_api_stubs/_2021_12/_types.py diff --git a/spec/API_specification/signatures/array_object.py b/src/array_api_stubs/_2021_12/array_object.py similarity index 100% rename from spec/API_specification/signatures/array_object.py rename to src/array_api_stubs/_2021_12/array_object.py diff --git a/spec/API_specification/signatures/constants.py b/src/array_api_stubs/_2021_12/constants.py similarity index 100% rename from spec/API_specification/signatures/constants.py rename to src/array_api_stubs/_2021_12/constants.py diff --git a/spec/API_specification/signatures/creation_functions.py b/src/array_api_stubs/_2021_12/creation_functions.py similarity index 100% rename from spec/API_specification/signatures/creation_functions.py rename to src/array_api_stubs/_2021_12/creation_functions.py diff --git a/spec/API_specification/signatures/data_type_functions.py b/src/array_api_stubs/_2021_12/data_type_functions.py similarity index 100% rename from spec/API_specification/signatures/data_type_functions.py rename to src/array_api_stubs/_2021_12/data_type_functions.py diff --git a/spec/API_specification/signatures/data_types.py b/src/array_api_stubs/_2021_12/data_types.py similarity index 100% rename from spec/API_specification/signatures/data_types.py rename to src/array_api_stubs/_2021_12/data_types.py diff --git a/spec/API_specification/signatures/elementwise_functions.py b/src/array_api_stubs/_2021_12/elementwise_functions.py similarity index 100% rename from spec/API_specification/signatures/elementwise_functions.py rename to src/array_api_stubs/_2021_12/elementwise_functions.py diff --git a/spec/API_specification/signatures/linalg.py b/src/array_api_stubs/_2021_12/linalg.py similarity index 100% rename from spec/API_specification/signatures/linalg.py rename to src/array_api_stubs/_2021_12/linalg.py diff --git a/spec/API_specification/signatures/linear_algebra_functions.py b/src/array_api_stubs/_2021_12/linear_algebra_functions.py similarity index 100% rename from spec/API_specification/signatures/linear_algebra_functions.py rename to src/array_api_stubs/_2021_12/linear_algebra_functions.py diff --git a/spec/API_specification/signatures/manipulation_functions.py b/src/array_api_stubs/_2021_12/manipulation_functions.py similarity index 100% rename from spec/API_specification/signatures/manipulation_functions.py rename to src/array_api_stubs/_2021_12/manipulation_functions.py diff --git a/spec/API_specification/signatures/searching_functions.py b/src/array_api_stubs/_2021_12/searching_functions.py similarity index 100% rename from spec/API_specification/signatures/searching_functions.py rename to src/array_api_stubs/_2021_12/searching_functions.py diff --git a/spec/API_specification/signatures/set_functions.py b/src/array_api_stubs/_2021_12/set_functions.py similarity index 100% rename from spec/API_specification/signatures/set_functions.py rename to src/array_api_stubs/_2021_12/set_functions.py diff --git a/spec/API_specification/signatures/sorting_functions.py b/src/array_api_stubs/_2021_12/sorting_functions.py similarity index 100% rename from spec/API_specification/signatures/sorting_functions.py rename to src/array_api_stubs/_2021_12/sorting_functions.py diff --git a/spec/API_specification/signatures/statistical_functions.py b/src/array_api_stubs/_2021_12/statistical_functions.py similarity index 100% rename from spec/API_specification/signatures/statistical_functions.py rename to src/array_api_stubs/_2021_12/statistical_functions.py diff --git a/spec/API_specification/signatures/utility_functions.py b/src/array_api_stubs/_2021_12/utility_functions.py similarity index 100% rename from spec/API_specification/signatures/utility_functions.py rename to src/array_api_stubs/_2021_12/utility_functions.py From f56de3c1777256e5727a6f73d2776af17686d754 Mon Sep 17 00:00:00 2001 From: Matthew Barber Date: Thu, 5 Jan 2023 13:20:15 +0000 Subject: [PATCH 3/3] Squashed previous all-versions work * Rudimentary `array_api_stubs` pkg and folder-per-version docs * Regex nitpick ignore for array types * Move `2021.12` docs to respective sub-folders * Fix autosummary by patching stub sub-modules in `conf.py` * Rudimentary build-all Makefile rule * Specify versions in `conf.py` * Use `versions.json` method for sphinx-material Otherwise don't think we can get links working on nested pages Notably this usually won't work locally - see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSRequestNotHttp * Update image paths to shared `_static/` * Use vars in `make build` definition * Expand regex used to identify unwanted type hint prefixes * Update `pages.yml` workflow * Store gh-pages `.gitignore` in `main` to be copied over * `_spec_conf.py` -> `_array_api_conf.py` * Basic package necessities * Replace `requirements.txt` with extra dependency `doc` * Basic local build guide * Update preview workflow * Remove out-of-date make things, new top-level Makefile * Minor `CONTRIBUTING.md` improvements * Basic `_array_api_conf.py` module docstring * Move quickstart to `README.md` * Use `array_api` as opposed to `signatures` for `2021.12` autodoc * More consistent Makefile * Introduce `_ghpages` to hold the non-Sphinx static files * Rudimentary spec release guide * Guide to preserve history for future spec releases --- .circleci/config.yml | 6 +- .github/workflows/pages.yml | 20 +-- .github/workflows/preview.yml | 2 +- .gitignore | 7 +- MANIFEST.in | 3 + Makefile | 22 ++++ PACKAGE.md | 9 ++ README.md | 116 ++++++++++++++++++ pyproject.toml | 30 +++++ requirements.txt | 7 -- spec/Makefile | 25 ---- spec/_ghpages/_gitignore.txt | 36 ++++++ spec/_ghpages/index.html | 10 ++ spec/_ghpages/versions.json | 5 + spec/draft/conf.py | 7 ++ spec/make.bat | 35 ------ src/_array_api_conf.py | 211 ++++++++++++++++++++++++++++++++ src/array_api_stubs/__init__.py | 2 + 18 files changed, 466 insertions(+), 87 deletions(-) create mode 100644 MANIFEST.in create mode 100644 Makefile create mode 100644 PACKAGE.md create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 spec/Makefile create mode 100644 spec/_ghpages/_gitignore.txt create mode 100644 spec/_ghpages/index.html create mode 100644 spec/_ghpages/versions.json create mode 100644 spec/draft/conf.py delete mode 100644 spec/make.bat create mode 100644 src/_array_api_conf.py create mode 100644 src/array_api_stubs/__init__.py diff --git a/.circleci/config.yml b/.circleci/config.yml index aab5a1744..cecae43c8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,10 +19,10 @@ jobs: name: build docs no_output_timeout: 25m command: | - pip install -r requirements.txt - sphinx-build -b html -WT --keep-going spec build/draft -d doctrees + pip install .[doc] + make - store_artifacts: - path: build/draft + path: _site/ workflows: version: 2 diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index fc8a97015..e615135d3 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -76,22 +76,14 @@ jobs: # Install dependencies: - name: 'Install dependencies' run: | - pip install -r ./requirements.txt + pip install .[doc] # Generate the documentation: - name: 'Build documentation' run: | # Turn warnings into errors and ensure .doctrees is not deployed: - sphinx-build -b html -WT --keep-going spec build/draft -d doctrees - - # Upload the build artifact: - - name: 'Upload build artifact' - uses: actions/upload-artifact@v2 - if: ${{ github.event_name == 'pull_request'}} - with: - name: html - path: build/ - if-no-files-found: error + export SPHINXOPTS="-b html -WT --keep-going -d doctrees" + make # Configure Git: - name: 'Configure Git' @@ -107,10 +99,10 @@ jobs: git checkout gh-pages timeout-minutes: 5 - # Copy build artifact: - - name: 'Copy build artifact' + - name: 'Copy build to root' run: | - rm -rf ./draft && cp -R ./build/draft ./draft + cp -R ./_site/* . + cp ./_site/.gitignore . timeout-minutes: 10 # Commit changes to: diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index cdfa3c57b..347dbfb8d 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -11,6 +11,6 @@ jobs: uses: larsoner/circleci-artifacts-redirector-action@master with: repo-token: ${{ secrets.GITHUB_TOKEN }} - artifact-path: 0/build/draft/index.html + artifact-path: 0/_site/draft/index.html circleci-jobs: build_page job-title: Check the rendered docs here! diff --git a/.gitignore b/.gitignore index 86bab2717..d4f538406 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ # SOFTWARE. #/ -spec/_build/ +_site/ doctrees/ build/ .vscode/ @@ -30,4 +30,7 @@ node_modules/ __pycache__/ *.pyc spec/**/generated -tmp/ \ No newline at end of file +tmp/ +*.egg-info/ +*.egg +dist/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 000000000..7616b26fd --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +exclude README.md +exclude src/_array_api_conf.py +include PACKAGE.md diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..451b9224c --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +# You can set these variables from the command line. +SPHINXOPTS ?= -W --keep-going +SOURCEDIR = spec +BUILDDIR = _site + +.PHONY: default clean build + +default: clean build + +clean: + -rm -rf $(BUILDDIR) + -find . -type d -name generated -exec rm -rf {} + + +build: + -mkdir -p $(BUILDDIR) + -cp "$(SOURCEDIR)/_ghpages/_gitignore.txt" "$(BUILDDIR)/.gitignore" + -cp "$(SOURCEDIR)/_ghpages/versions.json" "$(BUILDDIR)/versions.json" + -cp "$(SOURCEDIR)/_ghpages/index.html" "$(BUILDDIR)/index.html" + -touch "$(BUILDDIR)/.nojekyll" + -sphinx-build "$(SOURCEDIR)/2021.12" "$(BUILDDIR)/2021.12" $(SPHINXOPTS) + -cp -r "$(BUILDDIR)/2021.12" "$(BUILDDIR)/latest" + -sphinx-build "$(SOURCEDIR)/draft" "$(BUILDDIR)/draft" $(SPHINXOPTS) diff --git a/PACKAGE.md b/PACKAGE.md new file mode 100644 index 000000000..199c4e2a2 --- /dev/null +++ b/PACKAGE.md @@ -0,0 +1,9 @@ +# Stubs for the array API standard + +Documentation specific to singular Python objects in the spec (i.e. functions, +methods and attributes) are infact represented by stub objects in the package +`array-api-stubs`. These stubs ultimately get rendered via the autodoc +capabilities in Sphinx. + +TODO: describe how `array-api-stubs` can be used for tooling, once it actually +has the capacity to do so. diff --git a/README.md b/README.md index d0d88ae4c..96edb338e 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,122 @@ These are relevant documents related to the content in this repository: See [CONTRIBUTING.md](CONTRIBUTING.md) for how to go about contributing to this array API standard. + +## Building docs locally + +The spec website comprises of multiple Sphinx docs (one for each spec version), +all of which exist in `spec/` and rely on the modules found in `src/` (most +notably `array_api_stubs`). To install these modules and the additional +dependencies of the Sphinx docs, you can use + +```sh +$ pip install -e .[doc] # ensure you install the dependencies extra "doc" +``` + +To build specific versions of the spec, run `sphinx-build` on the respective +folder in `spec/`, e.g. + +```sh +$ sphinx-build spec/draft/ _site/draft/ +``` + +To build the whole website, which includes every version of +the spec, you can utilize the `make` commands defined in `spec/Makefile`, e.g. + +```sh +$ make +$ ls _site/ +2021.12/ draft/ index.html latest/ versions.json +``` + + +## Making a spec release + +The Sphinx doc at `spec/draft/` should be where the in-development spec resides, +with `src/array_api_stubs/_draft/` containing its respective stubs. A spec +release should involve: + +* Renaming `src/array_api_stubs/_draft/` to `src/array_api_stubs/_YYYY_MM` +* Renaming `spec/draft/` to `spec/YYYY.MM` +* Updating `spec/YYYY.MM/conf.py` + + ```diff + ... + - from array_api_stubs import _draft as stubs_mod + + from array_api_stubs import _YYYY_MM as stubs_mod + ... + - release = "DRAFT" + + release = "YYYY.MM" + ... + ``` + +* Updating `spec/_ghpages/versions.json` + + ```diff + { + + "YYYY.MM": "YYYY.MM", + ... + ``` + +* Updating `Makefile` + + ```diff + ... + -sphinx-build "$(SOURCEDIR)/PREVIOUS.VER" "$(BUILDDIR)/PREVIOUS.VER" $(SPHINXOPTS) + + -sphinx-build "$(SOURCEDIR)/YYYY.MM" "$(BUILDDIR)/YYYY.MM" $(SPHINXOPTS) + - -cp -r "$(BUILDDIR)/PREVIOUS.VER" "$(BUILDDIR)/latest" + + -cp -r "$(BUILDDIR)/YYYY.MM" "$(BUILDDIR)/latest" + ... + ``` + +These changes should be committed and tagged. The next draft should then be +created. To preserve git history for both the new release and the next draft: + +1. Create and checkout to a new temporary branch. + + ```sh + $ git checkout -b tmp + ``` + +2. Make an empty commit. This is required so merging the temporary branch + (4.) is not automatic. + + ```sh + $ git commit --allow-empty -m "Empty commit for draft at YYYY.MM " + ``` + +3. Checkout back to the branch you are making a spec release in. + + ```sh + $ git checkout YYYY.MM-release + ``` + +4. Merge the temporary branch, specifying no commit and no fast-forwarding. + + ```sh + $ git merge --no-commit --no-ff tmp + Automatic merge went well; stopped before committing as requested + ``` + +5. Checkout the `spec/draft/` files from the temporary branch. + + ```sh + $ git checkout tmp -- spec/draft/ + ``` + +6. Commit your changes. + + ```sh + $ git commit -m "Copy YYYY.MM as draft with preserved git history" + ``` + +You can run `git blame` on both `spec/YYYY.MM` and `spec/draft` files to verify +we've preserved history. See this [StackOverflow question](https://stackoverflow.com/q/74365771/5193926) +for more background on the approach we use. + + + + ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..b8240a665 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[project] +name = "array-api-stubs" +version = "0.0.2" +description = "Stubs for the array API standard" +authors = [] +license = {file = "LICENSE"} +readme = "PACKAGE.md" +requires-python = ">=3.8" +keywords = [] +classifiers = [] + +[project.urls] +Source = "https://github.com/data-apis/array-api/" +Documentation = "https://data-apis.org/array-api/" +Homepage = "https://data-apis.org/" + +[project.optional-dependencies] +doc = [ + "sphinx==4.3.0", + "sphinx-material==0.0.30", + "myst-parser", + "sphinx_markdown_tables", + "sphinx_copybutton", + "docutils<0.18", + "sphinx-math-dollar", +] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 230413784..000000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -sphinx==4.3.0 -sphinx-material==0.0.30 -myst-parser -sphinx_markdown_tables -sphinx_copybutton -docutils<0.18 -sphinx-math-dollar diff --git a/spec/Makefile b/spec/Makefile deleted file mode 100644 index e71fa39e1..000000000 --- a/spec/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -W --keep-going -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile clean - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -clean: - -rm -rf $(BUILDDIR) - -rm -rf "$(SOURCEDIR)/API_specification/generated" - -rm -rf "$(SOURCEDIR)/extensions/generated" diff --git a/spec/_ghpages/_gitignore.txt b/spec/_ghpages/_gitignore.txt new file mode 100644 index 000000000..4e7ddcaad --- /dev/null +++ b/spec/_ghpages/_gitignore.txt @@ -0,0 +1,36 @@ +#/ +# @license MIT +# +# Copyright (c) 2022 Python Data APIs Consortium. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +#/ +# +# Note this file is not intended to be a .gitignore for the main branch, but to +# be copied into gh-pages branch. + +_site +build/ +doctrees/ +.vscode/ +node_modules/ +__pycache__/ +*.pyc +spec/**/generated/ +src/*.egg-info/ diff --git a/spec/_ghpages/index.html b/spec/_ghpages/index.html new file mode 100644 index 000000000..e209341a3 --- /dev/null +++ b/spec/_ghpages/index.html @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/spec/_ghpages/versions.json b/spec/_ghpages/versions.json new file mode 100644 index 000000000..5a6aa4692 --- /dev/null +++ b/spec/_ghpages/versions.json @@ -0,0 +1,5 @@ +{ + "2021.12": "2021.12", + "latest": "latest", + "draft": "draft" +} diff --git a/spec/draft/conf.py b/spec/draft/conf.py new file mode 100644 index 000000000..f3804e7ad --- /dev/null +++ b/spec/draft/conf.py @@ -0,0 +1,7 @@ +import sys + +from array_api_stubs import _draft as stubs_mod +from _array_api_conf import * + +release = "DRAFT" +sys.modules["array_api"] = stubs_mod diff --git a/spec/make.bat b/spec/make.bat deleted file mode 100644 index 2119f5109..000000000 --- a/spec/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/src/_array_api_conf.py b/src/_array_api_conf.py new file mode 100644 index 000000000..82126be83 --- /dev/null +++ b/src/_array_api_conf.py @@ -0,0 +1,211 @@ +""" +Base config for all individual Sphinx docs in the array API repo. + +The array-api repo contains an individual Sphinx doc for each spec version, all +of which exist in ../spec/. This file is star-imported in the conf.py files of +these docs, allowing us to standardize configuration accross API versions. + +Every conf.py file which star-imports this should define + +* `release`, the str YYYY.MM release. Use "DRAFT" for the draft. +* `sys.modules['array_api']`, the stubs module to use for autodoc. +""" +import re + +import sphinx_material + +# -- Project information ----------------------------------------------------- + +project = 'Python array API standard' +copyright = '2020, Consortium for Python Data API Standards' +author = 'Consortium for Python Data API Standards' + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'myst_parser', + 'sphinx.ext.extlinks', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', + 'sphinx_markdown_tables', + 'sphinx_copybutton', + 'sphinx.ext.autosummary', + 'sphinx.ext.napoleon', + 'sphinx.ext.autodoc', +] + +autosummary_generate = True +autodoc_typehints = 'signature' +add_module_names = False +napoleon_custom_sections = [('Returns', 'params_style')] +default_role = 'code' + +# nitpicky = True makes Sphinx warn whenever a cross-reference target can't be +# found. +nitpicky = True +# autodoc wants to make cross-references for every type hint. But a lot of +# them don't actually refer to anything that we have a document for. +nitpick_ignore = [ + ('py:class', 'collections.abc.Sequence'), + ('py:class', "Optional[Union[int, float, Literal[inf, - inf, 'fro', 'nuc']]]"), + ('py:class', "Union[int, float, Literal[inf, - inf]]"), + ('py:obj', "typing.Optional[typing.Union[int, float, typing.Literal[inf, - inf, 'fro', 'nuc']]]"), + ('py:obj', "typing.Union[int, float, typing.Literal[inf, - inf]]"), + ('py:class', 'enum.Enum'), + ('py:class', 'ellipsis'), +] +nitpick_ignore_regex = [ + ('py:class', '.*array'), + ('py:class', '.*device'), + ('py:class', '.*dtype'), + ('py:class', '.*NestedSequence'), + ('py:class', '.*SupportsBufferProtocol'), + ('py:class', '.*PyCapsule'), + ('py:class', '.*finfo_object'), + ('py:class', '.*iinfo_object'), +] +# In array_object.py we have to use aliased names for some types because they +# would otherwise refer back to method objects of array +autodoc_type_aliases = { + 'array': 'array', + 'Device': 'device', + 'Dtype': 'dtype', +} + +# Make autosummary show the signatures of functions in the tables using actual +# Python syntax. There's currently no supported way to do this, so we have to +# just patch out the function that processes the signatures. See +# https://github.com/sphinx-doc/sphinx/issues/10053. +import sphinx.ext.autosummary as autosummary_mod +if hasattr(autosummary_mod, '_module'): + # It's a sphinx deprecated module wrapper object + autosummary_mod = autosummary_mod._module +autosummary_mod.mangle_signature = lambda sig, max_chars=30: sig + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['../_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# MyST options +myst_heading_anchors = 3 +myst_enable_extensions = ["colon_fence"] + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +extensions.append("sphinx_material") +html_theme_path = sphinx_material.html_theme_path() +html_context = sphinx_material.get_html_context() +html_theme = 'sphinx_material' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['../_static'] + + +# -- Material theme options (see theme.conf for more information) ------------ +html_show_sourcelink = False +html_sidebars = { + "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"] +} + +html_theme_options = { + + # Set the name of the project to appear in the navigation. + 'nav_title': f'Python array API standard', + + # Set you GA account ID to enable tracking + #'google_analytics_account': 'UA-XXXXX', + + # Specify a base_url used to generate sitemap.xml. If not + # specified, then no sitemap will be built. + #'base_url': 'https://project.github.io/project', + + # Set the color and the accent color (see + # https://material.io/design/color/the-color-system.html) + 'color_primary': 'indigo', + 'color_accent': 'green', + + # Set the repo location to get a badge with stats + #'repo_url': 'https://github.com/project/project/', + #'repo_name': 'Project', + + "html_minify": False, + "html_prettify": False, + "css_minify": True, + "logo_icon": "", + "repo_type": "github", + "touch_icon": "images/apple-icon-152x152.png", + "theme_color": "#2196f3", + "master_doc": False, + + # Visible levels of the global TOC; -1 means unlimited + 'globaltoc_depth': 2, + # If False, expand all TOC entries + 'globaltoc_collapse': True, + # If True, show hidden TOC entries + 'globaltoc_includehidden': True, + + "nav_links": [ + {"href": "index", "internal": True, "title": "Array API standard"}, + { + "href": "https://data-apis.org", + "internal": False, + "title": "Consortium for Python Data API Standards", + }, + ], + "heroes": { + "index": "A common API for array and tensor Python libraries", + #"customization": "Configuration options to personalize your site.", + }, + + "version_dropdown": True, + "version_json": "../versions.json", + "table_classes": ["plain"], +} + + +todo_include_todos = True +#html_favicon = "images/favicon.ico" + +html_use_index = True +html_domain_indices = True + +extlinks = { + "duref": ( + "http://docutils.sourceforge.net/docs/ref/rst/" "restructuredtext.html#%s", + "", + ), + "durole": ("http://docutils.sourceforge.net/docs/ref/rst/" "roles.html#%s", ""), + "dudir": ("http://docutils.sourceforge.net/docs/ref/rst/" "directives.html#%s", ""), + "pypa": ("https://packaging.python.org/%s", ""), +} + +# -- Prettify type hints ----------------------------------------------------- +r_type_prefix = re.compile(r"array_api(?:_stubs\._[a-z0-9_]+)?\._types\.") + +def process_signature(app, what, name, obj, options, signature, return_annotation): + if signature: +<<<<<<<< HEAD:spec/2021.12/conf.py + signature = signature.replace("signatures._types.", "") + if return_annotation: + return_annotation = return_annotation.replace("signatures._types.", "") +======== + signature = re.sub(r_type_prefix, "", signature) + if return_annotation: + return_annotation = re.sub(r_type_prefix, "", return_annotation) +>>>>>>>> bbd0384 (Squashed old all-versions work):src/_array_api_conf.py + return signature, return_annotation + +def setup(app): + app.connect("autodoc-process-signature", process_signature) diff --git a/src/array_api_stubs/__init__.py b/src/array_api_stubs/__init__.py new file mode 100644 index 000000000..54614644a --- /dev/null +++ b/src/array_api_stubs/__init__.py @@ -0,0 +1,2 @@ +from . import _2021_12, _draft +