Skip to content

[Feature] refactor scripts to put shared code in a shared library #91

New issue

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

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

Already on GitHub? Sign in to your account

Closed
TimidRobot opened this issue Mar 16, 2024 · 4 comments · Fixed by #92 or #96
Closed

[Feature] refactor scripts to put shared code in a shared library #91

TimidRobot opened this issue Mar 16, 2024 · 4 comments · Fixed by #92 or #96
Assignees
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing feature help wanted Open to participation from the community 🟩 priority: low Low priority and doesn't need to be rushed 🏁 status: ready for work Ready for work

Comments

@TimidRobot
Copy link
Member

TimidRobot commented Mar 16, 2024

Problem

put shared code in a shared library

Description

Potential new shared module:

# Standard library
import datetime
import os.path


def setup():
    # Datetime
    datetime_today = datetime.datetime.today()

    # Paths
    path_work_dir = os.path.dirname(
        os.path.abspath(os.path.realpath(__file__))
    )
    path_repo_root = os.path.dirname(
        os.path.abspath(os.path.realpath(path_work_dir))
    )
    path_dotenv = os.path.abspath(
        os.path.realpath(os.path.join(path_work_dir, ".env"))
    )
    return path_repo_root, path_work_dir, path_dotenv, datetime_today

used in scripts (assumes above is named quantify):

# First-party/Local
import quantify

# ...

PATH_REPO_ROOT, PATH_WORK_DIR, PATH_DOTENV, DATETIME_TODAY = quantify.setup()
load_dotenv(PATH_DOTENV)
@TimidRobot
Copy link
Member Author

@nox1134 please comment on this issue so i can assign it to you

TimidRobot added a commit that referenced this issue Apr 2, 2024
Fixed: Refactor scripts #91, Adds logging #85 and Cleans code and comments #86 by Putting it in a Shared Library/Module
@TimidRobot
Copy link
Member Author

@IamMQaisar please comment on this issue so i can assign it to you

@IamMQaisar
Copy link
Contributor

Yes! @TimidRobot

@nox1134
Copy link
Contributor

nox1134 commented Apr 2, 2024

Hi @TimidRobot!

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