Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. So to be sure I understand how this works correctly:
  2. Given a repository that looks like
  3. ```
  4. /pyproject.toml
  5. /config/default.json
  6. /assets/random.csv
  7. /assets/data/emptyFolderForTempStorageAndProcessing/.gitkeep
  8. /project/ModuleName.py
  9. ```
  10.  
  11. and my pyproject.toml has (among other things)
  12. ```
  13. [tool.poetry]
  14. ...
  15. include = ["assets/**/*", "config/*.json"]
  16.  
  17. [tool.poetry.scripts]
  18. module-name = "project.ModuleName:main"
  19. ```
  20.  
  21. if I wanted to access `/config/default.json` from within `/project/ModuleName.py`, I would call `importlib.resources.open_test('config', 'default.json')`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement