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

[FR] Seting sys.path for hy so it can locate modules correctly. #458

Open
glyh opened this issue Jan 25, 2023 · 2 comments
Open

[FR] Seting sys.path for hy so it can locate modules correctly. #458

glyh opened this issue Jan 25, 2023 · 2 comments

Comments

@glyh
Copy link

glyh commented Jan 25, 2023

As title.
I think that requires a lot of work because python have a lot of different build tool.

@glyh
Copy link
Author

glyh commented Jan 25, 2023

So for example, this is a pyproject.toml, a project.clj equivalent for python, we have to read tool.setuptools.packages.find.where section to locate our source file:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "chibicc-hy"
version = "0.0.1"
dependencies = [
    "hy == 1.0a4",
    "hyrule == 0.1"
]

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
chibicc_hy = ["*.hy"]

[tool.setuptools]
zip-safe = false

I don't know if using nREPL will be better, but if we can use nREPL, I think we should drop support for stdio, because this requires catching up every build system, which is not possible giving the manpower we have.

@glyh
Copy link
Author

glyh commented Jan 25, 2023

Right now the workaround is this:

'(do
   (import sys)
   (.insert sys.path 0 "/home/lyh/Documents/CS/Projects/compile/chibicc-series/chibicc-hy/src"))

insert the above in your code where the string is the root of the source of the package, and whenever enter the dir manually evaluate it.

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