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

zero-dependency pydust #161

Closed
shakfu opened this issue Oct 2, 2023 · 2 comments
Closed

zero-dependency pydust #161

shakfu opened this issue Oct 2, 2023 · 2 comments

Comments

@shakfu
Copy link
Contributor

shakfu commented Oct 2, 2023

While playing around with pydust in my recent PR, I was thinking about whether it would be possible to reduce pydust's dependencies to zero (outside of python and a zig compiler in PATH):

Pydust's current dependencies are as follows (please correct me if I'm wrong here):

  1. ziglang: pip installable zig compiler (redundant if zig compiler is in your system PATH)
  2. setuptools: presumably required for the pyproject.toml build system integration
  3. black: provides stub generation: eg fib.pyi, ..
  4. pydantic: provides type-checking, serialization / deserialization and more (dataclasses on steroids)

If one has an objective of making a zero-dependency pydust variant, one could consider dropping ziglang and setuptools and make stub_generation optionally available only if black is installed. As for the use of pydantic, it's only used in the two config classes: config.ExtModule and config.ToolPydust and could conceivably be dropped for some stdlib-only-dependent code (dataclasses?) .

While it is debatable why one would want a zero-dependency project, could this be considered as an objective by the project owners? Or are the above dependencies strategically important for the project's roadmap?

@gatesn
Copy link
Contributor

gatesn commented Oct 2, 2023

Unless there's a clear use-case, I'm not sure I see the benefit of removing the dependencies?

Regarding ziglang in particular, it's desirable to ensure source distributions can compile themselves during install without any external dependencies on the user's machine (i.e. a Zig toolchain). We see this as a huge benefit over shipping native C extensions. This could also be achieved by having Pydust users add zig lang to their build-system.requires instead of pydust taking the dependency, so this one is up for debate (particularly given how heavy it is)

@shakfu
Copy link
Contributor Author

shakfu commented Oct 2, 2023

Unless there's a clear use-case, I'm not sure I see the benefit of removing the dependencies?

Fair enough.

Regarding ziglang in particular, it's desirable to ensure source distributions can compile themselves during install without any external dependencies on the user's machine (i.e. a Zig toolchain). We see this as a huge benefit over shipping native C extensions. This could also be achieved by having Pydust users add zig lang to their build-system.requires instead of pydust taking the dependency, so this one is up for debate (particularly given how heavy it is)

Thanks. I understand the logic now, and I agree regarding 'ziglang', as it's currently downloaded and installed even if one wants to use one's system zig.

@shakfu shakfu closed this as completed Oct 4, 2023
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

2 participants