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

Support scheme-agnostic projects #486

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bioball
Copy link
Contributor

@bioball bioball commented May 10, 2024

Supercedes and closes #255

@bioball bioball force-pushed the projects-from-any-uri branch 2 times, most recently from 270c9b7 to c0bbe50 Compare May 20, 2024 22:40
this.package != null
)
const local function isUriLocal(uri1: String, uri2: String): Boolean =
uri1.substring(0, uri1.indexOf(":")) == uri2.substring(0, uri2.indexOf(":"))
Copy link
Contributor Author

@bioball bioball May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't the perfect check. This should also check that the URIs have the same authority. This is hard to implement without a URI API within the stdlib though.

I think we can improve this if/when we move pkl.experimental.uri to the standard library.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd leave this comment in the code so we don't forget it.

@bioball bioball marked this pull request as ready for review May 20, 2024 22:53
Copy link
Contributor

@stackoverflow stackoverflow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'd add some note to our language reference explaining that projects can be loaded from different module keys, not only files. Probably in the Resolving Dependencies or Local Dependencies section.

@@ -34,4 +34,9 @@ examples {
["glob-read absolute package uri"] {
read*("package://localhost:0/birds@0.5.0#/catalog/*.pkl")
}

// https://github.com/apple/pkl/issues/166
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// https://github.com/apple/pkl/issues/166
// https://github.com/apple/pkl/issues/166

this.package != null
)
const local function isUriLocal(uri1: String, uri2: String): Boolean =
uri1.substring(0, uri1.indexOf(":")) == uri2.substring(0, uri2.indexOf(":"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd leave this comment in the code so we don't forget it.

@HT154
Copy link
Contributor

HT154 commented May 22, 2024

Thanks for picking this up! I've looked through the changes made for SPICE-0005 conformance and everything makes sense to me.

This also closes #166, which I'm delighted to see!

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

Successfully merging this pull request may close these issues.

None yet

3 participants