Skip to content

Improve tools.chmod method description with pynumdoc#18038

Merged
czoido merged 8 commits intoconan-io:develop2from
uilianries:chmod/improve-docstring
Mar 31, 2025
Merged

Improve tools.chmod method description with pynumdoc#18038
czoido merged 8 commits intoconan-io:develop2from
uilianries:chmod/improve-docstring

Conversation

@uilianries
Copy link
Member

@uilianries uilianries commented Mar 28, 2025

This PR is a follow-up of the previous #17800, by updating only its docstring, following numpydoc format, which can be forwarded to the Conan docs without extra effort there.

The idea comes from conan-io/docs#4038 (comment)

Changelog: Omit
Docs: Omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Signed-off-by: Uilian Ries <uilianries@gmail.com>
conanfile : object
The current recipe object. Always use ``self``.
path : str
Path to the file or directory to change the permissions.
Copy link
Contributor

@czoido czoido Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggesting some minor changes, I think it may sound a bit better like that. Suggested for read but could be applied to all.

uilianries and others added 2 commits March 28, 2025 13:45
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
@@ -265,16 +265,49 @@ def chdir(conanfile, newdir):


def chmod(conanfile, path:str, read:bool=None, write:bool=None, execute:bool=None, recursive:bool=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arguments should be also changed here to Optional, not only y the docstring

uilianries and others added 3 commits March 28, 2025 13:45
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
def chmod(conanfile, path:str, read:bool=None, write:bool=None, execute:bool=None, recursive:bool=False):
"""
Change the permissions of a file or directory. The same as the Unix command chmod, but simplified.
def chmod(conanfile, path:str, read:Optional[bool]=None, write:Optional[bool]=None, execute:Optional[bool]=None, recursive:Optional[bool]=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is recursive Optional? Can it be None?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it only can be True/False. Fixed by 3511a9b

Signed-off-by: Uilian Ries <uilianries@gmail.com>
Co-authored-by: Carlos Zoido <mrgalleta@gmail.com>
@czoido czoido added this to the 2.15.0 milestone Mar 31, 2025
@czoido czoido merged commit 1f112d4 into conan-io:develop2 Mar 31, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants