-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add ResolvedRequirement and remove sdist_root_dir
from internal APIs?
#460
Comments
+1 we might still need to keep |
We could require that the user returns the expected sdist_root_dir. Is there any good reason we have to support deviations? |
We're already standardizing the sdist directory name, and that standardization broke sdist rebuilding (#430). What if we just went all the way, and always put the source code in a directory called |
So sdist_root_dir will point to |
I don't any reason to support deviation. We are already doing some sort of type checking on the return values of the plugins, we could add this restriction as well |
We have |
Ah that makes sense. Yeah I think that will make our lives easier |
A lot of APIs pass
ctx
,req
,version
, andsource_root_dir
around. We could make our implementation easier to understand by introducing aResolvedRequirement
type and removingsource_root_dir
.Instead of separate
req: Requirement
andversion: Version
arguments, we should combine both into aResolvedRequirement
object. This makes it obvious that a function expects a requirement that has been resolved to a particular version. We can also extend the type, e.g. include acanonicalized_name
andoverride_name
attribute.As far as I can tell, the
source_root_dir
parameter is redundant in almost all cases.unpack_source()
ensures that it is always equal toctx.build / f"{req_name}-{version}" / f"{req_name}-{version}"
, wherereq_name
is the normalized override name fromreq.name
. A user plugin could return a different path, though. I would rather make the naming convention a hard requirement for override plugins.I have a prototype of a
ResolvedRequirement
implementation that wraps a requirement and version object:The text was updated successfully, but these errors were encountered: