facebookresearch / facebookresearch/fairo
Remove `os.path.dirname` references in modules
- Dominant language
- Jupyter Notebook
- Stars
- 929
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
## Type of Issue
Select the type of issue:
- [ ] Bug report (to report a bug)
- [ ] Feature request (to request an additional feature)
- [ ] Tracker (I am just using this as a tracker)
- [x] Refactor request
- [ ] Documentation Ask
## Description
Huge thanks to @soumith for removing `sys.path.append` throughout the repo. Following up from this, IMO we should also remove any references to file processing paths in modules, i.e. code that we plan to package in the future. This includes `os.path.dirname`, `os.path.join` and any other `os.path` operations that manipulate resource names being passed in modules.
This is important if we ever want to release package binaries, eg. a Wheels distribution. Use the package resource API instead. For an example on using `pkg_resources`, see [this autocomplete tool script](https://github.com/facebookresearch/droidlet/blob/main/tools/data_processing/autocomplete_postprocess.py#L98-L101).
There's not a ton of these - I can clean it up, or @soumith can take a look during your refactor?
Contributor guide
Assessment
This issue has not been assessed yet.