Skip to content
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

hatch/hatchify is creating blank .venv/lib/python3.12/site-packages/*.pth file #1745

Open
bessx opened this issue Oct 6, 2024 · 0 comments

Comments

@bessx
Copy link

bessx commented Oct 6, 2024

Ultimately, hatch is not properly adding the installed package to the the PATH. This is incredibly annoying and means that I can only run the program from the my-package/src folder, otherwise I constantly get a Module not found error.

(.venv) users-MacBook-Pro:my-packaye user$ cd src
(.venv) users-MacBook-Pro:src user$ test
Hello, world!
(.venv) users-MacBook-Pro:src user$ cd ..
(.venv) users-MacBook-Pro:my-package user$ test
Traceback (most recent call last):
  File "/Users/user/Documents/dev/my-package/.venv/bin/test", line 5, in <module>
    from my_package.main import main
ModuleNotFoundError: No module named 'my_package'
cat .venv/lib/python3.12/site-packages/_my_package.pth 

(it's blank)

This is happening with every new module I create (using hatch new).

the only thing I add to pyproject.toml is:

[project.scripts]
test = "my_package.main:main"

[tool.hatch.build.targets.wheel]
packages = ["src/my_package"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant