-
Notifications
You must be signed in to change notification settings - Fork 47
feat: initialize documentation directory #610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4610e96
ad64318
caf25c0
d6fd622
7b1fde4
603cba6
63d0aed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "rai_whoami" | ||
version = "0.0.4" | ||
version = "0.0.5" | ||
description = "Package to extract embodiment information from robot documentation" | ||
authors = ["Maciej Majek <[email protected]>"] | ||
readme = "README.md" | ||
|
@@ -24,6 +24,7 @@ pypdf = "^5.4.0" | |
|
||
[tool.poetry.scripts] | ||
build-whoami = "rai_whoami.build_whoami:main" | ||
initialize-docs = "rai_whoami.initialize_docs_directory:main" | ||
|
||
|
||
[build-system] | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,48 @@ | ||||||
# Copyright (C) 2025 Robotec.AI | ||||||
# | ||||||
# 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. | ||||||
|
||||||
import argparse | ||||||
from pathlib import Path | ||||||
|
||||||
SUBDIRECTORIES = [ | ||||||
"images", | ||||||
"documentation", | ||||||
"urdf", | ||||||
] | ||||||
|
||||||
|
||||||
def initialize_docs_directory(args: argparse.Namespace) -> None: | ||||||
documentation_dir = Path(args.documentation_dir) | ||||||
maciejmajek marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
if documentation_dir.exists(): | ||||||
print( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logging? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about it, decided to go with the simples option for such scripts. |
||||||
f"Directory {documentation_dir} already exists. Remove it or use different folder." | ||||||
) | ||||||
return | ||||||
|
||||||
for subdirectory in SUBDIRECTORIES: | ||||||
(documentation_dir / subdirectory).mkdir(parents=True) | ||||||
print( | ||||||
f"Initialized subdirectory {subdirectory} at {documentation_dir / subdirectory}" | ||||||
) | ||||||
|
||||||
|
||||||
def main(): | ||||||
parser = argparse.ArgumentParser() | ||||||
parser.add_argument("documentation_dir", type=Path) | ||||||
args = parser.parse_args() | ||||||
initialize_docs_directory(args) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Never seen that, I will keep the same style as other script files. |
||||||
|
||||||
|
||||||
if __name__ == "__main__": | ||||||
main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why bump by 4 numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Syncing with pypi. We are doing manual build & publish, which in the nearest future should be done automatically with auto version bump.