-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for shared resources. #43
Conversation
9cff8ad
to
55cfd5d
Compare
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.
This looks great to me, added @richfitz to see if he wants to have a look too
elif src.is_dir(): | ||
shutil.copytree(src, dst, dirs_exist_ok=True) | ||
copied = { | ||
os.path.join(here, f): os.path.join(there, f) |
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.
Are we not moving to pathlib everywhere? Also happy to sort this out later in a single push too
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.
This is the dictionary that ends up being returned to the caller / used in the packet metadata. I think keeping them as str
is more appropriate. Path
isn't json-serializable natively, so we would have to cast it back as str anyway.
This is equivalent to orderly2's orderly_shared_resource. It looks for files in the `shared` directory, at the root of the repository. Files and directories are copied to the packet directory, and recorded in the metadata.
# | ||
# See https://github.com/python/cpython/issues/44626 for some discussion. | ||
# Unfortunately, while the issue was closed, the `is_relative` function | ||
# mentioned was never added. |
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.
Looks like in 3.13+ we can use this! python/cpython#113829 but for now this seems sensible
This is equivalent to orderly2's orderly_shared_resource. It looks for files in the
shared
directory, at the root of the repository. Files and directories are copied to the packet directory, and recorded in the metadata.