From a334f609e627f5855907f050f9846a9a86a04ef2 Mon Sep 17 00:00:00 2001 From: "Daniel J. Beutel" Date: Thu, 25 Jul 2024 17:09:18 +0200 Subject: [PATCH] Add dev scripts to Flower Datasets --- datasets/dev/build-flwr-datasets-docs.sh | 16 +++++++++++++++ datasets/dev/format.sh | 16 +++++++++++++++ datasets/dev/publish.sh | 21 ++++++++++++++++++++ datasets/dev/rm-caches.sh | 25 ++++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100755 datasets/dev/publish.sh create mode 100755 datasets/dev/rm-caches.sh diff --git a/datasets/dev/build-flwr-datasets-docs.sh b/datasets/dev/build-flwr-datasets-docs.sh index aefa47f147f..ed41a87a414 100755 --- a/datasets/dev/build-flwr-datasets-docs.sh +++ b/datasets/dev/build-flwr-datasets-docs.sh @@ -1,4 +1,20 @@ #!/bin/bash + +# Copyright 2024 Flower Labs GmbH. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== + # Generating the docs, rename and move the files such that the meet the convention used in Flower. # Note that it involves two runs of sphinx-build that are necessary. # The first run generates the .rst files (and the html files that are discarded) diff --git a/datasets/dev/format.sh b/datasets/dev/format.sh index c6977982dd6..b7dca9accab 100755 --- a/datasets/dev/format.sh +++ b/datasets/dev/format.sh @@ -1,4 +1,20 @@ #!/bin/bash + +# Copyright 2024 Flower Labs GmbH. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== + set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ diff --git a/datasets/dev/publish.sh b/datasets/dev/publish.sh new file mode 100755 index 00000000000..d76ce6de787 --- /dev/null +++ b/datasets/dev/publish.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Copyright 2024 Flower Labs GmbH. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== + +set -e +cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ + +python -m poetry publish -u __token__ -p ${PYPI_TOKEN} diff --git a/datasets/dev/rm-caches.sh b/datasets/dev/rm-caches.sh new file mode 100755 index 00000000000..8de3aa940d8 --- /dev/null +++ b/datasets/dev/rm-caches.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Copyright 2024 Flower Labs GmbH. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== + +set -e +cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ + +find . -type d -name __pycache__ -exec rm -r {} \+ +rm -rf .mypy_cache +rm -rf .pytest_cache +rm -rf .cache +rm -rf doc/build