Skip to content

Task: restructure repositoryΒ #21

Description

@jrihon

πŸ₯… Objective

my_project/
β”œβ”€β”€ src/
β”‚   └── my_package/
β”‚       β”œβ”€β”€ __init__.py
β”‚       └── main.py
β”œβ”€β”€ resources/           <-- Or place inside your package
β”‚   └── data.json
β”œβ”€β”€ config.yaml          <-- Or config.env
└── pyproject.toml       <-- Dependencies & Metadata

Using the pathlib library, we would do like so :

from pathlib import Path

# Points to the directory of the current file
current_dir = Path(__file__).parent
asset_path = current_dir.parent / "resources" / "data.json"

with open(asset_path, "r") as f:
    print(f.read())

πŸ“‹ Todo List

Granular steps to finish the task

  • Repository structured like an actual python package
  • assets / resources restructured in a way they are part of the source
  • removal of shell script and ducquehome variable

πŸ§ͺ Tests

When the package is easily installable and the resources are located correctly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

TaskA granular issue that can readily be worked on

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions