Skip to content

Accept pathlib.Path as arguments #34

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 9 commits into from
Mar 2, 2020
Merged

Accept pathlib.Path as arguments #34

merged 9 commits into from
Mar 2, 2020

Conversation

pykong
Copy link
Contributor

@pykong pykong commented Feb 26, 2020

This PR modernizes pathspec to work with pathlib.Path objects.

  • modified normalize_file and normalize_files
  • added tests
  • updated docstrings

Closes: #33

Copy link
Owner

@cpburnz cpburnz left a comment

Choose a reason for hiding this comment

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

Except for a few minor critiques this looks excellent. Thank you.

@pykong
Copy link
Contributor Author

pykong commented Feb 27, 2020

@cpburnz Thanks for having a look.
I have implemented the requested changes.

@cpburnz cpburnz merged commit 1bb298c into cpburnz:master Mar 2, 2020
@cpburnz
Copy link
Owner

cpburnz commented Mar 2, 2020

Looks good, thanks.

@pykong
Copy link
Contributor Author

pykong commented Mar 2, 2020

You are welcome.
Btw - this is one library making very good use of pathspec:
https://github.com/pykong/copier#patterns-syntax

@pykong pykong deleted the path_args branch March 2, 2020 16:02
@cpburnz cpburnz mentioned this pull request Mar 6, 2020
bors bot added a commit to rehandalal/therapist that referenced this pull request Apr 20, 2020
118: Update pathspec to 0.8.0 r=rehandalal a=pyup-bot


This PR updates [pathspec](https://pypi.org/project/pathspec) from **0.7.0** to **0.8.0**.



<details>
  <summary>Changelog</summary>
  
  
   ### 0.8.0
   ```
   ------------------

- `Issue 30`_: Expose what patterns matched paths. Added `util.detailed_match_files()`.
- `Issue 31`_: `match_tree()` doesn&#39;t return symlinks.
- `Issue 34`_: Support `pathlib.Path`\ s.
- Add `PathSpec.match_tree_entries` and `util.iter_tree_entries()` to support directories and symlinks.
- API change: `match_tree()` has been renamed to `match_tree_files()`. The old name `match_tree()` is still available as an alias.
- API change: `match_tree_files()` now returns symlinks. This is a bug fix but it will change the returned results.

.. _`Issue 30`: cpburnz/python-pathspec#30
.. _`Issue 31`: cpburnz/python-pathspec#31
.. _`Issue 34`: cpburnz/python-pathspec#34
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pathspec
  - Changelog: https://pyup.io/changelogs/pathspec/
  - Repo: https://github.com/cpburnz/python-path-specification
</details>



Co-authored-by: pyup-bot <github-bot@pyup.io>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Accept Path as arguments
2 participants