Skip to content

Rename compatible functions in tests.lib.path.Path. #6670

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

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

chrahunt
Copy link
Member

@chrahunt chrahunt commented Jul 2, 2019

Continuing the work for #6050. Several methods in our tests.lib.path.Path class have direct counterparts in pathlib.Path. In preparation for substituting pathlib.Path, this renames the methods/properties according to the following:

  1. namebase -> stem
  2. ext -> suffix
  3. folder -> parent
  4. exists -> exists()
  5. remove() -> unlink()
  6. rm() -> unlink()
  7. join() -> joinpath()
  8. write() -> write_text()

To remove any possibility of accidental usage of str.join(), a method has been added to Path that raises an exception. This can be removed after removing the inheritance from str.

@pradyunsg
Copy link
Member

FYI - Linters aren't happy.

Thanks again for picking this up. :)

@chrahunt chrahunt force-pushed the pathlib-refactor-2 branch from db70c31 to 39ac9ca Compare July 2, 2019 22:49
@chrahunt chrahunt mentioned this pull request Jul 3, 2019
@chrahunt
Copy link
Member Author

chrahunt commented Jul 3, 2019

Updated - linters are OK (but still disappointed).

@pradyunsg
Copy link
Member

I haven't reviewed every line but a skim seems like this does the right thing and @xavfernandez approved already, so going ahead and merging this. :)

@pradyunsg pradyunsg merged commit d641b54 into pypa:master Jul 3, 2019
@pradyunsg
Copy link
Member

Hurrah! Thanks for this PR @chrahunt!

@chrahunt chrahunt deleted the pathlib-refactor-2 branch July 3, 2019 11:48
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Aug 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants