glob patterns for data_files
See original GitHub issueWould be great to be able to use glob patterns for data_files
, so that one can write something like this:
[options.data_files]
share/myapp/doc = doc/*.md
This would be consistent with the way package_data
works.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:11 (5 by maintainers)
Top Results From Across the Web
A Beginner's Guide: Glob Patterns | Malik Browne
Globs, also known as glob patterns are patterns that can expand a wildcard pattern into a list of pathnames that match the given...
Read more >Tips for writing glob patterns in DeepSource configuration
Glob or "Shell Globing" is the process of writing glob patterns that match files in a filesystem. Glob patterns specify sets of filenames ......
Read more >Globbing Patterns - CommandBox
When a command has an argument with a type of Globber for a file path, that means you can use file globbing patterns...
Read more >Common glob pattern - TetraScience
The Glob patterns implemented in the File Log Agent is to provide methods to traverse the file system and returning files or the...
Read more >Appendix D. Glob Patterns - jEdit
jEdit uses glob patterns similar to those in the various Unix shells to implement file name filters in the file system browser. Glob...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The only invalid path on Unix is a null byte (and “/” cannot exist in filenames but validly denotes a directory separator).
It’s theoretically possible but highly unlikely people wanted a literal asterisk in their file names, but by the same token that “:” is illegal on Windows, and in fact also illegal even on Unix if you happen to be using fat32 or NTFS without the POSIX namespace (the restriction is part of the filesystem spec)…
… the asterisk is also illegal in filenames on Windows (and at the filesystem layer on fat32 and NTFS).
So, such code depending on literal asterisks would unexpectedly fail on Windows, and also on that one person’s USB drive used for copying around a personal python environment from Unix system to Unix system.
One could argue backwards compatibility with something inherently broken is not such an important priority, and even if someone did need that behavior, the asterisk would simply expand to multiple files including the one with the literal asterisk. So the package would collect too many files, but at least the desired file would in fact be there.
If we want to make it super unlikely for anyone to ever stumble across this by using some prefix marker like option 1, I don’t think
::glob::
provides additional utility overglob:
which would have symmetry with existing directives likefile:
,attr:
,find:
, andfind_namespace:
.Well, @pganssle’s concern was, I think, that people might be using the new directive and actually mean it to be a literal filename instead of a directive… the question is whether that’s a practical concern. So yeah, relatively safe.
Thanks for doing the legwork of actually implementing this!