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
respect pyproject.toml #16
Comments
Can you reliably find all the |
+1 for this, I also think as a longterm goal this would feel much more in-line with best practices to be able to specify this info there. Although @Roger-luo I think the syntax should be modified (see below) @cjdoris the the role of pyproject.toml is just as a build configuration file, so it actually does not included in the installed package. So it would require a bit of additional config; see below. (While it is the "correct" option, I guess I'm also not sure the extra effort is worth it though...) I think what would make sense is to have something like what [build-system]
requires = ["setuptools", "juliapkg_setup"]
build-backend = "setuptools.build_meta"
[project]
name = "myproject"
version = "0.1.0"
dependencies = [
"juliapkg",
"juliacall",
# other python dependencies
]
[tool.juliapkg]
julia_requires = "~1.6.7, ~1.7, ~1.8, ~1.9, =1.10.0, ^1.10.3"
load_file = "src/julia_deps.py" # Is generated during the build step
[tool.juliapkg.packages]
SymbolicRegression = { uuid = "8254be44-1295-4e6a-a16d-46603ac705cb", version = "=0.24.4" }
Serialization = { uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b", version = "1" } which would generate import juliapkg
juliapkg.require_julia("~1.6.7, ~1.7, ~1.8, ~1.9, =1.10.0, ^1.10.3")
juliapkg.add("SymbolicRegression", "8254be44-1295-4e6a-a16d-46603ac705cb", version="=0.24.4")
juliapkg.add("Serialization", "9e88b42a-f829-5b0c-bbe9-9e923198166b", version="1") Then, the package developer would add the following to the top of their import .julia_deps
... This is the same way that version information is usually passed from # This file is created by setuptools_scm during the build process:
from .version import __version__ I think we could do something similar for pyjuliapkg, since we would want to transfer build information from the pyproject.toml to the Python runtime. |
This is a neat idea. I've wondered about doing the analogue over in CondaPkg too - namely putting the dependencies into Project.toml instead of CondaPkg.toml. The situation is easier there because CondaPkg.toml is automatically gets bundled into the package it's in. Instead of generating a Feel free to develop this (it would be a new package, which is convenient) - but it's not a thing I'll have time to work on. |
One potential down-side - would it tie you into using a particular build system? There are quite a few Python build systems nowadays and I wouldn't want to force people into using only one. Taking |
Good points. Actually after reading more about it, while my suggestion was technically the "best practices" way of doing it, it just makes it so so so much more complicated for both us and the users. I think the better option is to simply package
Then we could just have |
I'm wondering if we can instead of creating a
juliapkg.json
, but putting a field insidepyproject.toml
likethis would making packaging a lot easier because
pyproject.toml
will be saved in a package wheel.The text was updated successfully, but these errors were encountered: