python-thread / thread

A Python threading library extension ⭐️ Star to support our work!

Home Page:https://thread.ngjx.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to build project for local development?

ShiroTohu opened this issue · comments

How to build project for local development?

I understand that this project uses Poetry to manage and handle project dependencies, though I'm unsure how to build the project. I understand there is documentation for installing it manually. These are the steps I went through.

pipx install poetry
poetry install
poetry run python src/thread

Though when I run the project it return's this error:

Traceback (most recent call last):
  File "C:\Users\shirotohu\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\shirotohu\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\Mine\Programming\thread\src\thread\__main__.py", line 3, in <module>
    from .cli import app
ImportError: attempted relative import with no known parent package
  • I am running python version 3.9.2
  • I have looked at sys.path using poetry run python and importing sys
    • Only thing to note with this output is D:\\Mine\\Programming\\thread\\src

Expected Output

image
If I'm not mistaken, this should be the expected output.

Hi! The run command for threadCLI in local development should be $ poetry run thread
If you want to explicitly run it from python, the command would be $ poetry run python -m thread

If both methods still fail you, you can try manually installing from your package manager $ pip install -e . && thread -h

that worked perfectly, thanks very much!